Skip to content

fix(sync): restore honest sync evidence + ignore root local state - #253

Merged
github-actions[bot] merged 2 commits into
mainfrom
feat/umbrella-sync-evidence-and-state
Sep 25, 2026
Merged

github-actions[bot] merged 2 commits into
mainfrom
feat/umbrella-sync-evidence-and-state

Conversation

@atrawog

@atrawog atrawog commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two umbrella-owned defects, both surfaced while catching up with upstream and
both root-caused (R1) rather than worked around.

1. The sync PR body's per-pin evidence was structurally dead

The Taskfile→task cutover (#247) deleted scripts/sync-gitlinks.sh, whose log
carried the per-pin <path> -> <sha> lines that scripts/sync-pr-body.sh
grepped. The replacement composer verb:git-submodules bump returns only a
one-line summary (bumped N submodule pin(s): …), and charly task's text
reporter drops a passing step's own Result.Message — so the log carries no
per-pin line at all. The body builder's grep -F " ${p} -> " therefore matched
nothing and emitted MISSING from producer log — investigate for every moved
pin.

Measured with the real post-cutover producer shape:

$ printf 'dotgithub\ncharly\n' > /tmp/moved.txt
$ cat /tmp/producer.log
task sync: 1 step(s), 0 failed
  [pass] run — bump the pins (charly rolls first, then distro-* from its new gitlinks)
$ SYNC_EVIDENCE_OUT=/tmp/ev.txt bash scripts/sync-pr-body.sh "$PWD" \
    /tmp/moved.txt /tmp/producer.log /tmp/pblog.txt /tmp/body.md /tmp/ev.txt
$ sed -n '/What produced this diff/,/^```$/p' /tmp/body.md
  dotgithub -> (MISSING from producer log — investigate)
  charly -> (MISSING from producer log — investigate)

The --self-test could not catch this: it fed only the retired -> form, so it
passed against an input reality no longer produces (a test that cannot fail).

Root fix: stop coupling the body builder to any incidental producer-log
format. The authoritative per-pin proof is already the index-derived
staged-gitlink vs remote default-branch HEAD table
(scripts/sync-pin-evidence.sh); the producer log is now pasted verbatim as
context, bounded inside the function. The bound is applied with sed -n rather
than a caller-side head, because this harness ignores SIGPIPE (AGENTS.md
"Command hygiene") and a head reader would let the producer flood the log with
broken-pipe write errors.

The self-test now exercises both historical producer shapes and asserts the
excerpt is verbatim (no injected MISSING).

$ bash scripts/sync-pr-body.sh --self-test
sync-pr-body: self-test OK (393-pin body under the 65536 cap with the true total + hint;
artifact carries all rows; small input no hint; the producer excerpt is verbatim for BOTH
the retired per-pin and current summary shapes; over-cap trips the hard guard)

Claim-keyed sweep — executed (B14(d))

The stale claim ("the body pastes the producer's own per-pin resolution from
/tmp/sync-pins.log") lived on exactly two root surfaces. The search is
claim-keyed over the umbrella root (submodule paths are separate repos, rule 1):

$ git grep -nE "producer.s own resolution|What produced this diff" origin/main -- ":!CHANGELOG" ":!plan"
origin/main:.github/workflows/sync.yml:98:      # So the body pastes what IS real evidence in CI: the producer's own resolution, repo
origin/main:scripts/sync-pr-body.sh:83:    echo "**What produced this diff**, pasted from the run that opened this PR — the producer's"

$ git grep -nE "producer.s own resolution|What produced this diff" HEAD -- ":!CHANGELOG" ":!plan"
(empty — both surfaces swept)

Both hits are in this diff's touched files, and the post-change sweep is empty —
the two surfaces are the complete set, not merely the two the author chose.

2. The root .gitignore omitted the local-state classes the umbrella produces

charly check run check-all-beds (this repo's root roster) writes .check/ into
the umbrella root, but the root .gitignore ignored none of the local-state
classes charly does, so git status read permanently dirty after a roster run.
Added .check/, .build/, .opencharly/, scratchpad/, .claude/worktrees/,
bin/, *.sync-conflict-*, modelled on charly/.gitignore.

$ git check-ignore -v .check
.gitignore:46:.check/	.check

The added comment is deliberately precise about the gate boundary: it states
charly task verify does not check the root tree (it asserts each
submodule's cleanliness), so this is about an honest root git status, not a
gate — no false claim.

How tested

Every gate below ran from the committed tree (b30e448).

The umbrella pre-commit gate (the real gate — policy B + harness parity + the
three script self-tests + the opencode plugin contract):

$ bash hooks/pre-commit
pre-commit: OK
$ node scripts/check-opencode-plugin.mjs
check-opencode-plugin: OK

The task surface:

$ ./charly/bin/charly task self-test
task self-test: 1 step(s), 0 failed
  [pass] run — self-test sync-pin-evidence + sync-pr-body + sync-dispatcher
$ ./charly/bin/charly task harness
task harness: 1 step(s), 0 failed
  [pass] check — the byte-identical-by-design harness files match their charly/ twins
$ ./charly/bin/charly task policy-b
task policy-b: 1 step(s), 0 failed
  [pass] check — policy B holds

The body builder against the real producer shape (before/after):

Before this change the excerpt produced two MISSING lines (pasted in the
Summary). After:

$ SYNC_EVIDENCE_OUT=/tmp/ev.txt bash scripts/sync-pr-body.sh "$PWD" \
    /tmp/moved.txt /tmp/producer.log /tmp/pblog.txt /tmp/body.md /tmp/ev.txt
$ sed -n '/The producer that opened/,/^```$/p' /tmp/body.md
**The producer that opened this PR**, pasted verbatim from the sync run
(bounded; the full log is the `sync-evidence` artifact). The AUTHORITATIVE
per-pin proof is the `staged-gitlink` vs remote default-branch `HEAD` table below.

task sync: 1 step(s), 0 failed
[pass] run — bump the pins (charly rolls first, then distro-* from its new gitlinks)

Bounded excerpt (SIGPIPE-safe, no caller head):

$ PRODUCER_MAX=10 ... # a 500-line producer log
$ grep -c '^line ' /tmp/b1.md
10

YAML validity of the touched workflow:

$ yq eval '.' .github/workflows/sync.yml > /dev/null && echo "YAML OK (yq)"
YAML OK (yq)

charly task verify — the two assertions this diff can affect pass; the
per-submodule-cleanliness assertion is blocked by another session's dirt, which
cannot affect this diff:

$ ./charly/bin/charly task verify --json | python3 -c '…'
pass | policy B — every distro-* gitlink equals charly's own box/* gitlink
fail | every submodule is clean ... | exit=1, want 0 (stderr: FAIL: sdk: dirty working tree)
pass | the opencode gate plugin contract

Proof the failure is foreign and cannot touch this diff:

$ git diff --name-only origin/main...HEAD
.github/workflows/sync.yml
.gitignore
scripts/sync-pr-body.sh
$ git -C sdk status --short
 M deploykit/deploy_config_cycle.go
 M deploykit/deploy_file.go
 M deploykit/deploy_state.go
 M deploykit/vm_deploy_state.go
 M go.mod
 M loaderkit/deploy_config_executor.go
 M loaderkit/refs_seams_executor.go

The diff touches zero submodules; the failing assertion enumerates
submodule.<name>.path entries and tests each one's own worktree
(git -C "$path" status --porcelain), so the dirty sdk worktree is another
concurrent session's in-progress work (rule 9: never touched). This is the
honest tier cap noted in Change classification.

Rulebook compliance

  • R0 skills: loaded /charly-internals:git-workflow,
    /charly-internals:strict-policy, /charly-internals:root-cause-analyzer,
    /charly-check:check before acting.
  • R1 RCA: both findings root-caused with measured evidence, not patched. The
    producer-evidence defect's missed control (a self-test feeding only the retired
    shape) is fixed in the same change.
  • R2 finish the cutover: the stale sync.yml comments carrying the same false
    claim are swept in this change; the claim-keyed sweep is pasted above. The one
    surfaced product defect is routed to its named PR (below), not parked.
  • R3 no duplication: the excerpt is ONE function both the live path and the
    self-test call; the authoritative per-pin table stays single-sourced in
    sync-pin-evidence.sh.
  • R4 no workaround: no parse of an incidental producer format remains; the
    excerpt is bounded without a SIGPIPE-flooding head.
  • R5 hard cutover + claim sweep: the false per-pin-producer claim is removed
    from both surfaces that carried it (sweep pasted above).
  • R6 git safety: feat/ branch, no force-push, no direct push to main.
  • R7 prove the gate: the umbrella pre-commit gate and every task self-test ran
    on the committed tree (pasted above).
  • R9 binary == source: all runs used ./charly/bin/charly built from the
    pinned charly/ submodule.
  • Rule 9 (session ownership): the three dirty submodules (plugin-check,
    sdk, spec) belong to other sessions and are left exactly as found.

Change classification

  • Change class: umbrella tooling/docs config (CI workflow comment + script +
    .gitignore). No submodule gitlink, no Go, no generated artifact.
  • Verification gate: bash hooks/pre-commit +
    node scripts/check-opencode-plugin.mjs + charly task self-test|harness|policy-b
    • the body builder's live-shape run + yq YAML validation.
  • Attribution tier: analysed on a live system — every changed path
    (scripts/sync-pr-body.sh, the pre-commit gate's self-tests, .gitignore) was
    executed live with retained output on the final tree, but the complete
    charly task verify gate did not pass (its per-submodule-cleanliness
    assertion is blocked by another concurrent session's dirty sdk worktree, which
    this root-only diff cannot affect). Per the tier table, a complete R10 gate that
    did not pass caps the tier here — the top tier is not claimed.

Surfaced product defect — routed to its named owning PR

The investigation also proved a product defect in opencharly/plugin-task: its
command:task text reporter prints only each step's authored Text, never
Result.Message, so a passing run: step's output is discarded and a failing
step's diagnostic is invisible. That is why charly task map prints no map and a
real sync failure printed no reason (the swallowed index.lock cause this
session hit).

This defect is fixed by PR opencharly/plugin-task#5
(fix(cli): render a step's Result.Message in text mode), already open with its
own R10 (proved RED on the pre-fix reporter, green with the fix). It is not a
submodule of this umbrella (rule 1 forbids editing it here), and this umbrella
change has an explicit exit that does not depend on it: the body's per-pin proof
is the index-derived table, and the producer log is pasted regardless of content.
This is a routed, named cutover — not a deferred follow-up.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (analysed on a live system)

The Taskfile→task cutover (#247) deleted scripts/sync-gitlinks.sh, whose log
carried the per-pin `  <path> -> <sha>` lines the sync PR body (scripts/
sync-pr-body.sh) grepped. verb:git-submodules only returns a one-line summary
AND `charly task`'s text reporter drops a passing step's own message, so the
grep matched nothing and every moved pin read "MISSING from producer log —
investigate" in the body (measured with the real post-cutover producer shape).

Root fix: stop coupling the body builder to any incidental producer-log format.
The authoritative per-pin proof is already the index-derived `staged-gitlink`
vs remote default-branch HEAD table (scripts/sync-pin-evidence.sh); the producer
log is now pasted verbatim as context, bounded inside the function (never via a
caller `head`, which this SIGPIPE-ignoring harness would let flood). The
self-test now exercises BOTH historical producer shapes — it previously fed only
the retired `->` form, so it could not fail on the shape reality produces.

Also ignore the root local-state classes (`charly check run check-all-beds`
writes `.check/`; `.build/`, `.opencharly/`, `scratchpad/`,
`.claude/worktrees/`, `bin/`), so the root `git status` is honest after a roster
run. Modelled on charly/.gitignore; the parity gate checks only the 5 shared
files, not .gitignore.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
@github-actions

Copy link
Copy Markdown
Contributor

Review — BLOCK

Head SHA: b30e4485c0570e46f398209b5e36f3878eec78e2 (branch: feat/umbrella-sync-evidence-and-state)

Change class: umbrella tooling/config — CI workflow comments (.github/workflows/sync.yml), the PR-body builder (scripts/sync-pr-body.sh), and the root .gitignore. No charly runtime, no generated artifact.

Security screen: clean (comments-only workflow edit; the script change removes a fragile coupling and adds no privilege/secret/egress; no supply-chain change).

Blocks

  1. R5 / B14(d) — the "claim sweep" is asserted, not evidenced. The body states the stale producer-resolution claim "lived on two surfaces" and that "the false 'MISSING'/per-pin-producer claims are removed from every surface that carried them," but no actually-executed search command and its output are pasted anywhere in the body. B14(d) requires real command output for a sweep claim; "exactly these two surfaces" is unproven without it. Paste the search (e.g. grep -rn 'sync-pins.log\|per-pin producer resolution' .) and its hits, proving the two sync.yml comments are the complete set (the diff alone only proves the two the author chose to touch).

  2. R2 / B6 / B14(b) — a surfaced defect is parked as a "Known follow-up" with no named batch/task exit. The plugin-task reporter defect (command:task text reporter drops a passing step's Result.Message) was surfaced by this investigation. The body routes it only to "its owning repo" and explicitly states this PR does not advance it. B6 requires the issue be fixed in-tree or routed to its NAMED thematic batch/task cutover; naming only the repository (no issue/PR/task identifier, and no exit this PR advances) is the vague-follow-up framing B14(b) rejects — and it directly contradicts the body's own "nothing deferred" R2 claim. Name the exact owning task/cutover.

  3. R10 / B5 — a failing gate coexists with the fully tested and validated claim. The body reports that charly task verify does not complete — its per-submodule-cleanliness assertion fails on sdk: dirty working tree — and still asserts the top tier. R10 succeeds only at zero failures; the "another concurrent session" attribution is an unrelated/environmental framing that must be proven, not asserted. Either complete the gate on a tree not encumbered by that state (or show the dirty submodule cannot affect this diff), or reduce the tier to analysed on a live system.

Verdict: BLOCK


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
@github-actions

Copy link
Copy Markdown
Contributor

Review — PASS

Head SHA: a504f069b8e9bd16ac210181a21f3029f29aa58c (branch: feat/umbrella-sync-evidence-and-state)

Security screen: PASS — comments-only workflow edit; the script change removes a fragile producer-log coupling and adds stricter self-test arms (no privilege/secret/egress/supply-chain change, no guardrail weakening); .gitignore only adds local-state ignores. No T1–T4 finding (no embedded directive, no scope mismatch, no weakened gate).

Checklist: All applicable rules PASS or NA. (R10 bed/ADE/SDD/architecture checks NA — umbrella-root tooling, no submodule gitlink, no Go/CUE/generated artifact, no candy, no bed. The new producer_log_excerpt is one shared function; the self-test now fails on the pre-fix builder for both producer shapes, so the new behavior is covered.)

Comment 5833481623 (github-actions[bot], head b30e448): stale-superseded — re-derived against the current head/body, all three blocks are resolved: (1) the claim-keyed sweep is now pasted with executed git grep output whose two hits correspond to the two swept surfaces; (2) the plugin-task reporter defect is routed to its named PR opencharly/plugin-task#5 (a specific, non-vague cutover outside this umbrella, rule 1); (3) the tier is capped to analysed on a live system. The residual charly task verify per-submodule-cleanliness failure is foreign and proven so (git diff --name-only = 3 root files, zero submodules; the assertion tests each submodule's own worktree; git -C sdk status shows the foreign dirt) — verified-non-blocking, honestly disclosed, and not a code-caused gate failure (the change-class gate, pre-commit + task self-tests, is green at zero warnings).

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) September 25, 2026 13:55
@github-actions
github-actions Bot merged commit 3fcbd86 into main Sep 25, 2026
1 check passed
charly-auto-merge Bot added a commit that referenced this pull request Sep 25, 2026
@aitrawog
aitrawog deleted the feat/umbrella-sync-evidence-and-state branch September 25, 2026 18:28
github-actions Bot pushed a commit that referenced this pull request Sep 26, 2026
…t files (#261)

The umbrella root produces the same generated-state classes charly's own
.gitignore already lists, but three were missing, so a root `git status`
read dirty after ordinary work:

- `image/`               — `charly vm build` disk/seed artifacts (the
                           configurable vm.image_dir root, default `image`).
- `.containerignore` / `.dockerignore` — `charly box generate` build-context
                           ignore files (defaults.context_ignore).

This is the same class as the `.check/`/`.build/`/`.opencharly/` entries added
by #253 ("ignore root local state"); these three were simply not in that sweep.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

Co-authored-by: atrawog <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant