Skip to content

Hardening 2: closed-but-unamendable verification failure path; explain or allow legitimate launcher rebinds #217

Open

Description

@DanielNetzer

Themed follow-up from the #209 review (PR #216).

  1. A verification that failed while completing looks closed but can't be amended (readiness_run.go ~:1497, stopVerification after completeVerification fails). The ledger shows failed/blocked, but the last verification attempt keeps status started with no result, so both Amend and recover refuse it with "missing durable process evidence". Fix: mark that attempt interrupted or failed with a finish time, since the checks have returned by then, or let recover handle it.

  2. LauncherOnlyChange refuses legitimate rebinds (formula.go launcherUpgrade):

    • rolling back to an older release after a bad one;
    • moving ~/.forgecell (a different releases root).

    In-flight Molecules then need a fresh intake, and errFormulaChanged doesn't say why. Fix: either allow these explicitly behind a recorded reason, or return a precise refusal ("rebind must be a newer release under the same releases root").

  3. LOW, if cheap:

    • two returns after the checks pass still leave the phase at check-pending and the status at running: the save before review, and the formula.Parse error (~:1520);
    • the loop re-reads every ledger header on each pass because it has no HeaderCache;
    • ReadRecentFinished is now only used by tests.

Review checklist (read before coding)

See the checklist used on #209: bounds, filesystem safety, untrusted input, no local leaks, contract changes, and deterministic tests. Use targeted package tests; a plan may have at most 16 checks, including the 5 Formula baseline checks.

Added 2026-10-27: a malformed coding outcome after complete work

What happened: on #264 the coding harness finished every edit and ran tests, vet and gofmt, but its final message was not the JSON outcome ("invalid character 'B' looking for beginning of value"). The Molecule was blocked. The work survived as a retained tree, but recovery took a manual amend and a whole extra coding continuation.

Asks:

Added 2026-10-30: the scope-violation recovery trap

What happens:

Asks:

Activity

  1. added
    post-v1
    on Oct 25, 2026
  2. DanielNetzer commented on Oct 25, 2026

    @DanielNetzer
    OwnerAuthor

    Flaky under load (post-v1): TestHarnessTimeoutPlanValueIsHonouredAndRecorded (molecule) failed once in #199's candidate full suite and passed in the protected view in the same run. It depends on a real wall-clock timeout, so it should be made deterministic with a seam or readiness marker.

  3. DanielNetzer commented on Oct 25, 2026

    @DanielNetzer
    OwnerAuthor

    From the #195 review (post-v1): (1) amend --run should print the added scope and its auto-chosen evidence IDs, i.e. the full plan view, before approving. (2) With --run, refuse to drop a parent's checks-only continuation unless --continuation coding is given explicitly. (3) A bare forgecell amend MOL with no building flag should be refused. (4) lockMolecule runs before the ledger is known to exist, so a mistyped Molecule id leaves a .loop-lock file behind; Lstat the ledger first. (5) Operator notes should reject bidi and zero-width characters, matching ReviewDisplayText.

  4. DanielNetzer commented on Oct 25, 2026

    @DanielNetzer
    OwnerAuthor

    Post-v1 hardening, found on 2026-10-25 during #220 intake: when an issue has an ## Acceptance section, the analysis model sometimes copies those bullets into each check's reviewedAcceptance. readiness.validate (internal/readiness/plan.go:474) then rejects the whole analysis with LabellingViolationMessage, and the corrective retry repeated the same mistake twice. The workaround was to rename the section to 'Done when' and tell intake to leave the field empty. Proposed fix: the corrective-retry prompt should name the offending field (reviewedAcceptance/independentProvenance) and tell the model to clear it, or the analysis schema shouldn't expose those fields to analysis at all.

  5. DanielNetzer commented on Oct 25, 2026

    @DanielNetzer
    OwnerAuthor

    Post-v1 hardening, from the #218 review: molecule.Run doesn't take the per-Issue start lock (only the loop's start takes it, via lockIssue in molecule/loop.go). So a CLI forgecell run N started beside a CLI or UI loop can still create two Molecules for one Issue. The UI guards its own run and loop pair since #230. Fix: take lockIssue for Run's intake phase.

  6. DanielNetzer commented on Oct 25, 2026

    @DanielNetzer
    OwnerAuthor

    Post-v1, found on 2026-10-25: when the harness CLI's auth has expired (Claude Code reports Failed to authenticate: OAuth session expired with terminal_reason: api_error), intake shows only analysis failed: exit status 1. Proposed fix: have the adapters classify a provider auth failure and surface it as harness not authenticated: run claude auth login (or the provider's equivalent) in the outcome, the loop report, doctor and the UI. The loop should stop dispatching after the first auth failure instead of failing every Molecule.

  7. DanielNetzer commented on Oct 26, 2026

    @DanielNetzer
    OwnerAuthor

    Post-v1, found on 2026-10-26 at the first real use of amend --accept-protected-failures (#235): it refuses unless the protected check is a direct go test -json command, and intake proposes plain go test ./... checks. In practice the feature only applies after a manual --plan amend that adds -json. Fix options: (a) intake proposes go test -json for targeted Go checks (via the analysis instruction or plan normalization), or (b) the protected view runs go test checks with -json itself and renders plain output for humans. (b) removes the dependency on intake. Interim measure: the issue template's plan-check guidance now asks for -json.

  8. DanielNetzer commented on Oct 26, 2026

    @DanielNetzer
    OwnerAuthor

    Addendum (#235): go test -json over large packages overflows the 1 MB check-output cap (cli overflowed after 52 s), and the overflow fails the candidate view. So fix (b) from my previous comment needs the protected view to stream -json events into the failing-test parser without retaining them, and to render a bounded plain summary. A larger cap alone isn't enough.

  9. DanielNetzer commented on Oct 26, 2026

    @DanielNetzer
    OwnerAuthor

    Post-v1, found on 2026-10-26: amend --rebase-formula (#208) refuses any rebind between dev builds whose commit-hash suffixes don't sort upward. launcherUpgrade → compareReleaseVersions compares 0.0.0-dev.<hash> pre-release identifiers lexically, so 0.0.0-dev.08fbd74 counts as older than 0.0.0-dev.a08de66 and the rebase fails with the generic 'issue or Formula changed; refresh intake'. Earlier rebases only worked because the hashes happened to ascend. Fix options: make dev install stamp a monotonic build ordinal (for example 0.0.0-dev.<UTC timestamp>.<hash>), or accept any dev-to-dev launcher change in the same releases root for --rebase-formula. Either way, show the specific reason instead of the generic one. Context: I rebound while #235 was still in flight, against the 'rebind only between waves' rule.

  10. DanielNetzer commented on Oct 26, 2026

    @DanielNetzer
    OwnerAuthor

    Post-v1, found on 2026-10-26 (#236): when the resource guard refuses to start verification (low disk), the Molecule is left blocked in phase check-pending. No amend path accepts that phase; checks-only needs scope-waiting, failed, review-waiting or interrupted. Recovering needed recover --confirm-stopped first, then amend --continuation checks-only. Fix: record a resource refusal as interrupted, or let checks-only accept check-pending when no verification attempt started, and name the next command in the outcome.

  11. DanielNetzer commented on Oct 26, 2026

    @DanielNetzer
    OwnerAuthor

    Issue sync, 2026-10-26: items moved out of this bucket:

    Still here, post-v1: the rebind ordering themes (dev-hash ordering, rollback, moved root), reviewedAcceptance labelling at intake, the -json streaming notes, the flaky TestHarnessTimeoutPlanValueIsHonouredAndRecorded, amend --run plan display, and the LOW leftovers.

  12. DanielNetzer commented on Oct 31, 2026

    @DanielNetzer
    OwnerAuthor

    Intake gap seen on #309 (2026-10-31): an Issue that names many source paths exhausts the 16-file evidence bound before the component manifest (lab/go.mod) is collected. Intake then refuses with "new path … needs evidence for its parent component", even though every earlier plan resolved the same component. Suggestion: always collect the component manifests for new paths outside the named-file bound, or reserve slots for them. Workaround: name lab/go.mod explicitly at the top of the Issue body.

  13. DanielNetzer commented on Nov 12, 2026

    @DanielNetzer
    OwnerAuthor

    From the review of #425 (#386):

    • M2: POST findings/propose refuses only when the receipt has seen the merge or close. When only GitHub sync has seen it, the UI disables Propose, but a stale tab or a direct POST still reaches fixRoundPropose. Also refuse when the cached forge snapshot shows the PR is no longer open (syncFindingsLive).
    • L4: fixround/push and findings collect have no merged or closed check, so a verified fix round can still be pushed to a merged PR's branch. This predates Findings tab: fixes from the first walkthrough #386.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    post-v1

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions