Skip to content

apply/state correctness: failed status, lock-prune scope, unreachable host (master #900) - #902

Draft
noahgift wants to merge 12 commits into
mainfrom
forjar-cop/packB
Draft

noahgift wants to merge 12 commits into
mainfrom
forjar-cop/packB

Conversation

@noahgift

@noahgift noahgift commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Ticket: PMAT-659

Closes #688, closes #661, closes #659. Master #900 (epic #879). Packed per TPK-001. Tests were not built locally (lambda is build-banned); CI is the check.

🤖 Generated with Claude Code

noahgift and others added 3 commits November 9, 2026 08:58
…erged (closes #688)

ResourceRunStatus gains Failed { exit_code, duration_secs }; Converged now
means success only. Pre-fix files (`converged` + `failed: true`) still read,
as Failed. A transport failure and a post-apply verify failure now write a
meta row too (they wrote none).

Pmat-Ticket: PMAT-688
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…d refuses a shared machine (closes #661)

lock-prune walked every machine dir in --state-dir and treated every key the
one -f config lacks as stale, deleting another stack's entries (and on a
machine the config never declares). It now visits only config.machines and
refuses, before writing anything, a machine another stack's stamp also owns,
naming that stack. Lock entries do not record their stack until #561.

Pmat-Ticket: PMAT-661
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ed, exit 4 (closes #659)

ssh exit 255 over an ssh transport, a transport Err and a container-ensure
error are no longer tallied as `fail`: they are `unmeasured`, printed and
reported in --json (status "unmeasured", all_passed false), and make the run
exit 4 (Connection, via CHECK_UNMEASURED_MARKER). Drift stays a fail, exit 1;
the apply --check help said "exit 2" and now says what happens (1 / 4).
format_check_json moves to check_json.rs to keep check.rs under 500 lines.

Pmat-Ticket: PMAT-659
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@noahgift

noahgift commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

LANE out117-w1 (claude-sonnet-5-5) · head 85ff359 · VERDICT FAIL
cargo test --lib on kfocus at this head: 13754 passed, 1 FAILED: resources::disk_budget::detect::tests::sweepable_refuses_a_candidate_outside_every_declared_root. Not checked whether it also fails on main (could be host-dependent: kfocus paths); author to confirm. Other checks: quorum receipt red, rest pending. Only --lib was run.

…not converged (closes #688)"

This reverts commit 7d67e11. Moved to PR #899 to keep this PR under the 600-line cap.

Pmat-Ticket: PMAT-688

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@noahgift

noahgift commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

LANE out117-w4 · head 85ff359 · VERDICT PASS (targeted)
Model: claude-sonnet-5-5. Host: intel (detached worktree at the exact head, nice 19). Ran cargo test --test falsification_659_check_unreachable_is_unmeasured --test falsification_661_lock_prune_scoped_to_config --test falsification_688_failed_resource_action_failed --test falsification_query_runlog --test falsification_runlog_doctor_imagelog: every result line ok, 0 failed (4, 2 and 2 passed in the three new falsification files, plus the two touched existing ones). These cover the three closed issues (#659 unreachable = unmeasured, #661 lock prune scoped to the config, #688 failed resource = action failed). Not verified: the full lib suite and clippy, and whether each new test goes red on a revert of its fix. The red quorum receipt check on the PR is the one forjar#897 is moving off the PR path.

🤖 Generated with Claude Code

@noahgift

noahgift commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

CORRECTION out117-w1: the single lib failure I cited (sweepable_refuses_a_candidate_outside_every_declared_root) also fails on main 269e180 on kfocus, so it is not caused by this PR. My lane at 85ff359 is withdrawn as FAIL on that basis; remaining result: 13754 passed, only that baseline failure. VERDICT PASS (lib only, no CI jobs run).

@noahgift noahgift left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Single-lane review (f20-i4), comment only, NOT an approval. Read: the PR body and about the first 330 diff lines of 9 files (+416/-69): check.rs, the new check_json.rs, the apply_args.rs doc line, lock_core.rs and the start of lock_prune_scope.rs. I did NOT read the rest of lock_prune_scope.rs, the ResourceRunStatus::Failed part (#688) or any tests. No tests were run.

  1. Duplicate of #929. #929 (draft) carries the same Closes #661 / #659 / #688 under the same master #900 and the same three fixes (lock-prune scope, ssh 255 unmeasured, failed run-status). This PR is non-draft and counts against the D53 cap. Pick one and close the other as a duplicate with the link. If both stay, they will conflict on check.rs and lock_core.rs. My earlier comments on #929 apply here too (a probe that itself exits 255, a ConnectTimeout in the test, legacy failed:true round-trip).
  2. The 255 branch checks transport::is_ssh_transport(machine), so a local command that exits 255 stays a failure. Good. But Err(e) => ("unmeasured", ...) now maps every transport Err to unmeasured, including errors that are not connection problems (a script-write failure, a spawn error). Narrow it to the connection class, or keep "error" for the rest.
  3. "unmeasured" outranks drift: the check returns Err starting with CHECK_UNMEASURED_MARKER when any host could not be measured, even if other checks failed. The text line says (N failed), but the JSON all_passed is false for both cases with no separate field. Add "exit_class" to the JSON so a consumer can tell exit 4 from exit 1 without parsing the message.
  4. The apply --check doc line now says exit 1 = changes needed, replacing "exit 2". Confirm that exit 1 really is the code, and update the book and any script in this repo that tests for 2.
  5. lock-prune is now scoped to -f machines and refuses a machine another stack's stamp also lists. The "check every machine before any write" order is right. The guard relies on stamps because entries record no stack (#561). Say in the PR body that a machine with no stamp is treated as unowned, since that is the unsafe default for a delete.
  6. The body says tests were not built locally and CI is the check. As of now the ARM64 clean-room jobs on forjar are starved, so no signal is available. Do not arm until they have run.
  7. No sign-off visible. Needs a non-author round bound to the final commit.

@paiml-fleet
paiml-fleet Bot marked this pull request as draft November 10, 2026 15:26
@paiml-fleet

paiml-fleet Bot commented Nov 10, 2026

Copy link
Copy Markdown

GHC-001 R4 PR open > 4 h without a review PASS. Converted to draft (nothing lost). Mark ready again (gh pr ready 902 -R paiml/forjar) once it has a review PASS at its head.

@noahgift noahgift left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

s-xpile-1 lane review at head ba15d11 (comment-only; not an approval; nothing built or run by me, diff read via git).

DUPLICATE RISK: #929 (head afcd18e, opened 2026-11-09 14:41Z, 161 additions) lists the same three tickets, Closes #661 / #659 / #688, under master 900, with the same three fixes described (lock-prune scope, ssh 255 unmeasured, failed status). #902 (opened 08:25Z, 472 additions) is the earlier and larger one. Two open PRs closing the same tickets will conflict; the owner should say which supersedes the other and close or trim one (closing stays the operator's / owner's call).

Read of #902 itself: lock_prune_scope.rs plus the cmd_lock_prune rewrite is sound: only machines the config declares, every machine checked for another stack's stamp before any write, so a refusal leaves the state dir untouched; refusal only fires when stale entries exist. CHECK_UNMEASURED_MARKER maps to ErrorClass::Connection (exit 4), consistent with the existing marker table.

Non-blocking: the diff also rewrites the doc comment on DRIFT_DECLINED_MARKER in error.rs (drops the 'never a verdict about resources from another manifest' wording). It is unrelated to #659 and loses information; I would restore it. Body says tests were not built (lambda is build-banned), so CI is the only check.

🤖 Generated with Claude Code

noahgift and others added 5 commits November 10, 2026 18:24
Pmat-Ticket: PMAT-688

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Basis (fleet-sup ruling 2026-11-11 18:35Z): Noah 11 Nov: solo cop on
Fable 5.2, dispatcher only; workers Sonnet.

Pmat-Ticket: PMAT-659
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Pmat-Ticket: PMAT-659

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Pmat-Ticket: PMAT-659

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment