Repository navigation
Description
(lane openRepoShape-1, 2026-11-08T19:17:12Z)
Goal: adopt-project.py plan and check read a single-repository.yaml (and a project.yaml or family.yaml) that the commit holds as a symlink the way the doctor reads it on the disk, or say plainly that they did not follow a link, so a project that recorded staying single gets no advisory and no it could not be read (YamlError) NOTE over a file that can be read.
Problem
The Triad advisory that plan and check print is read from the commit the plan is written against (adopt-project.py:5971-6016; shape_advisory.read(path, commit=commit) at :6004). Tree.text (scripts/shape_advisory.py:441-449 at main 81eaf757) gives a committed file's bytes with git cat-file blob <commit>:<rel> (:447-448). For a symlink that blob holds the PATH it points to, not the file's text, and Tree.kind (:427-439, cat-file -t) answers blob, so the link counts as a file. On the disk the operating system follows the link, so the doctor reads the file.
Three readers take the path as YAML:
read_record(:765-799), forsingle-repository.yaml:parse_yaml("docs/record.yaml")raisesYamlError: line 1: expected `key: value`, got 'docs/record.yaml'(:789). The broadexcept(:790-792) turns it intoRECORD_SILENCES_NOTHINGwithit could not be read (YamlError), andrecord_report(:266-272) prints it asNOTE single-repository.yaml does not silence this: .... The NOTE is false: the record can be read; it is a link. Andplanadvises "This is a single repository" over a project that recorded staying single, where the disk reading (the doctor's) isrecorded-singleand the doctor stays silent._read_mapping(:452-467), forproject.yaml(:839) andfamily.yaml(:843): the same raise is swallowed to None by design (:453-461: a manifest it cannot read is a manifest it does not see), so there is no NOTE at all, and an assembly root or a family holder reads as neither (is_triadis False; thefamily-manifesttest at:844is False) and falls through toadvise(:900).adopt-project.pyreads the record a second time, for the record question (adopt-project.pyplan: ask aboutsingle-repository.yamlwith its own drop-or-root rule, not the genericambiguous-top-level-yamlquestion #528):ask_about_a_record_only(:3240-3269, called at:6483) asksread_record(Tree(source.path, source.commit))(:3260-3261). A linked record is "no record" there, so thesingle-repository.yamlentry is asked the generalambiguous-top-level-yamlquestion (contracts/path-classification.yaml:474) withleg: null, in place of the record'sambiguous-single-repository-recordquestion with its defaultdrop(contracts/path-classification.yaml:453; the default was ruled by Brett Heap on 2026-10-12,adopt-project.py:3276).check --planthen findsplan-unresolvedand exits 1, where a regular record plans clean and exits 0.
#1270 (for #1163) makes the commit reading follow a link for AGENTS.md only (Tree.is_link and Tree.text_through, shape_advisory.py:508 and :536 at its head 8e54c32d; neither exists on main). It lists this gap as a Known limit ("Unchanged by this PR."), and rejects following every file's link there because the record's reading also decides plan's record question (#528).
Measured
Main 81eaf757c1379f7a7e86e49940bef86def74fb34, git 2.43.0, CPython 3.12.3, in the probe environment (a stub gh first on PATH, a bogus GH_TOKEN, an empty GH_CONFIG_DIR, GIT_CONFIG_GLOBAL=/dev/null, GIT_SSH_COMMAND=false), no network. Each fixture is a one-commit repository in a folder Atlas whose origin is the acme/Orbit repository on github.com (never contacted), as r1163's fixtures are. The file is committed as a symlink to a regular file in docs/ of the same commit (docs/record.yaml, docs/project.yaml, docs/family.yaml), with a regular-file control beside each. The record holds the example of contracts/single-repository-record.yaml; project.yaml is a minimal Triad manifest (kind: project-manifest, schema: project-repo-schema, legs assembly, spec, code); family.yaml is kind: family-manifest. Per fixture:
adopt-project.py plan --source <Atlas> --project Orbit --org acme --elected-by 'Test Human' --elected-on 2026-10-06 --out <plan.yaml>
adopt-project.py check --plan <plan.yaml>
shape-doctor.py --root <Atlas> --json
shape_advisory.read(<Atlas>, commit=<sha>) # the commit reading, in process
shape_advisory.read(<Atlas>) # the disk reading, in process (the doctor's)
1. The three files (exit codes: plan / check / doctor):
| # | committed as | commit reading | disk reading | plan |
check --plan |
shape-doctor.py --json |
|---|---|---|---|---|---|---|
| 1 | single-repository.yaml -> docs/record.yaml |
advise, problem it could not be read (YamlError) |
recorded-single |
0: the two triad lines, then the NOTE below; entry leg: null, rule ambiguous-top-level-yaml |
1: the same three lines, and FINDING plan-unresolved: single-repository.yaml still has leg: null |
2, kind none, NOT A SHAPE ROOT; no triad-advisory row |
| 1c | control: a regular single-repository.yaml |
recorded-single |
recorded-single |
0: no Triad line; entry leg: drop, rule ambiguous-single-repository-record |
0: no Triad line, no finding | 2, kind none; no row |
| 2a | project.yaml -> docs/project.yaml, an assembly root |
advise |
triad-root |
0: the two triad lines, no NOTE |
1: the same lines; plan-unresolved and plan-root-symlink |
1, kind project |
| 2a-c | control: a regular project.yaml |
triad-root |
triad-root |
0: nothing | 1: plan-unresolved only |
1, kind project |
| 2b | the link of 2a beside a regular spec-leg AGENTS.md (r1163's leg fixture) |
leg-clone |
triad-root |
0: NOTE this is a clone of the spec leg of a Triad (its AGENTS.md is the spec leg's, as templates/spec-root/ writes it) ... |
1: that NOTE; plan-unresolved and plan-root-symlink |
1, kind project |
| 2b-c | control: regular project.yaml beside the leg's AGENTS.md |
triad-root |
triad-root |
0: nothing | 1: plan-unresolved only |
1, kind project |
| 3 | family.yaml -> docs/family.yaml, a family holder |
advise |
family-holder |
0: the two triad lines, no NOTE |
1: the same lines; plan-unresolved |
1, kind family |
| 3c | control: a regular family.yaml |
family-holder |
family-holder |
0: nothing | 1: plan-unresolved only |
1, kind family |
The exact lines of row 1, in plan and in check:
triad This is a single repository. The Triad -- an assembly root with a spec leg and a code leg -- is the preferred project shape, and this tool is how a repository reaches it, in place; preferred, not required: it confers nothing, and a single repository is reviewed identically.
Nothing converts until `execute`, on the word of a person deciding for this project, and a project that stays single can say so in single-repository.yaml instead. `plan` and `check` change nothing in it.
NOTE single-repository.yaml does not silence this: it could not be read (YamlError) (its schema is openRepoShape's contracts/single-repository-record.yaml); nothing fails on its account.
- Rows 2 and 3 exit 1 from
checkin the control too (a top-levelproject.yamlorfamily.yamlof the repository's own is an open question there), so the exit code does not tell the link from the control; the printed advisory does.planexits 0 in all ten rows, as the advisory never changes an exit status. - Row 2a is the realistic fixture. A leg does not ordinarily hold a
project.yaml, so row 2b is r1163's leg fixture with the link added; it showsproject.yamlis read before the leg'sAGENTS.mdon the disk and not in the commit. - The doctor's
--jsonrows are the same for each link and its control, but forshape-currencyin rows 2 and 3, which saysupdate-shape.py cannot re-pin this root: REFUSED update-rewrite-symlink: ... This command never writes through a symlink(update-shape.py:1558-1601). A linked record has no such refusal. - The doctor says
recorded-singleby saying nothing: itstriad-advisoryrow is absent for that state unless the record has field problems (shape-doctor.py:12296-12306), as rows 1 and 1c show. - The doctor asks its
triad-advisoryrow only of a directory with neither manifest (shape-doctor.py:12259-12267), so rows 2 and 3 have no such row, link or control: it classifies them as kindprojectandfamily, and the in-process disk reading names the state.
2. Other links to a record (exit codes plan / check / doctor are 0 / 1 / 2 in each row):
single-repository.yaml committed as |
commit reading | disk reading |
|---|---|---|
a link to a file of another kind (kind: release-config) |
advise, NOTE it could not be read (YamlError) |
advise, NOTE it declares kind 'release-config', not 'single-repository-record' |
| control: that file regular | advise, the declares kind NOTE |
the same |
a link spelled ./docs/record.yaml to a record in the commit (git 2.43 answers dangling for a . segment) |
advise, NOTE it could not be read (YamlError) |
recorded-single |
a dangling link (docs/record.yaml is not in the commit) |
advise, NOTE it could not be read (YamlError) |
advise, no NOTE (the stat fails ENOENT: absent) |
a link out of the commit (../elsewhere/record.yaml, a record beside the repository) |
advise, NOTE it could not be read (YamlError) |
recorded-single |
3. #1270's head 8e54c32d against main. The same 13 fixtures (rows 1 to 3 and these), every printed field (exit codes, the advisory and NOTE lines, the plan entry, the doctor row, both readings): 0 differences. #1270 changes nothing here, as its body says.
4. A scratch prototype of following the link (not a patch; no tests run beyond these fixtures): #1270's head with read_record (:789) and _read_mapping (:463) changed to read tree.text_through(rel) if tree.is_link(rel) else tree.text(rel) (two call sites, 6 lines added and 2 removed; a None reads as absent). On the same fixtures:
| fixture | with the link followed |
|---|---|
| 1, record link | recorded-single; no Triad line; entry leg: drop, rule ambiguous-single-repository-record; check exits 0 (as the control) |
| 2a, 2b, 3 | triad-root, triad-root, family-holder: no Triad line, no leg NOTE (as the disk) |
| link to another kind | NOTE it declares kind 'release-config', not 'single-repository-record' (as the disk) |
link spelled ./docs/record.yaml |
recorded-single; entry leg: drop; check exits 0 (as the disk; text_through drops the . segment) |
| dangling link | advise, no NOTE (as the disk) |
| link out of the commit | advise, NOTE it could not be read (OutOfTheCommit): the exception's class name; the disk says recorded-single |
Suggested fix
Two ways, and they combine.
A. Follow the link inside the commit, as #1270 does for AGENTS.md. Once #1270 has landed, read_record and _read_mapping read through Tree.is_link and Tree.text_through (measurement 4). For it:
- On every fixture of measurement 4 that stays inside the commit the readings then agree, including what
planwrites andcheck's exit, and a regular file reads as before (is_linkcosts onegit ls-treeand answers False where git cannot say). - It is the only way
project.yamlandfamily.yamlare reached:_read_mappingswallows every error by design and has no NOTE channel. - The
./docs/record.yamlspelling, which git 2.43 answersdangling, is already handled intext_through(_dot_segments_dropped; measured in measurement 4).
Against it:
- It changes
plan's record question (adopt-project.pyplan: ask aboutsingle-repository.yamlwith its own drop-or-root rule, not the genericambiguous-top-level-yamlquestion #528). A linked record takes the record rule's question and its defaultdrop(contracts/path-classification.yaml:453-474,adopt-project.py:3240-3269).dropremoves the linksingle-repository.yaml;docs/record.yamlis its own path with its own rule (in the fixturedocs/goes to the spec leg, the record's bytes with it). The rule's reason text ("the file no longer describes the project it sits in") assumes the file is the record. Whether a linked record should be dropped, or asked, needs a ruling, or a sentence in the rule. This is why it is its own issue and not part of shape_advisory.py: a leg'sAGENTS.mdcommitted as a symlink is read through it inside the commit, and one out of the commit leaves whether it is a leg unknown, soadopt-project.py planandcheckstop calling the leg a single repository (#1163) #1270. - A second caller:
shape-doctor.py:9419-9424callsask_about_a_record_onlyover a leg's INDEX (Source(mount, None, "", "")), and its comment says "a link is read as its blob and never followed" (shape-doctor.py: theplacementrow asks a leg's top-levelsingle-repository.yamlthe staying-single record's question by its name alone, so a file that declareskind: release-configis told it records that the repository stays single, on every run of a project adopted before #617 #691). Following must leave that reading as the doctor documents it, or move it too, so the doctor's audit of a leg agrees withplan(tests/test_doctor_recorded_answers.py). Not measured here. - A link out of the commit still needs an answer. shape_advisory.py: a leg's
AGENTS.mdcommitted as a symlink is read through it inside the commit, and one out of the commit leaves whether it is a leg unknown, soadopt-project.py planandcheckstop calling the leg a single repository (#1163) #1270 chooses silence forAGENTS.md(a fact outside the commit does not decide the advisory). For the record the advice is still given, so the honest answer is a NOTE, not silence and not(OutOfTheCommit).
B. An honest NOTE. read_record asks Tree.is_link(RECORD_FILE) first and, for a link it does not follow (or cannot), returns RECORD_SILENCES_NOTHING with a sentence that is true, for example it is a symlink in the commit, which the commit reading does not follow, so whether it records that this project stays a single repository is not known here. One call site, no change to the record question. Against it: plan still prints the advisory and still asks the general question (row 1's leg: null, plan-unresolved, exit 1), so it still disagrees with the doctor about a project that recorded staying single; only the false sentence goes. It cannot reach project.yaml or family.yaml without a new NOTE channel, so those would stay advise over a Triad root or a holder.
Weighing. Lead with the record; take A for the links that stay inside the commit, after #1270 lands, with the #528 consequence ruled first, and B's sentence for a link out of the commit and for any link git cannot follow. project.yaml and family.yaml come with A's two lines but are the less likely cases: update-shape.py already refuses to re-pin a root whose manifest is a link (update-rewrite-symlink), and the record's template says "Copy this file to the repository's ROOT" (templates/single-repository/single-repository.yaml:20). If they are left out, pin their advise with a row so the choice is on record.
Verify
Rows in tests/test_shape_advisory.py or a new tests/test_advisory_record_symlink.py beside #1270's tests/test_advisory_agents_md_symlink.py (the same fixtures and the read(commit=) and plan and check assertions), each failing on main:
- The record linked to a record inside the commit:
read(commit=)isrecorded-singleasread()is;planprints no Triad line; the entry isleg: drop, ruleambiguous-single-repository-record;check --planexits 0. - The same spelled
./docs/record.yaml, and through a linked folder. - A link to a file of another kind: the NOTE names the kind, as the disk's does, not
YamlError; the entry staysleg: null. - A dangling link, a loop, a link to a directory, a link through a file, a link to a file that is not UTF-8 (the
errors="replace"survivor of r1163, R6): under A the commit and the disk readings agree, with noYamlErrorNOTE where the disk says nothing. - A link out of the commit, relative and absolute: the NOTE says it is a link out of the commit, with no exception name in it.
project.yamllinked to a Triad manifest:triad-root, no advisory line; the same beside a regular legAGENTS.md(row 2b:triad-root, notleg-clone);family.yamllinked to a holder's manifest:family-holder. Or, if left out, the three pinned asadvise.- Controls: each of the three files regular, unchanged on main and with the change; a git whose
ls-treefails reads a regular file as before. - The doctor's leg audit (
shape-doctor.py:9419-9424) andplanagree for a leg whose index holds the record as a link (tests/test_doctor_recorded_answers.py). - Mutants, each killed: the link not followed in
read_record; not followed in_read_mapping; a dangling link read as a record; a link out of the commit read from the disk; the followed blob decoded witherrors="replace";ask_about_a_record_onlyhanded a different tree thanread_recordreads; the leg audit following whereplandoes not. - Gate: the new file,
tests/test_adopt_single_repository_record.py,tests/test_shape_advisory.py,tests/test_doctor_recorded_answers.py,tests/test_path_guard_hygiene.py; and, for a change toadopt-project.py,tests/test_shape_doctor.py(4 shards) andtests/test_scaffold_leg_path_collisions.py. Measured on git 2.43.0 and CPython 3.12.3 only; CI runs 3.14, and a git that follows a.segment answers the first ask.
Found by review r1163 of lane 1's PR #1270 (for #1163), Known limits (#1270 issuecomment-6724915296).
Outside v1.2.0 by Brett Heap's ruling of 2026-10-21T10:32:04Z.
Lane: openreposhape-1 (openRepoShape-1)
Activity
brettheap commentedon Nov 10, 2026
CLAIMED — lane openRepoShape-5, session 50cede29-ab82-4ca3-9f67-d98e1a58c8d2@Eagle, 2026-11-10T01:12:27Z, for #1272
Logged in
lanes/log/openRepoShape-5.mdatdb1db0d42c42c597e5ec1a3679f303cf89943668.The three reads (lane-collision-protocol Rule 1):
tests/test_advisory_record_symlink.py: the docstring is true of the c…
shape_advisory.py: a leg's `AGENTS.md` committed as a symlink is read…
Merge #1270's squash 3bf35b2 into fix/1272-record-symlink: scripts/sh…