Skip to content

Commit afa69e7

Browse files
authored
docs(internals): three submodule states, the path-gated orphan scan, and chaining the edit to the commit (#194)
Regenerates three git-workflow artifacts from the skill and agent entities in candy/charly-internals/charly.yml, landing as opencharly/charly#289 at 3363e83b. The reference page: three dirty-submodule states under `git status --short` (` ?` untracked, ` m` modified content, ` M` moved gitlink), of which only ` M` carries an ordinary-path meaning, and `--porcelain` collapses all three; the path-gated orphan scan; the mechanism-keyed sweep run once per repo, since `git grep` does not cross a gitlink; and the regeneration window a projection-first ordering guarantees. The skill: `git show --stat` after every commit as the only post-commit check on the committing side that sees a commit whose message describes an intent its diff does not carry, and chaining the edit to the commit so a failed edit cannot reach one — necessary, not sufficient, since a silent no-op edit exits zero. The agent spec: the tag invariant that survives a skipped Phase 3, with the scope clause that keeps it from firing on 66 of 203 pre-convention entries, and the converse caveat for the three tags with no entry. Documentation-only. Each artifact is byte-identical to `banner + content` for the reference page and `frontmatter + banner + content` for the agent spec and the skill, verified by SHA-256 against a YAML load of the candy with no generator run. Findings on untouched page text are registered as opencharly/charly#295. Assisted-by: Claude Code Anthropic Claude Opus 5 (documentation reviewed)
1 parent cc22d9d commit afa69e7

4 files changed

Lines changed: 176 additions & 21 deletions

File tree

‎CHANGELOG/2026.229.1619.md‎

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# 2026.229.1619 — the orphan scan, the three submodule states, the sweep that finds a paraphrase, and chaining the edit to the commit
2+
3+
**This is a REGENERATION, not an authored edit.** All three artifacts carry the
4+
`GENERATED … DO NOT EDIT` banner; their source is `candy/charly-internals/charly.yml` in `charly`,
5+
landing as `opencharly/charly#289`.
6+
7+
This entry states what the artifacts now say. The review that produced them — six rounds on this PR,
8+
every finding real — is in `opencharly/plugins#194`, reachable as `refs/pull/194/head` after the
9+
branch is deleted. **It is deliberately not retold here**: an entry that narrates its own review
10+
re-creates its defect surface on every push, and every finding in this PR's last four rounds was in
11+
that narration rather than in the artifacts.
12+
13+
## What the reference page now says
14+
15+
**The orphan scan is path-gated.** `scanGenerated` has three arms and only the first reads a file's
16+
bytes: it walks `plugins/<family>/skills` and `.../agents` for the generated header; it adds a fixed
17+
list of known paths on existence alone; it takes every file under `.claude/hooks/` outright. So the
18+
header decides only inside the walked trees, and a header-less file is invisible only when it **also**
19+
sits outside the known paths and the hooks directory — the condition `prune.go`'s own comment states.
20+
21+
**`(stale)` marks the orphan** — a generated path no source claims — not a file behind its source.
22+
Both red directions print the same `are stale` headline, so the suffix is the only discriminator, and
23+
it names the rarer case. `(orphan)` would say it; that message fix is filed as `opencharly/charly#290`
24+
rather than compensated for in prose.
25+
26+
**`git status --short` distinguishes three dirty-submodule states**: ` ?` untracked content, ` m`
27+
modified content, ` M` a moved gitlink — and `--porcelain` collapses **all three** to ` M`, so the
28+
script-safe spelling is the one that loses every distinction. Only ` M` has an ordinary-path meaning:
29+
an untracked ordinary path is `??`, two columns, and lowercase ` m` never appears on one at all.
30+
31+
**`drift` compares every generated artifact**, not only the `plugins/` corpus — the harness surface
32+
(`CLAUDE.md`, `AGENTS.md`, `.claude/settings.json`, `.claude/hooks/*`) is in the same emissions map.
33+
Its reporter lists all but those seven, which is why `generate` prints 400 and lists 393.
34+
35+
**Sweep for every site that NAMES a mechanism, once per repo**, and reconcile each against one
36+
derived ground truth. `git grep` does not cross a gitlink, and this page is projected twice, so a
37+
claim about it lives in three trees that cannot see each other. A string-keyed sweep cannot find the
38+
same claim restated in other words — which is what a correcting author writes in the neighbouring
39+
paragraph.
40+
41+
**The regeneration window.** The projection-first ordering guarantees a period where `plugins/main`
42+
carries prose `charly/main` cannot reproduce. Your own leg's window is harmless; **another leg's is
43+
not**, and the trigger is the base moving under you rather than the existence of a window: run the
44+
unscoped whole-tree check while no foreign projection sits in your base, and scope to the files you
45+
touch once one does.
46+
47+
## What the skill and the agent spec now say
48+
49+
**`git show --stat` after every commit, and chain the edit to the commit.** The post-commit rule in
50+
`git-workflow` ended *"not any tooling that fails loudly on its own — is what catches this"*, which
51+
is false: a script that edits and the `git add` / `git commit` after it are separate statements, so a
52+
guard that aborts the edit does not stop the commit, which lands under a message describing an edit
53+
it does not contain. Joining them — `edit && git add … && git commit …` — makes a failed edit unable
54+
to produce a commit at all.
55+
56+
**Two populations, and the entry states both rather than one number.** The defect occurred three
57+
times in one session — that is what establishes the problem. The chain was exercised **once**, and
58+
by construction that occurrence left no artifact, so the remedy's evidence is a single negative
59+
result. Reporting three under one "measured" would count the disease as evidence for the cure, which
60+
is the wrong-population shape this same entry documents above.
61+
62+
**And the chain is not sufficient.** `&&` short-circuits on a non-zero exit, so an edit that fails
63+
*loudly* cannot reach the commit — but a silent no-op edit (a pattern that matches nothing) exits 0
64+
and lands the commit under a describing message exactly as before. Neither of the two failures this
65+
PR actually had after the instrument existed would have been prevented by it. The chain closes the
66+
aborting case, which was the observed one; the no-op case still needs the post-commit read.
67+
68+
That is why both rules belong, and the surviving half is narrower than first written: **`git show
69+
--stat` is the only post-commit check *on the committing side* that sees a commit whose message
70+
describes an intent its diff does not carry** — the mismatch is between message and tree, and no gate
71+
reading the tree has the message. It is not the only check that can catch the class. A reader holding
72+
both, like this review, catches it by other means: two of this PR's own findings were that exact
73+
mismatch, and one spanned two repositories, where `--stat` structurally cannot look.
74+
75+
The agent spec carries the CalVer work: the **tag invariant** that survives a skipped Phase 3 — an
76+
entry on `main` with no matching `v<CalVer>` tag — **with its scope**, since 66 of 203 entries
77+
predate the tag-every-merge convention and a check without that clause returns 66 false positives;
78+
the converse caveat that 3 tags have no entry and would fire a symmetric check; and the placeholder
79+
argument, which now states that a wall-clock-impossible stamp is both self-announcing and
80+
regex-valid, and that it still binds nothing.
81+
82+
## Scope and gate
83+
84+
All **three** artifacts are byte-identical to what the source emits, and they take **two** shapes:
85+
`banner + content` for the reference page, `frontmatter + banner + content` for the agent spec and
86+
the skill — verifiable by SHA-256 against a YAML load of the candy, **with no generator run at all**.
87+
A gate written for one shape reports a false defect on the other, so the shape is part of the check
88+
rather than a detail of it. That gate holds at whatever head a reader checks it against,
89+
which a diffstat cannot, so no diffstat is published here.
90+
91+
**The commit is narrower than the regeneration, deliberately.** Regenerating at this base also
92+
deletes `ollama/skills/ollama-cli/SKILL.md` and reverts two sibling skills, whose superproject source
93+
is on no branch and in no open PR — the orphaned producer recorded as `opencharly/charly#291`. They
94+
are reverted and left alone.
95+
96+
Placeholder CalVer — the `pr-validator` finalizes it at merge and rewrites this H1 to match.
97+
**Verify that rewrite by reading the committed object** (`git show <ref>:<path>`), never the working
98+
tree: the working tree is the one layer that always holds your edit, and three H1s reached `main`
99+
through that gap before `#192` repaired them. The rules prescribing `head -1 <path>` for that check
100+
are filed as `opencharly/charly#294`.
101+
102+
The reader findings raised against this page that are **not** fixed here are registered as the batch
103+
`opencharly/charly#295`, scoped and cross-linked. It belongs in this list because it is the sibling
104+
about *this* artifact, and an enumeration naming every other one while omitting it reads as though
105+
none exists.

‎internals/agents/pr-validator.md‎

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -835,14 +835,44 @@ you skipped without deciding it inapplicable is an incomplete review (re-open it
835835
rather than a failed lookup). **The rules and the agent performing Phase 3 are the
836836
only things standing between a guessed date and `main`.**
837837
838-
The tempting remedy — a sentinel that announces itself, `CHANGELOG/UNSTAMPED-<slug>.md`
838+
One tempting remedy — a sentinel that announces itself, `CHANGELOG/UNSTAMPED-<slug>.md`
839839
with `# UNSTAMPED — …` — **fails rule one by construction** and would be rejected on
840840
the filename regex before anything else was read, and the org PR template
841-
independently instructs authors to use a placeholder `CHANGELOG/<CalVer>.md`. So the
842-
shape cannot be changed per-leg or by convention: these rules, the template, and the
843-
Phase-3 step would all have to move in ONE cutover, or every leg adopting the new
844-
shape fails against the old rules. The check below closes the hazard without moving
845-
any of that.
841+
independently instructs authors to use a placeholder `CHANGELOG/<CalVer>.md`.
842+
843+
**A second remedy does pass the regex, and is already in live use**: a stamp that is
844+
well-formed but impossible as a wall clock, `CHANGELOG/2026.229.9998.md`. It is
845+
self-announcing to a human and accepted by rule one, so *self-announcing* and
846+
*regex-valid* are not the exclusive alternatives this paragraph once implied. What it
847+
does NOT do is bind anything: nothing rejects it, and a leg that skips Phase 3 still
848+
merges a file whose name is a guess — merely a conspicuous one.
849+
850+
**And the check below does not cover that case either, because it lives inside
851+
Phase 3.** It compares the landed entry against the version you MINTED, which
852+
distinguishes a guessed date from a minted one — but only when Phase 3 runs at all.
853+
Nothing inside a phase can detect that phase being skipped.
854+
855+
**The invariant that survives a skipped Phase 3 is external to it: an entry on
856+
`main` with no matching `v<CalVer>` tag.** A skipped Phase 3 leaves both the
857+
placeholder name and the absent tag, so the pair is checkable by anyone, at any
858+
time, without knowing what was minted. **That is the check that catches the
859+
PLAUSIBLE placeholder** — the dangerous kind, where filename and H1 agree because
860+
both are the guess. A conspicuous stamp is caught by the reader's eye; a plausible
861+
one is caught by nothing else.
862+
863+
**Scope it, or it fires on a third of the history.** Tagging every landing is a
864+
RECENT convention, and the two regimes interleave — measured in `plugins`: of 203
865+
CalVer entries, **66 carry no tag**, all of them at or before `2026.215.1207`, while
866+
the earliest tagged entry is `2026.193.1934`, well inside that stretch. From
867+
`2026.215.1207` forward it is **67 for 67**. So the invariant reads: *every entry
868+
landed since the convention took hold has a matching tag*; earlier entries predate
869+
it and are evidence of nothing. A check written without that clause returns 66 false
870+
positives and gets disabled by whoever inherits it.
871+
872+
And do not write it bidirectionally without a second clause: **3 tags have no
873+
entry** (`v2026.195.0603`, `v2026.197.2231`, `v2026.215.1236`). That is not a
874+
defect — a tag marks a merge, and a content-removal landing needs no CHANGELOG — but
875+
a symmetric check fires on all three.
846876
847877
None of these is a formality: a rule you cannot POSITIVELY confirm from the diff +
848878
your own re-run is not "probably fine" — it is unverified, and unverified is FAIL

‎internals/skills/git-workflow/SKILL.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ evaluator's own spec.
3737
- **Tree-safety before destructive actions (R6).** Check `git status` + `git stash list` before any destructive working-tree action — `git stash` discards in-progress work; `rm` on a tracked file is destructive. When the sandbox blocks an action, find a non-destructive alternative rather than working around it. The stash/pop cycle can itself silently un-stage a `git rm`: a stash taken while a deletion is staged restores the deletion as unstaged on `pop`, so a `git status` right after the cycle that shows the deleted file back as a plain unstaged change (rather than the staged deletion you left) has quietly lost the staging — re-stage it (`git rm <path>` again, or `git add -u`) before committing. A stash/pop round-trip is never a no-op on a mixed add+rm working tree.
3838
- **Right worktree — pin one absolute path for the whole edit→commit→push sequence.** Before branching, staging, or committing, confirm the worktree you are driving is the same one your edits landed in: `git -C <path> rev-parse --show-toplevel` must equal the path you edited, and `git -C <path> status --short` must list those edits. Under symlinked or near-twin sibling worktrees — a parent dir that is itself a symlink (`~/projects` → `~/Sync/projects`), or look-alike names such as `…/charly` vs `…/<other-worktree>` — `cd`-ing to the wrong sibling makes `git switch -c` + `git commit` run against a clean tree and report "nothing to commit", silently landing nothing (or landing in the wrong repo). Never change the path spelling mid-sequence. An unexpected "nothing to commit" right after editing a file is the signature of this mistake — stop and re-verify `--show-toplevel` before retrying (blind retry is an R1 violation).
3939
- **The universal PR-gate — audit before any PR action, unconditionally.** Before opening, updating, or merging any pull request, run the aggregate audit: `gh pr list` across every touched repo + `git worktree list` + the live teammate/agent roster. This is a standing preflight, run first every time — never reached for only once something already looks off — because skipping it risks a duplicate PR for scope already covered in flight, a branch update from a stale worktree, or a merge over a still-running validator's verdict. Full operational detail: `/charly-internals:agents` "The universal PR-gate".
40-
- **Post-commit staging verification.** After every commit, re-run `git status --short` (expect it empty, or only unrelated untracked paths) and `git show --stat` (confirm every intended file is actually listed) — a multi-path `git add` naming several paths where one is mistyped or stale can commit only the files that did resolve while `git commit` still succeeds, producing a commit that would not even compile. Habitually re-checking `git show --stat` — not any tooling that fails loudly on its own — is what catches this.
40+
- **Post-commit staging verification.** After every commit, re-run `git status --short` (expect it empty, or only unrelated untracked paths) and `git show --stat` (confirm every intended file is actually listed) — a multi-path `git add` naming several paths where one is mistyped or stale can commit only the files that did resolve while `git commit` still succeeds, producing a commit that would not even compile. `git show --stat` catches that AFTER the fact, and it is the only post-commit check ON THE COMMITTING SIDE that sees a commit whose message describes an intent its diff does not carry — no gate that reads the tree can, because the mismatch is between the message and the tree, and the tree does not hold the message. It is NOT the only thing that can catch the class: any reader holding message and diff together — a review, a cross-repo reference sweep — catches it too, and catches the cases `--stat` cannot, such as a mismatch that spans two repositories.
41+
- **Chain the edit to the commit so the failure cannot reach one.** A script that edits and the `git add` / `git commit` that follow are SEPARATE statements: a guard that aborts the edit does not stop the commit, which then lands under a message describing an edit it does not contain. Joining them — `edit && git add … && git commit …` — makes a failed edit unable to produce a commit at all. The defect occurred three times in one session; the chain was exercised ONCE, and that occurrence left no artifact by construction — so three is the evidence for the PROBLEM and one is the evidence for the REMEDY. Do not report them under a single "measured". **The chain is necessary, not sufficient:** `&&` short-circuits on a non-zero exit, so an edit that fails LOUDLY cannot reach the commit, but a SILENT no-op edit — a pattern that matches nothing — exits 0 and lands the commit under a describing message exactly as before. That case still needs the post-commit read above; the chain closes only the aborting one. **A rule held in a head is exactly as effective as a rule not held, unless something in the command line enforces it.**
4142
- **`git add` is all-or-nothing: never name a path that no longer exists.** A single `git add` whose pathspec includes a vanished path fails the WHOLE add — `fatal: pathspec '<old>' did not match any files`, exit 128, nothing staged, including the paths that did resolve. Two shapes hit this, and both are silent because a PRIOR command already staged something, so the failed `add` leaves `git status` looking exactly as intended:
4243
- **a deletion**, where the removed file's path is still named in the `add` (the deletion was already staged) — lands a partial commit carrying only the deletion;
4344
- **a rename plus a content edit**, where `git mv old new` is followed by `git add old new` (the `mv` already staged the rename) — lands the rename with the content edit dropped.

0 commit comments

Comments
 (0)