Skip to content

Retire the refresh lane's raw-clone --phase build recipe (nightly-refresh re-realization S4) - #641

Merged
brettheap merged 4 commits into
mainfrom
feat/nightly-refresh-s4-retire-phase-build
Sep 4, 2026
Merged

brettheap merged 4 commits into
mainfrom
feat/nightly-refresh-s4-retire-phase-build

Conversation

@brettheap

@brettheap brettheap commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openxfactory-f2

Brett's word (2026-09-04): "go S2 to S7."

Plan section: plan-nightly-refresh-rerealization-2026-09-04.md § "S4 — oxF: retire the module's own raw-clone recipe" (lines 132-140), part of the add-nightly-dashboard-refresh re-realization scope after the 2026-09-04 re-ratification (openxFactory PR #595, rescue/nightly-refresh-edits-2026-09-02).

What this PR removes, and why it is dead code

scripts/ideation_dashboard/dashboard_refresh_lane.py carried a SECOND, independent realization of the pre-amendment build recipe, reached only through --phase build:

  • build_and_push() — raw git clone --filter=blob:none of the corpus onto the worker, sparse-checkout, --strict generation from that checkout, docker build, az acr login, docker push.
  • BuildPlan (corpus_url, corpus_ref, corpus_paths, registry, image, tag, repository, snapshot_relpath, acr_login) and the constants that fed it only (DEFAULT_REGISTRY, DEFAULT_SNAPSHOT_RELPATH, DEFAULT_REPOSITORY).
  • default_tag(), _digest_from_push(), _digest_from_inspect().
  • The build choice and its six build-only CLI flags (--corpus-url, --dockerfile, --context-root, --registry, --tag, --acr-login).
  • The now-unused shlex import.

Nothing reaches it. .github/workflows/doc-health-reusable.yml invokes this module five times, and never with --phase build:

:2712  --phase report --report-in "$REPORT"
:3051  --phase decide
:3069  --phase decide
:3246  --phase pin
:3341  --phase record-pr --pull-request "$PR_URL"

The live nightly lane does the fetch/build/push recipe entirely in bash inside the worker child's own workflow (xFactory's dashboard-image-worker.yml — see plan-nightly-refresh-rerealization-2026-09-04.md §1, "Today (xF dashboard-image-worker.yml, the exact live shape)", lines 25-32: two git clone --filter=blob:none, then generate/build/push on the runner). This module's build_and_push was never that recipe's caller — it was a parallel, unreached copy of it.

That copy is not just unused, it is now-forbidden: the re-ratified amendment to add-nightly-dashboard-refresh (specs/doc-health/spec.md:144-151) prohibits the worker from holding a Git repository credential, a deploy key, a credential helper, or performing a raw Git clone at all. A module-side path that clones contradicts that requirement whether or not a caller exists today, and a second realization of one recipe is exactly how the Omnigent-Install worker profile's prose and the ratified requirement drifted apart in the first place (plan §1, "The contradiction is live, not theoretical"). The plan's explicit recommendation (open question 5) is delete, not port — a ported-but-unused copy would just be a third place the recipe lives.

Kept, unchanged: --phase pin's synthesized BuildResult path, byte-for-byte; verify_one_revision/OneRevisionViolation (the predicate's caller moved to the child, but the property is the contract's — see the module's ONE REVISION paragraph); git_head_revision, a plain rev-parse read over a checkout the caller already has, which the parent's future sealing step (S2) will need; run_refresh_lane's injected-build seam, retyped from BuildPlan | None to object | None since this module no longer constructs or interprets a plan.

Argparse behaviour

--phase no longer accepts build; the choice set is now ("decide", "pin", "report", "record-pr"). A caller that still spells --phase build gets an argparse usage error and a non-zero exit (SystemExit(2)) naming the phases that remain, not a silent no-op. main()'s docstring is corrected in this PR to say so precisely (bot round 2, below).

Tests changed and why

Removed, with their fixtures: test_the_build_asserts_one_revision_before_it_builds, test_the_build_publishes_when_the_two_revisions_are_one, test_strict_failure_publishes_nothing (all drove build_and_push directly), plus the FakeBuildWorld class and _plan() helper that only existed to feed them.

Added in their place:

  • test_the_module_holds_no_build_recipe_and_no_clone — asserts build_and_push/BuildPlan no longer exist, and (via an ast-based scan of the module's source, excluding docstrings) that no code string literal names clone, sparse-checkout, docker, az, or --filter=blob:none. Asserted on the SOURCE rather than on behaviour, because the property held is the ABSENCE of a code path — a behavioural test cannot distinguish "never called" from "cannot be called."
  • test_the_cli_refuses_a_build_phase — asserts lane.main([..., "--phase", "build"]) raises SystemExit, and that the injected-build seam (build parameter on run_refresh_lane) survives.

Bot round 1 (Copilot) — TAKEN in 1f6c5767

Docstring said "THIS MODULE HOLDS THE PREDICATE AND NOTHING ELSE," which reads as false against the module's own decision core, pin rendering and report section. Reworded (module top docstring, ONE REVISION paragraph) to scope the claim to the retired recipe: of that recipe, the module now holds only the predicate (verify_one_revision) — never the generation, the build, or the assertion's call site.

Bot round 2 (Copilot) — two threads, both TAKEN in this head

  1. Contract-text precision. main()'s docstring said failures "fall through" and the process "exits 0" without qualification, but the CLI now relies on an argparse usage error (non-zero exit) for an unknown/removed phase. The module-level FAILURE SEMANTICS paragraph (line 71-73: "every error path is a recorded outcome and exit 0") was always scoped to the lane's own runtime logic, not to CLI parsing — so the fix is to make main()'s docstring say that precisely, not to change behaviour: exit-0 covers every valid phase's own failure path; an unrecognized phase (including the retired build) is a usage error argparse itself refuses, before any lane logic runs, and that exit code is deliberately outside the void-by-contract promise.
  2. PR description drift. This PR's description had been pasted from slice S5 (the Omnigent-Install profile-prose PR) by mistake and claimed "prose truth only… workers/profile," which does not describe this diff at all. This body replaces it with an accurate account of what S4 actually does: it removes the raw-clone --phase build recipe and its helpers (above), which is a behavioural/API change to this module's CLI surface, justified by the dead-code + now-forbidden argument above.

openspec/changes/add-nightly-dashboard-refresh/tasks.md:126-128 still describes the child as running dashboard-refresh-nightly.py --phase build — that line is stale as of this PR. Per this PR's lane instructions, openspec/changes/add-nightly-dashboard-refresh/ is not touched here; S6 owes the packet ticks, including correcting that task note against this PR's number, per the plan's ordering (S6 lands last, after S1-S5 have PR numbers).

Validation

  • python3 -W error -m py_compile scripts/ideation_dashboard/dashboard_refresh_lane.py — clean.
  • python3 -m pytest -q tests/ideation-dashboard — full suite pass.
  • No contract, spec, schema or substrate row touched (plan §3: S4 moves no substrate row).

🤖 Generated with Claude Code

https://claude.ai/code/session_01TqM41pKPnpz7utYe8vanuE

…efresh re-realization S4)

`dashboard_refresh_lane.py` carried a SECOND, independent realization of the
pre-amendment build recipe: `build_and_push()`, reached only by `--phase build`
and configured by `BuildPlan.corpus_url/corpus_ref/corpus_paths`. Its first
step was a raw `git clone --filter=blob:none` of the corpus onto the worker,
followed by sparse-checkout, `--strict` generation, `docker build`,
`az acr login` and `docker push`.

Nothing reaches it. `doc-health-reusable.yml` invokes this module four times —
`--phase decide` twice, `--phase pin`, `--phase record-pr` — and passes none of
the six build-only flags; the aggregation's `dashboard-image-worker.yml` does
the whole recipe in bash inside the child. But the re-ratified amendment to
`add-nightly-dashboard-refresh` prohibits the worker from holding a Git
credential at all, so a module-side path that clones contradicts a ratified
requirement whether or not a caller exists today — and two realizations of one
recipe are how the pair drifted apart in the first place. The plan's
recommendation is delete, not port: a ported copy would be a third place the
recipe lives.

Deleted: `build_and_push`, `BuildPlan`, `default_tag`, `_digest_from_push`,
`_digest_from_inspect`; the `build` phase and the six flags that fed it
(`--corpus-url`, `--dockerfile`, `--context-root`, `--registry`, `--tag`,
`--acr-login`); the three `BuildPlan`-only constants and the now-unused
`shlex` import.

Kept: `--phase pin`'s synthesized `BuildResult` path byte-for-byte;
`verify_one_revision`/`OneRevisionViolation`, whose caller moved to the child
but whose property is the contract's; `git_head_revision`, a `rev-parse` read
over a checkout the caller already has, which the parent's sealing step will
need; and `run_refresh_lane`'s injected-build seam, retyped to an opaque
handle. `--corpus-ref` stays — `--phase decide` reads with it.

Tests: the three that drove `build_and_push` directly are removed with their
`FakeBuildWorld`/`_plan` fixtures, and two take their place — an `ast`-based
assertion that no code string literal in the module names `clone`,
`sparse-checkout`, `docker` or `az`, and one that the CLI now refuses
`--phase build` loudly instead of skipping silently.

No packet file, no spec, no contract and no substrate row is touched; slice S6
records the acts and corrects task 3.4's note, which still describes the child
as running `dashboard-refresh-nightly.py --phase build`.

Lane: openxfactory-f2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_013f11Yb8DF5FTL6NuV7xWYb
Copilot AI lite review requested due to automatic review settings September 4, 2026 04:20

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @brettheap! 👋

Your private repo does not have access to Sourcery.

Please upgrade to continue using Sourcery ✨

@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The build/clone implementation and its public entrypoint appear fully removed with tests updated to enforce the new contract, with only a minor docstring wording fix suggested.

Pull request overview

This PR removes the module-side “worker build recipe” implementation for the ideation-dashboard refresh lane (including the --phase build CLI surface) so the lane code matches the re-ratified requirement that workers must not perform raw Git clones or hold repository credentials; corresponding tests are updated to assert the absence of that build path.

Changes:

  • Removed the in-module build plan/recipe (BuildPlan, build_and_push, and the --phase build CLI) from dashboard_refresh_lane.py, keeping only the one-revision predicate/result shape and the injected-build seam.
  • Updated the test suite to validate “no build recipe/no clone” structurally (attribute absence + AST string-literal scan excluding docstrings) and to assert --phase build is rejected by argparse.
File summaries
File Description
tests/ideation-dashboard/test_dashboard_refresh_lane.py Replaces build-recipe behavior tests with structural assertions that the module exposes no build/clone path and refuses --phase build.
scripts/ideation_dashboard/dashboard_refresh_lane.py Deletes the module’s build/clone/push implementation and CLI phase, leaving build as an injected responsibility owned by the worker child workflow.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-f2

Validation (foreground, isolated clone at feat/nightly-refresh-s4-retire-phase-build)

python3 -m pytest -q tests/ideation-dashboard tests/doc-health
  → 1 failed, 6192 passed, 31 skipped in 933.92s
python3 -m py_compile scripts/ideation_dashboard/dashboard_refresh_lane.py \
                      tests/ideation-dashboard/test_dashboard_refresh_lane.py
  → OK
OPENSPEC_TELEMETRY=0 openspec validate --all --strict
  → 88 passed, 0 failed (88 items)
python3 scripts/doc-health.py --single-repo .   (base vs head)
  → 6 critical, 4 error, 29 warning, 17 info on BOTH; "New regressions vs
    previous report: 0"; --new-findings-out → 0 new findings. Delta EMPTY.
tests/ideation-dashboard/test_dashboard_refresh_lane.py alone → 39 passed

The one failure is an artifact of the review clone's DIRECTORY NAME, not of this change

tests/ideation-dashboard/test_snapshot.py::test_find_validator_locates_pinned_checkout.
snapshot.find_validator (snapshot.py:61-70) walks UP from the repo root looking
for openxFactory/scripts/validate-ideation-dashboard-contracts.py
(VALIDATOR_RELPATH, :29). My isolated clone is checked out at
…/scratchpad/s4-oxf, so no ancestor directory is named openxFactory and the
walk finds nothing. Proven by construction: symlinking the same tree as
…/scratchpad/openxFactory and re-running that file gives 17 passed — same
commit, same working tree, only the path name differs.

It touches nothing this PR changes (snapshot.py is untouched; the deleted
build_and_push was the only caller of the walk inside the refresh lane, and
find_validator is reached here from the SNAPSHOT lane's own tests). CI runs in
a checkout named openxFactory, so pytest-suite is the authority — see its
result on this PR.

Bot round 1, Copilot (TAKEN): "THIS MODULE HOLDS THE PREDICATE AND NOTHING
ELSE" reads as literally false — the module still holds the decision core, the
pin rendering and the report section. The sentence was scoped to the recipe the
paragraph describes, but nothing said so. It now does: of that recipe the module
holds only `verify_one_revision`, never the generation, the build, or the
assertion's call site.

Lane: openxfactory-f2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_013f11Yb8DF5FTL6NuV7xWYb
Copilot AI review requested due to automatic review settings September 4, 2026 04:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The PR description/scope and a nearby contract-style docstring need to be aligned with the now-actual behavioral change of retiring --phase build.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

…age errors

Bot round 2, Copilot: main()'s docstring said every path "falls through" and
the process "exits 0" without qualifying that against the CLI's own usage-
error path. The module's FAILURE SEMANTICS paragraph ("every error path is a
recorded outcome and exit 0") was always scoped to the lane's own runtime
logic for decide/pin/report/record-pr, never to CLI parsing, so this makes
main()'s docstring say that precisely instead of changing behaviour: exit-0
covers every valid phase's own failure path; an unrecognized phase --
including the retired `build` -- is a usage error argparse itself refuses
with SystemExit(2) before any lane logic runs, and that exit code is
deliberately outside the void-by-contract promise. test_the_cli_refuses_a_
build_phase already pins the SystemExit behaviour this describes.

Lane: openxfactory-f2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TqM41pKPnpz7utYe8vanuE
Copilot AI review requested due to automatic review settings September 4, 2026 05:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The new AST-based “no build recipe” test can produce false negatives (missing embedded command tokens in shell-style string literals), weakening the safety guarantee it’s intended to enforce.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

tests/ideation-dashboard/test_dashboard_refresh_lane.py:501

  • The AST-based “no build recipe” test can miss forbidden command usage when the module uses a single shell-style string literal (e.g. "git clone --filter=blob:none ..."): the current helper returns whole string literals only, so the later command_token not in literals check only catches exact-literal tokens (like a list element "clone"), not tokens embedded inside larger literals. Also, docstrings are excluded by value, which can accidentally drop a non-docstring literal if it happens to equal a docstring elsewhere in the module.

Consider returning a token set derived from non-docstring string literals (split on whitespace) and excluding docstrings by AST position (first Expr string in each body), so both argv-list and shell-string forms are detected reliably.

  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

brettheap pushed a commit that referenced this pull request Sep 4, 2026
#641's `b23e3381` scoped `main`'s exit-0 contract to the VALID phases and
enumerated them; this slice adds a fifth. The enumeration is the point of that
docstring — a phase missing from it reads as one argparse refuses — so it
carries `seal`, and says explicitly that a refused seal is one of the SKIPPED
outcomes the contract covers.

Lane: openxfactory-f2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TqM41pKPnpz7utYe8vanuE
…s a whole literal

Bot round 3, Copilot: _code_string_literals() returned whole string literals
only, so the no-build-recipe test's `command_token not in literals` check
could match an argv-list element ("clone") but would miss the same token
embedded in one shell-style string ("git clone --filter=blob:none ..."), and
excluding docstrings by VALUE equality risked dropping an unrelated
non-docstring literal that happened to match some docstring's text elsewhere
in the module.

The helper now returns each non-docstring literal's whitespace-split tokens
in addition to the whole literal, and excludes docstrings by AST POSITION
(the first statement of a module/class/function body, when it is a bare
string expression) instead of by value.

python3 -m pytest tests/ideation-dashboard/test_dashboard_refresh_lane.py --
39 passed.

Lane: openxfactory-f2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TqM41pKPnpz7utYe8vanuE
Copilot AI review requested due to automatic review settings September 4, 2026 06:27
@brettheap

brettheap commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-f2

Bot round 3 (Copilot, summary review at b23e3381, "Needs a closer look" — tests/ideation-dashboard/test_dashboard_refresh_lane.py:501, no inline thread opened): TAKEN — fixed in 5c2545b4.

You're right: _code_string_literals() returned whole string literals only, so command_token not in literals could only ever match an EXACT literal (an argv-list element like "clone"), not a forbidden op embedded in one shell-style string (e.g. "git clone --filter=blob:none ..."). And excluding docstrings by VALUE equality meant an unrelated non-docstring literal could be dropped by accident if it happened to equal some docstring's text elsewhere in the module.

Fixed both: the helper now returns each non-docstring literal's whitespace-split TOKENS in addition to the whole literal, so both the argv-list shape and the single-shell-string shape are caught; and it excludes docstrings by AST POSITION (the first statement of a module/class/function body, when it's a bare string expression) rather than by value.

python3 -m pytest tests/ideation-dashboard/test_dashboard_refresh_lane.py — 39 passed in under a second. The full tests/ideation-dashboard suite timed out locally twice under heavy concurrent load on this shared machine (two other unrelated test runs contending for CPU) — both partial runs reached 89-90% with zero failures before the local 600s cap, so CI's pytest-suite check on this head is the authoritative full-suite result.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The removed build phase appears to be unused in-repo (remaining references are test/docs), and the PR updates tests and CLI behavior to fail loudly on the retired phase.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-f2

Provenance for the admin merge. RULING for lane openxfactory-f2's PR #641 (head 5c2545b4): Brett Heap, 2026-09-04 ~12:3xZ, in-session, verbatim: "merge 641" — following "go S2 to S7" and "lets go". This is slice S4 of the nightly-refresh re-realization plan: the refresh-lane module's dead raw-clone --phase build recipe and its helpers are removed, as the re-ratified add-nightly-dashboard-refresh delta forbids Git clones on the worker; the build is the worker's, fed by the parent-sealed artifact (S2, #648). Merge basis: ALL checks SUCCESS on 5c2545b4 — pytest-suite, wallet-validation, signed-execution-chain-gate, merge-master-approval, openreposhape-pin, clearing-dispatch-gate, lane-line; four Copilot rounds, every finding TAKEN and resolved, final pass "Approval recommended" with zero comments; Codex rate-limited (provider non-review). No substrate register row moved; S6 owes the packet's tasks.md:126-128 note. --admin satisfies only the review-count rule. Squash merge at 2026-09-04T12:38Z. Session: https://claude.ai/code/session_01TqM41pKPnpz7utYe8vanuE

@brettheap
brettheap merged commit 19a777d into main Sep 4, 2026
8 checks passed
brettheap pushed a commit that referenced this pull request Sep 4, 2026
Pulls in #641 (nightly-refresh re-realization S4, retire the raw-clone
`--phase build` recipe) now landed on main at 19a777d, plus everything
merged since. Two conflicts in scripts/ideation_dashboard/dashboard_refresh_lane.py
and tests/ideation-dashboard/test_dashboard_refresh_lane.py, both from S2
having branched off #641's own PR branch before its final polish:

- scripts/ideation_dashboard/dashboard_refresh_lane.py (6 hunks): S2's
  branch tip already carries a seal-aware rewrite of the same docstring/CLI
  text #641 touched (the "AND IT DOES NOT BUILD" paragraph, the `--phase`
  choices and help text, the module docstring) — resolved by keeping S2's
  wording throughout, since it is a strict superset that already states
  #641's fact (no repository is cloned, no container build, no CLI phase for
  it) while also being consistent with the new seal paragraph in the same
  docstring (main's "the fresh materialization ... belongs to the worker
  child" would now be false: the parent does the sealing).
- tests/ideation-dashboard/test_dashboard_refresh_lane.py (1 hunk): kept
  origin/main's hardened `_code_string_literals` helper (whitespace-split
  token matching, AST-position-based docstring exclusion) over S2's inherited
  earlier draft of the same helper — a pure #641 hardening unrelated to the
  seal phase.

Verified the resolved dashboard_refresh_lane.py is byte-identical to the S2
branch tip (6358645), and the resolved test file is byte-identical to
origin/main's version, confirming no unintended content loss.

Lane: openxfactory-f2

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TqM41pKPnpz7utYe8vanuE
brettheap added a commit that referenced this pull request Sep 4, 2026
…ct (nightly-refresh re-realization S2; lands after #641) (#648)

* Retire the refresh lane's raw-clone `--phase build` recipe (nightly-refresh re-realization S4)

`dashboard_refresh_lane.py` carried a SECOND, independent realization of the
pre-amendment build recipe: `build_and_push()`, reached only by `--phase build`
and configured by `BuildPlan.corpus_url/corpus_ref/corpus_paths`. Its first
step was a raw `git clone --filter=blob:none` of the corpus onto the worker,
followed by sparse-checkout, `--strict` generation, `docker build`,
`az acr login` and `docker push`.

Nothing reaches it. `doc-health-reusable.yml` invokes this module four times —
`--phase decide` twice, `--phase pin`, `--phase record-pr` — and passes none of
the six build-only flags; the aggregation's `dashboard-image-worker.yml` does
the whole recipe in bash inside the child. But the re-ratified amendment to
`add-nightly-dashboard-refresh` prohibits the worker from holding a Git
credential at all, so a module-side path that clones contradicts a ratified
requirement whether or not a caller exists today — and two realizations of one
recipe are how the pair drifted apart in the first place. The plan's
recommendation is delete, not port: a ported copy would be a third place the
recipe lives.

Deleted: `build_and_push`, `BuildPlan`, `default_tag`, `_digest_from_push`,
`_digest_from_inspect`; the `build` phase and the six flags that fed it
(`--corpus-url`, `--dockerfile`, `--context-root`, `--registry`, `--tag`,
`--acr-login`); the three `BuildPlan`-only constants and the now-unused
`shlex` import.

Kept: `--phase pin`'s synthesized `BuildResult` path byte-for-byte;
`verify_one_revision`/`OneRevisionViolation`, whose caller moved to the child
but whose property is the contract's; `git_head_revision`, a `rev-parse` read
over a checkout the caller already has, which the parent's sealing step will
need; and `run_refresh_lane`'s injected-build seam, retyped to an opaque
handle. `--corpus-ref` stays — `--phase decide` reads with it.

Tests: the three that drove `build_and_push` directly are removed with their
`FakeBuildWorld`/`_plan` fixtures, and two take their place — an `ast`-based
assertion that no code string literal in the module names `clone`,
`sparse-checkout`, `docker` or `az`, and one that the CLI now refuses
`--phase build` loudly instead of skipping silently.

No packet file, no spec, no contract and no substrate row is touched; slice S6
records the acts and corrects task 3.4's note, which still describes the child
as running `dashboard-refresh-nightly.py --phase build`.

Lane: openxfactory-f2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_013f11Yb8DF5FTL6NuV7xWYb

* Say precisely which part of the retired recipe the module still holds

Bot round 1, Copilot (TAKEN): "THIS MODULE HOLDS THE PREDICATE AND NOTHING
ELSE" reads as literally false — the module still holds the decision core, the
pin rendering and the report section. The sentence was scoped to the recipe the
paragraph describes, but nothing said so. It now does: of that recipe the module
holds only `verify_one_revision`, never the generation, the build, or the
assertion's call site.

Lane: openxfactory-f2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_013f11Yb8DF5FTL6NuV7xWYb

* Scope the void-by-contract docstring to valid phases, not argparse usage errors

Bot round 2, Copilot: main()'s docstring said every path "falls through" and
the process "exits 0" without qualifying that against the CLI's own usage-
error path. The module's FAILURE SEMANTICS paragraph ("every error path is a
recorded outcome and exit 0") was always scoped to the lane's own runtime
logic for decide/pin/report/record-pr, never to CLI parsing, so this makes
main()'s docstring say that precisely instead of changing behaviour: exit-0
covers every valid phase's own failure path; an unrecognized phase --
including the retired `build` -- is a usage error argparse itself refuses
with SystemExit(2) before any lane logic runs, and that exit code is
deliberately outside the void-by-contract promise. test_the_cli_refuses_a_
build_phase already pins the SystemExit behaviour this describes.

Lane: openxfactory-f2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TqM41pKPnpz7utYe8vanuE

* The credentialed parent seals the bounded source artifact the child consumes

The re-ratified requirement prohibits a Git repository credential, deploy key,
credential helper or repository network access on the artifact worker, and the
worker's own readiness gate fails closed unless its heartbeat attests
`repository_credentials_absent`. The lane's recipe, meanwhile, had the child
raw-cloning two private repositories. The lane could be READY or it could
fetch; never both. This is the parent half of the fix: the credentialed hosted
parent materializes the source, and the child will consume only that
(re-realization S2 of add-nightly-dashboard-refresh).

WHAT THE PARENT SEALS. `--phase seal` takes the decide phase's own decision
file and produces one directory: the corpus at ONE revision under
`openxFactory/`, the pinned build recipe at `recipe/Dockerfile`, and
`manifest.json` carrying the source head, that commit's own committer date,
both path-scoped input revisions, the seal and baked path sets, a per-file
sha256 index, and one `tree_digest` over that index. The workflow uploads it as
`dashboard-image-source-<correlation_id>` and the dispatch is gated on it.

THE SEAL SET IS NOT THE DECISION SET, and PR #179 already paid for that once.
`snapshot.find_validator` walks UP for `openxFactory/scripts/
validate-ideation-dashboard-contracts.py` — a TOP-LEVEL `scripts/*.py` that
`CORPUS_BAKED_PATHS` does not name. The child's sparse-cone checkout carried it
as a side effect of cone mode; a `git archive` over a path list does not, and a
seal without it fails `--strict` with "validator unavailable" and no finding to
read. So the seal set is `CORPUS_BAKED_PATHS ∪ {the validator}` and the
DECISION set stays exactly `CORPUS_BAKED_PATHS`: widening the decision scope
would make `_same_scope` fire `REASON_SCOPE_CHANGED` against every recorded pin
and force one rebuild for nothing. Both halves are asserted, and the layout is
proven by running the real locator over a real sealed tree.

THE REVISION IS PROVEN, NOT ASSERTED. Today the child proves snapshot
`source_revision == HEAD` against a real `.git`; after this change both sides
come from one manifest and that check is tautological on its own. So the parent
keeps the end that still touches a repository: `git archive` records the commit
it was made from in a global extended pax header, and the seal refuses unless
that header equals the `source_head` it is about to record. The child's own
recomputation of `tree_digest` is the other half, and the rule is written INTO
the manifest (`tree_digest_spec`) so the artifact carries its own verification
rule. A test recomputes the digest from that prose by an independent
implementation, which is what makes the child's side authorable from the
manifest alone.

`--generated-at` GETS THE COMMIT'S DATE, NOT A WALL CLOCK. The manifest names
the field (`generated_at_field: source_committed_at`), and `git_commit_datetime`
makes byte-for-byte the call `generator.RealGitDates.commit_date` makes, `--`
included: the change moves where the stamp comes from, never what it says, so
the snapshot stays byte-identical across it. The parent's own wall clock is
`sealed_at` and is diagnostic only.

FAILURE SEMANTICS, unchanged from the rest of the lane. A refused seal is a
recorded SKIP and exit 0 — no manifest is written, nothing is dispatched, and
the next run catches up in one hop. The dispatch reads the upload step's
`outcome` and not merely `sealed`, because `continue-on-error` makes its
`conclusion` always success and a child dispatched against an artifact that
never uploaded would fail on the download with nothing here saying why.

Retention is one day and `include-hidden-files: true`: v4 drops dotfiles by
default and the manifest's index is the authority on what the download must
contain, while a private corpus should not sit in artifact storage for ninety
days to be read once inside the same nightly.

No contract byte moves and no substrate row moves. The child's own intake is
S3, in the aggregation; this lands first so the artifact exists before anything
downloads it. Measured on the real corpus: 3511 files, 35,123,275 bytes.

Lane: openxfactory-f2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TqM41pKPnpz7utYe8vanuE

* Stage the seal's tar outside the artifact, and refuse an overlay seal

Two holes in the first cut, both of the same shape — something that is not
part of the sealed revision reaching the `files` index, which is the authority
on what the child must find after download.

The intermediate tar was written beside the seal directory, which for the
workflow's `--seal-out dfr-seal` means a dotfile in the checkout root. It is
now staged in a `TemporaryDirectory` outside both the seal and the checkout,
so it cannot be swept into the index (a 35 MB `.tar` in there would be the
whole corpus downloaded twice) and it is cleaned up on every path including a
refusal, rather than by an `unlink` at each `raise`.

And a seal is now refused into a NON-EMPTY directory. A leftover from an
earlier attempt would otherwise be indexed, digested and shipped as though the
parent had sealed it. `finalize` runs on `ubuntu-latest` so the live workspace
is always fresh; the refusal is for the library caller and the re-run nobody
plans.

Lane: openxfactory-f2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TqM41pKPnpz7utYe8vanuE

* Name `seal` in the void-by-contract phase list too

#641's `b23e3381` scoped `main`'s exit-0 contract to the VALID phases and
enumerated them; this slice adds a fifth. The enumeration is the point of that
docstring — a phase missing from it reads as one argparse refuses — so it
carries `seal`, and says explicitly that a refused seal is one of the SKIPPED
outcomes the contract covers.

Lane: openxfactory-f2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TqM41pKPnpz7utYe8vanuE

* Refuse an escaping tar member on both branches, and canonicalize the id once

Both findings from Copilot's round on #648, both taken.

THE EXTRACTION FALLBACK WAS UNGUARDED. `_extract_seal_archive` extracts under
the `data` filter where the interpreter has one and falls back to a bare
`extractall` where it does not — and the fallback would happily write an
absolute or `..`-bearing member outside the seal. "git produced this archive so
its names are fine" is exactly the assumption an extraction hazard is made of.
The member names are now checked BEFORE anything is extracted — absolute,
traversing, and any name whose resolved target is not under the destination —
so the guarantee holds on both branches rather than on one.

THE CORRELATION ID WAS CANONICALIZED IN ONE PLACE OF TWO.
`seal_artifact_name` strips, the manifest recorded the raw value, and the child
compares the artifact name against the manifest field — so a value arriving
with surrounding whitespace would have made the child refuse a perfectly good
seal over a space. It is stripped once, at the top of `seal_source`, and both
now come from the same string.

Lane: openxfactory-f2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TqM41pKPnpz7utYe8vanuE

* Assert the seal stamp's INSTANT, not its spelling — the zero offset is git's

Two of the new tests pinned `source_committed_at` to the literal
`2026-09-04T01:02:03+00:00` and went red on the Actions runner, which returned
`2026-09-04T01:02:03Z` for the same commit: `git show -s --format=%cI` renders
a ZERO offset as `+00:00` on git 2.43 and as `Z` on the runner's git. The
assertions pinned a git version, not a property.

The manifest records whatever git said VERBATIM, and that is deliberate — the
`--generated-at` contract is that the value is "recorded in the snapshot
EXACTLY as given … never normalised", and normalising here would be this
module inventing a stamp. Both spellings are RFC 3339 and both are accepted by
`generator.is_rfc3339_datetime`, which is the property the child depends on.
So the tests now assert the INSTANT (and RFC-3339 conformance) rather than the
rendering, with the measurement of both spellings recorded beside the helper.

Byte-identity across runs is unaffected: one parent's git renders one spelling,
so two seals of one revision still name the same stamp — proven by
`test_the_tree_digest_of_one_revision_is_stable_across_two_seals` and by
`test_the_manifest_carries_every_field_the_child_reads`.

Lane: openxfactory-f2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TqM41pKPnpz7utYe8vanuE

* Do not let an unrelated manifest problem swallow the tree-digest check

Copilot round 2, taken. `verify_seal` guarded the digest recomputation with
`and not problems`, so a wrong `kind`, an unreadable `schema_version` or a
correlation-id disagreement suppressed it — contradicting the function's own
contract, which is to report ALL of what is wrong in one pass because "a seal
that is missing four files and disagrees about the revision is one diagnosis,
not four runs". The whole-tree disagreement is the most useful line in that
list and it was the one being dropped.

It now recomputes whenever every indexed path WAS hashed. A per-file mismatch
then shows up twice, as its own line and again in the digest line; that is the
right side of the trade for a diagnosis a human reads once.

Lane: openxfactory-f2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TqM41pKPnpz7utYe8vanuE

* Reflow the lines the seal edits left long

Cosmetic only, no behaviour: the `seal` insertion into `main`'s docstring left
one line running past the file's width, and four of the new statements were
82-90 columns. The `..` membership test also reads better as `".." in parts`
than as the generator it was.

Lane: openxfactory-f2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TqM41pKPnpz7utYe8vanuE

* verify_seal refuses escaping and symlinked manifest paths; the seal writer never emits them (#648)

`verify_seal` is the reference for S3's child-side intake gate, so it must
not trust `manifest["files"]` keys as safe relative paths before joining
them under the seal root. Add `_contained_relpath(root, relpath)`, which
refuses an absolute path, a `.`/`..`/empty component, a backslash, a
symlink at any path component, or a resolved location outside the seal
root — BEFORE any join or open — and route every manifest-file lookup in
`verify_seal` through it. Apply the same helper on the writer side
(`seal_file_index`, and the `seal_paths`/validator joins in `seal_source`)
so the writer and the reference verifier enforce one rule rather than two
that could drift apart. Manifest schema and `tree_digest_spec` unchanged.

Add regression tests: a tampered `files` index that escapes via `..` (with
the outside file present and `tree_digest` recomputed to match), an
absolute path, a symlinked entry, and a `..`-free path that escapes through
a symlinked directory are all refused; the honest seal still verifies
(existing coverage).

Lane: openxfactory-f2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TqM41pKPnpz7utYe8vanuE

---------

Co-authored-by: Brett Heap <[email protected]>
Co-authored-by: Claude Fable 5.1 <[email protected]>
Co-authored-by: Brett Heap <[email protected]>
brettheap added a commit that referenced this pull request Sep 4, 2026
…d; S7 and the first nightly owed before archive) (#655)

* add-nightly-dashboard-refresh: record the re-realization (S1-S5 landed; S7 and the first nightly owed)

Slice S6 of plan-nightly-refresh-rerealization-2026-09-04.md, doc-only.
Brett's words: "go S2 to S7", then "lets go".

The re-ratified amendment created a code/spec disagreement its own proposal
declined to assess. Five PRs closed it; this records them in the packet, with
every squash sha verified merged at the gate rather than read out of a handoff:

  S1  openxFactory #642  bbc21e4  --generated-at on the generate CLI
  S4  openxFactory #641  19a777d  the module's raw-clone --phase build retired
  S2  openxFactory #648  96aa61a  the parent seals the bounded source artifact
  S3  opensoft/xFactory #243  84dbbb24  the child consumes it, holds no Git credential
  S5  Omnigent-Install #211  cdfe3152  the worker profile describes the sealed intake

tasks.md — no checkbox moves (3.2/3.3/3.4/4.1/3.6 were already ticked; 3.6 by
#642). Each of those five gains a dated REALIZED evidence note naming the PR
and its squash. The stale note in 3.4 that still described the child as running
`dashboard-refresh-nightly.py --phase build` is CORRECTED by an appended,
dated note rather than an edit — the sentence is retained text, and #641's body
flagged it for this slice. Task 7.6 gains the size measurement and stays
UNTICKED, because its staleness half needs a live run. New § 9a records the five
acts, the four remaining S7 host acts (act D is DELETED, not deferred), and
§ 9's not-re-verified list carried forward.

design.md — three notes. (a) The disambiguation owed to PR #595's DECLINED
review thread: "host clone" in the sealed-artifact failure scenario means a
clone on the WORKER host, and the parent's materialization is the prior
scenario's requirement, so the two scenarios do not contradict when read in
order. (b) What the manifest attests versus corroborates: verification step 5
is an INTERNAL-CONSISTENCY check (both sides come from one manifest), and the
independent anchors are correlation_id, artifact_name, parent_run_id and
parent_repository (#243's finding) — plus open question 7's sealed-but-not-baked
validator asymmetry and #243's equality-not-presence check on generated_at.
(c) The sealed source measures 3511 files / ~35.1 MB, recorded beside the
design's ~8 MB estimate, which is low by a factor of four.

proposal.md — § AMENDED AFTER RATIFICATION gains a dated REALIZED subsection
listing the five PRs and stating what S7 still owes. Status: ratified and the
single Ratified: citation line are untouched (grep -c = 1).

README.md — the OpenSpec Records entry's lifecycle sentence gains the
re-realization state; no entry added, removed or reordered. Substrate row 3
claimed on issue #630 before the push, per protocol Rule 7.

The ARCHIVE GATE STAYS OPEN. S1-S5 make the lane exercisable, which is not
exercised: the evidence is one real nightly's pin PR merged and reconciled plus
one wider diff refused and parked, and that is S7's.

Refs #591

Lane: openxfactory-f2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01X5cVGVtCbMg1WBwU7AbMZq

* Ground the build-context claim in task 3.2 against the landed worker file

Bot round 1 (Copilot), one thread, PARTIALLY TAKEN.

Copilot: the note asserts the child keeps `manifest.json` and `recipe/` out of
the Docker build context, which "isn't established elsewhere in this packet
(and could be false if the seal root is used as the build context)".

The factual half is DECLINED — the claim is true. But the grounding half is
TAKEN, and it caught a real ambiguity: openxFactory #648's own S3 contract had
proposed the SEAL ROOT as the build context with `manifest.json` and `recipe/`
merely "inert" in it, so a reader following that contract would conclude
exactly what Copilot suspected. #243 chose the leaner assembled shape instead.

Settled against the LANDED file rather than either PR body:
`.github/workflows/dashboard-image-worker.yml` at `84dbbb24` runs
`docker build -f "$GITHUB_WORKSPACE/$SEAL_DIR/recipe/Dockerfile" -t "$REF"
"$GITHUB_WORKSPACE/ctx"` — the context is `ctx/`, assembled by copying
`CONTEXT_ROOTS` out of `<seal>/openxFactory` — and the file carries the
assertion in its own comment ("the daemon receives a lean tree and neither
manifest.json nor recipe/ reaches it"), plus a guard that fails when the
assembled context is missing the renderer packages.

The note now states the mechanism, names the divergence from #648's contract
and why #243's shape is also what the ratified requirement's "the assembled
workspace shape as context" says, and cites the landed file and its comment.

Lane: openxfactory-f2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01X5cVGVtCbMg1WBwU7AbMZq

* Copilot round 2: reconcile the README amendment dates, qualify the readiness paths by repository

Four findings, all in Copilot's suppressed set (no new inline threads).
Two TAKEN as reported, one TAKEN with the remedy corrected, one TAKEN.

1. README amendment dates CONFLICT — TAKEN, and it was a REAL pre-existing
   contradiction my sentence made visible. The entry said "WAS AMENDED
   2026-09-04 AND RE-RATIFIED THE SAME DAY" while its very next sentence said
   "authored 2026-09-01", and `proposal.md`'s front-matter `Amended:` line —
   the authoritative one — reads 2026-09-01. Reconciled to the real sequence:
   RULED 2026-09-01, reached this repository 2026-09-04 by rescue (PR #595),
   re-ratified that same day. Both halves of the entry now say it, and the
   entry names the front-matter line as authoritative.

2 + 4. `worker_readiness.py` "does not exist in this repository" — the
   observation TAKEN, the proposed remedy DECLINED. Measured, not assumed:
   `scripts/worker_readiness.py` AND `scripts/check-worker-readiness.py` both
   live in `opensoft/xFactory`, and NEITHER is a path in openxFactory. They are
   not two spellings of one entrypoint to be unified — `check-worker-readiness`
   is the CLI and imports `from worker_readiness import evaluate`, and the gate
   predicate this packet is about (`repository_credentials_present`) is in the
   module. openxFactory's `doc-health-reusable.yml` invokes the CLI by a
   relative path that resolves in the CALLER's checkout, because it is a
   REUSABLE workflow — which is exactly why neither file is here. So both
   references are now qualified by repository and the CLI/module relationship
   is stated, rather than one name being rewritten into the other and losing
   the distinction.

3. "STILL STAYS OPEN" redundant — TAKEN, now "STAYS OPEN".

Validation on this head: openspec validate <change> --strict valid;
--all --strict 89 passed / 0 failed; pytest -q tests/doc-health
tests/sequenced_after 1714 passed; grep -c on the Ratified: line = 1.

Lane: openxfactory-f2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01X5cVGVtCbMg1WBwU7AbMZq

* Copilot round 3: the phase list matches the CLI's own order

One finding, TAKEN. The 3.4 correction note listed the surviving phases as
`decide | pin | report | seal | record-pr`, but `dashboard_refresh_lane.py`
declares `choices=("decide", "seal", "pin", "report", "record-pr")` — so a
reader who hit `--phase build` would see a usage error listing them in a
different order than this note. Matched to the tuple verbatim, and the note now
says that is where the order comes from, so the next edit has a reason to keep
them in step.

Validation on this head: openspec validate <change> --strict valid;
--all --strict 89 passed / 0 failed; pytest -q tests/doc-health
tests/sequenced_after 1714 passed; grep -c on the Ratified: line = 1.

Lane: openxfactory-f2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01X5cVGVtCbMg1WBwU7AbMZq

---------

Co-authored-by: Brett Heap <[email protected]>
Co-authored-by: Claude Fable 5.1 <[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.

2 participants