Skip to content

Commit 15f1854

Browse files
authored
Merge pull request #371 from PyAutoLabs/feature/complete-archive-highlights
docs(complete): curate the Highlights band of complete/index.md
2 parents 4fa5911 + d386c44 commit 15f1854

3 files changed

Lines changed: 195 additions & 4 deletions

File tree

complete/AGENTS.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,23 @@ X" reads one record, not a 6000-line file.
2323

2424
## How to look something up (token-light — RAG is dead)
2525

26-
1. Read `complete/index.md` (the curated navigation — grouped `[[slug]]` links
27-
with one-line hooks, grouped by date, `unknown` last). It is **generated**
28-
from the records by `scripts/lifecycle.py index` — regenerate with
26+
1. Read `complete/index.md` (the navigation — ordinary markdown links,
27+
`[<slug>](<YYYY>/<MM>/<slug>.md)`, each with a one-line hook, grouped by
28+
date, `unknown` last; not `[[wiki-links]]`). It is **generated** from the
29+
records by `scripts/lifecycle.py index` — regenerate with
2930
`lifecycle.py index --apply`; a hand-curated **Highlights** band between the
3031
`CURATED` markers survives regeneration.
3132
2. Follow one or two links to the records you need.
3233
3. Only then grep a specific `complete/<YYYY>/<MM>/` bucket.
3334

35+
### What earns a Highlights line
36+
37+
Three things and nothing else: a **trap that cost a session**, a **decision that
38+
will be re-asked**, an **architecture invariant** worth not re-deriving. ~25-30
39+
entries under theme headings is the whole budget; a record that merely shipped
40+
something stays in the generated list. The hook states the **lesson, not the
41+
task** — a noun phrase, no dates, no PR numbers, two wrapped lines at most.
42+
3443
## Provenance
3544

3645
- Records are **written by the ship skills** via

complete/index.md

Lines changed: 104 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,110 @@ markers; everything below GENERATED is rebuilt.
1111
<!-- CURATED:START -->
1212
## Highlights
1313

14-
_(curate hard-won records here — survives regeneration.)_
14+
### JAX, numerics & performance
15+
16+
- [xla-cpu-eigen-pool-deadlock](2026/08/xla-cpu-eigen-pool-deadlock.md) — a JAX
17+
CPU hang that is XLA's own Eigen pool re-entered by ducc0's FFT; one call is
18+
one lottery ticket, so reproduce in a loop and read the HLO.
19+
- [jax-vmap-materialisation-hang](2026/08/jax-vmap-materialisation-hang.md)
20+
"and then silence" is the silence of stderr alone: a SIGKILLed child loses its
21+
whole block-buffered stdout, so set `PYTHONUNBUFFERED` before quarantining.
22+
- [numba-hst-curvature-matrix-speedup](2026/08/numba-hst-curvature-matrix-speedup.md)
23+
— instrument before optimising, and never route a sliding PSF window through
24+
an FFT convolver unreversed; a symmetric test kernel hides the error.
25+
- [multistart-nan-step-diagnostics](2026/08/multistart-nan-step-diagnostics.md)
26+
— an eager `jnp` reduction outside the jit costs more than the host transfer
27+
it avoids; fuse per-step diagnostics into the jitted call.
28+
- [regularization-jax-gradient-gaps](2026/08/regularization-jax-gradient-gaps.md)
29+
— an inherited term that silently evaluates to zero is the worst failure mode,
30+
wrong but finite; a factorization fallback must be all-or-nothing.
31+
- [cluster-f-jax-baseline-oom](2026/05/cluster-f-jax-baseline-oom.md) — verify a
32+
triage cluster against current main before mass-fixing: transient library
33+
state ages failures out faster than the report cycle.
34+
35+
### Release, build & CI drift
36+
37+
- [sub-312-install-tombstone](2026/08/sub-312-install-tombstone.md) — rehearse a
38+
release on TestPyPI: build isolation, the tenant firewall and a lagging JSON
39+
index all bite before upload, and resolution is read off the simple index.
40+
- [intra-family-dep-floors](2026/08/intra-family-dep-floors.md) — an ad-hoc venv
41+
inherits the dev `PYTHONPATH` and imports the source tree, so it can falsely
42+
confirm an install fix; `pip --dry-run` cannot be read as a resolution.
43+
- [release-validation-tri-state](2026/08/release-validation-tri-state.md) — an
44+
absent rehearsal is not a failed one; readiness prints a cached verdict over
45+
an embedded report copy, so re-ingesting changes nothing until re-aggregation.
46+
- [smoke-surface-retime-sweep](2026/08/smoke-surface-retime-sweep.md) — a parked
47+
script cannot report its own rot: SLOW markers hide real errors, and a
48+
dispatch-only harness is green by absence until someone dispatches it.
49+
- [script-size-guard-git-based](2026/08/script-size-guard-git-based.md) — a
50+
committed size snapshot rots; diff each changed script against its own blob at
51+
the merge-base instead, leaving no baseline to update and nothing to protect.
52+
- [pre-build-stages-untracked-wip](2026/08/pre-build-stages-untracked-wip.md)
53+
`git add <dir>/` stages untracked files, so release automation that
54+
formats-then-stages publishes stray work; validate before the first push.
55+
56+
### Samplers & inference
57+
58+
- [nautilus-test-mode-degenerate-corner](2026/08/nautilus-test-mode-degenerate-corner.md)
59+
— a degenerate posterior is degenerate in its weights, not its row count;
60+
guard corner plots on the Kish effective sample size.
61+
- [ep-hierarchical-scale-collapse-guard](2026/08/ep-hierarchical-scale-collapse-guard.md)
62+
— a guard's unit test can be green while the guard cannot fire; feed it the
63+
recorder's real output shape, and check the new tests fail on the base.
64+
- [stored-sample-reconstruction-guard](2026/08/stored-sample-reconstruction-guard.md)
65+
— a stored sample that current model validation rejects must recover to the
66+
next valid one or raise a typed exception, never a raw internal one.
67+
- [heart-red-guarded-sample-escape](2026/08/heart-red-guarded-sample-escape.md)
68+
a correct rejection guard is not enough while other paths reconstruct or
69+
re-serve the rejected sample; find every consumer before declaring it fixed.
70+
- [clipper-validation-campaign](2026/08/clipper-validation-campaign.md) — budget
71+
decides the answer: grade the alive-versus-step curve rather than a survival
72+
percentage, and read an all-zero counter arm as broken, not as a null result.
73+
- [delaunay-nan-probe-fix](2026/08/delaunay-nan-probe-fix.md) — a probe that
74+
builds pathological input through the public constructor inherits the public
75+
validation; poison below the boundary the guard defends.
76+
77+
### Lensing science
78+
79+
- [point-solver-magnification-plane-redshift](2026/08/point-solver-magnification-plane-redshift.md)
80+
— in a multi-plane tracer the solver must evaluate at the source's own plane;
81+
two halves of one likelihood disagreeing means a half-wired argument.
82+
- [group-subhalo-lens-dict](2026/07/group-subhalo-lens-dict.md) — a multi-galaxy
83+
script's deflector count comes from its own dataset's `main_lens_centres.json`,
84+
and extra galaxies are a separate collection from main lens galaxies.
85+
- [nfw-truncated-potential-accuracy](2026/08/nfw-truncated-potential-accuracy.md)
86+
— where a profile has a published analytic potential, port it rather than
87+
re-tune the MGE approximation; `grad(psi) = alpha` is the check that finds it.
88+
- [over-sample-trailing-one-to-two](2026/07/over-sample-trailing-one-to-two.md)
89+
a lensed-source arc is never evaluated at sub-size 1: MGE Gaussians alias at
90+
1x1 and degrade gradient searches, so adaptive schemes floor at 2x2.
91+
- [adapt-image-cache-mask-validation](2026/07/adapt-image-cache-mask-validation.md)
92+
— a stale adapt-image cache imitates an indexing bug; a completed pipeline
93+
never re-evaluates the likelihood, and `Paths.restore` re-extracts the zip.
94+
- [adapt-linear-regularization](2026/08/adapt-linear-regularization.md) — correct
95+
a shipped regularization convention by adding sibling classes, never by
96+
mutating the existing ones: identifiers and aggregator reloads must stay valid.
97+
98+
### Mind / Brain infrastructure
99+
100+
- [agent-failure-modes](2026/07/agent-failure-modes.md) — the measured taxonomy
101+
of how agents fail here: refusals work where informs do not, and a guard's
102+
first live hour is where its false positives surface.
103+
- [api-gate-clause-scope](2026/07/api-gate-clause-scope.md) — a `PreToolUse` gate
104+
must scope its interpreter state per shell clause; a latched flag scans a later
105+
clause's file arguments and blocks on symbols nothing was going to call.
106+
- [spawn-drift-self-heal](2026/08/spawn-drift-self-heal.md) — hand-written test
107+
fixtures let the real workflow drift past the guard; point a generator's tests
108+
at the actual files they exist to protect.
109+
- [registry-integrity-check](2026/08/registry-integrity-check.md) — a registry
110+
nobody retires entries from costs a whole task-selection session; check that
111+
every entry's prompt path resolves and contradicts no other lifecycle state.
112+
- [worktree-claim-parser-forms](2026/08/worktree-claim-parser-forms.md) — cloud
113+
clones are shallow, so a history sweep silently returns nothing; check
114+
`--is-shallow-repository` before concluding anything from git history.
115+
- [lifecycle-state-split](2026/07/lifecycle-state-split.md) — the Mind ran two
116+
parallel lifecycles, prompt files and the ledger, until draft/active/complete
117+
made the file's location the state; one source of truth per fact.
15118
<!-- CURATED:END -->
16119

17120
<!-- GENERATED:START — edit records, not this block; regenerate with `lifecycle.py index --apply` -->

tests/test_lifecycle_index.py

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
"""Contract test for the curated Highlights band in `complete/index.md`.
2+
3+
`lifecycle.py index --check` is a byte-for-byte round trip over the WHOLE file,
4+
so a hand-curated band that the renderer re-emits differently turns the CI drift
5+
check red on a file nobody touched. The band is also the only hand-written thing
6+
in a generated file — if regeneration ever ate it, the curation is lost silently
7+
and the index still looks healthy.
8+
9+
Fictional fixtures only: `tests/**` is KEEP-copied verbatim into the public
10+
template (see `test_spawn_privacy.py`), so nothing here names a real repository,
11+
task or record.
12+
"""
13+
14+
import sys
15+
from pathlib import Path
16+
from types import SimpleNamespace
17+
18+
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "scripts"))
19+
20+
import lifecycle # noqa: E402
21+
22+
23+
BAND = """## Highlights
24+
25+
### Flywheel calibration
26+
27+
- [sprocket-calibration](2026/08/sprocket-calibration.md) — a torque baseline
28+
measured on a warm rig cannot grade a cold one; re-measure both columns
29+
back-to-back.
30+
- [widget-alignment](2026/08/widget-alignment.md) — the alignment jig reads its
31+
own last result when the output directory is not cleared."""
32+
33+
34+
def _mind(root: Path, *, band: str) -> Path:
35+
"""A tiny fictional Mind: two dated records + an index carrying `band`."""
36+
complete = root / "complete"
37+
bucket = complete / "2026" / "08"
38+
bucket.mkdir(parents=True)
39+
(bucket / "sprocket-calibration.md").write_text(
40+
"## sprocket-calibration\n- summary: re-measured the torque baseline\n"
41+
)
42+
(bucket / "widget-alignment.md").write_text(
43+
"## widget-alignment\n- summary: cleared the jig output directory\n"
44+
)
45+
(complete / "index.md").write_text(
46+
f"{lifecycle.CURATED_START}\n{band}\n{lifecycle.CURATED_END}\n"
47+
)
48+
return complete
49+
50+
51+
def _point_lifecycle_at(monkeypatch, root: Path, complete: Path) -> None:
52+
monkeypatch.setattr(lifecycle, "ROOT", root)
53+
monkeypatch.setattr(lifecycle, "COMPLETE_DIR", complete)
54+
monkeypatch.setattr(lifecycle, "ARCHIVE_DIR", complete / "archive")
55+
monkeypatch.setattr(lifecycle, "INDEX_MD", complete / "index.md")
56+
57+
58+
def test_a_curated_band_survives_index_regeneration_byte_for_byte(
59+
tmp_path, monkeypatch
60+
):
61+
"""Headings and markdown-link bullets inside the CURATED markers must come
62+
back out of `index --apply` unchanged, and `index --check` must then be
63+
clean — the band and the renderer have to agree on every byte."""
64+
complete = _mind(tmp_path, band=BAND)
65+
_point_lifecycle_at(monkeypatch, tmp_path, complete)
66+
67+
assert lifecycle.cmd_index(SimpleNamespace(check=False, apply=True)) == 0
68+
69+
rendered = (complete / "index.md").read_text()
70+
band_back = rendered.split(lifecycle.CURATED_START, 1)[1].split(
71+
lifecycle.CURATED_END, 1
72+
)[0]
73+
assert band_back == f"\n{BAND}\n"
74+
# the generated half is still built from the records themselves
75+
assert "- [sprocket-calibration](2026/08/sprocket-calibration.md)" in (
76+
rendered.split(lifecycle.GEN_START, 1)[1]
77+
)
78+
79+
assert lifecycle.cmd_index(SimpleNamespace(check=True, apply=False)) == 0

0 commit comments

Comments
 (0)