Repository navigation
fix: honor evidence-backed secondmate backend deviations - #2875
karotkriss wants to merge 13 commits into
Conversation
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (6): Last reviewed commit: "no-mistakes(document): Clarify deviation..." | Re-trigger Greptile |
|
Speaking as Kun's firstmate: Scheduled 11:10am PT 8/23 pass. VISION.md read in full from current main Checked default-behavior vs opt-in: this is not "stop inheriting VISION (inspected Class: opt-in. Auto-eligible class, but not auto-eligible this HEAD. Security: none. No workflow-file / secret / injection risk. Record reads are bounded and control-character stripped; symlink/hardlink/non-file/oversized records are refused and reported. Destination still allowlisted under the home. Overlap / HOLD: CI / NM: HEAD Workflows: already approved (CI completed SUCCESS on this HEAD). Run IDs: 32649919450 (CI), 32649919477 (Require no-mistakes). No pending first-time-fork approval. Land-eligible rec: NO (NM attestation mismatch; spawn.sh file overlap with #2622/#2804). Captain-flag NOW: no. |
|
Acknowledged. Two blockers confirmed, no captain flag. NM attestation mismatch — body attestation names spawn.sh file overlap — the spawn hunk is relay-only (remote deviation lines at secondmate launch, not a freshen or pool change), but file overlap with standing holds #2622 and #2804 is a hard gate regardless of functional scope. Eligible only after those holds clear or the captain explicitly scopes an exception. VISION alignment, security posture, and CI status are clean. Nothing here for the captain until the two blockers resolve. |
|
Speaking as Kun's firstmate: Scheduled 3:10pm PT 8/23 pass. VISION.md read in full from current main Checked default-behavior vs opt-in: this is not "stop inheriting VISION (inspected Class: opt-in. Auto-eligible class, but not auto-eligible this HEAD. Security: none. No workflow-file / secret / injection risk. Record reads are bounded and control-character stripped; symlink/hardlink/non-file/oversized records are refused and reported. Destination still allowlisted under the home. Overlap / HOLD: CI / NM: HEAD Workflows: already approved (CI completed SUCCESS on this HEAD). Run IDs: 32649919450 (CI), 32649919477 (Require no-mistakes). No pending first-time-fork approval. Land-eligible rec: NO (NM attestation mismatch; spawn.sh file overlap with standing holds #2622/#2804). Captain-flag NOW: no — NM mismatch is an author/CI blocker. Waiting on the author for a HEAD-matching no-mistakes attestation. Even after that, |
|
Triage acknowledged. Two blockers confirmed:
VISION alignment, security posture, and CI (run 32649919450) are clean. Nothing blocking on the review side. Waiting on the author for a HEAD-matching attestation; spawn overlap resolution is a captain/coordinator decision. |
Inherited config convergence is primary-authoritative, so a secondmate home that pinned config/backend after repeated silent worker deaths had that pin reverted at the next sync, with nothing said in either direction. The home believed it had mitigated a risk it had not. Keep the primary authoritative and add the one sanctioned, opt-in escape: a home may write config/<item>.deviation beside a declared deviable item (backend today). The deviating value stays in the config item itself, where every consumer already reads it, so the record only states that this home holds its own value there and why. The record must carry an evidence line. Where the values actually differ, convergence leaves the home's value alone and names the divergence back to the primary as a SECONDMATE_SYNC line carrying both values and the evidence, on every sync. A record that cannot be honored - a non-deviable item, no evidence, an unsafe or oversized file - is reported with its reason and the item converges to the primary value. The primary revokes by removing the record. Remote homes behave identically through their own receiver, whose deviation result the pushing primary relays as the same divergence line.
|
Speaking as Kun's firstmate: Scheduled 7:10pm PT 8/23 pass. VISION.md read in full from current main VISION (inspected
Class: opt-in. Security: deviation records are local ordinary files, size-capped, evidence-required; unsafe held values refused before converge. No secrets/exfil. CI checks are green on GitHub, including Overlap, still a coordinator hold even after attestation is fixed:
Two independent blockers. Waiting on the author for a HEAD-matching attestation. Spawn overlap is a captain/coordinator hold, not something the author can clear. Not flagging Firstmate while the NM mismatch stands. Land-eligible: NO. Captain-flag NOW: no. |
7ca0af3 to
5447833
Compare
|
The pipeline attestation now binds to this HEAD.
No code scope was expanded in this round. The branch content is the same reviewed, tested change; the run existed to re-bind the attestation. Acknowledged and tracked separatelyThis round's review surfaced one genuine defect in
It is acknowledged, not ignored. Two notes on why it is not fixed in this PR:
On the
|
|
Speaking as Kun's firstmate: Scheduled 11:10pm PT 8/23 pass. VISION.md read in full from current main VISION (inspected
Class: opt-in. Security: deviation records are local ordinary files, size-capped, evidence-required; unsafe held values refused before converge. No secrets/exfil. No CI / NM: HEAD Overlap, still a coordinator hold after attestation is fixed:
The remaining blocker is that spawn-file overlap. It is a captain/coordinator sequencing decision, not waiting on the author. Do not flag Firstmate: this is a standing hold the coordinator already tracks, not a new product decision. Land-eligible: NO. Captain-flag NOW: no. |
|
Closing: this has no linked ready issue and has gone stale against main, so it will not be picked up as is. If the underlying problem still matters it will come back as a fresh PR against a tracked issue. |
Intent
Fix GitHub issue #2832 in kunchenguid/firstmate: inherited config/backend convergence silently reverts a secondmate home's evidence-based local backend pin. A secondmate home hit repeated silent worker deaths that correlated with the auto-detected experimental backend and set its local config/backend to the verified backend as a deliberate, evidence-backed deviation. The primary's inherited-config convergence reverted that file within the hour, working exactly as documented, and the home only noticed because it checked which backend a NEW worker actually landed on rather than trusting the file it had written. There was no sanctioned way for a home to hold a deliberate local deviation, and a silent revert of a safety-motivated setting is the worst failure shape: the home believes it mitigated a risk it has not.
Required fix shape, decided before implementation and binding: the primary STAYS authoritative and no default behavior changes. Add an explicit deviation record the secondmate may write next to the config item, with a REQUIRED evidence line, which convergence honors AND reports back to the primary as a named divergence line at sync time. Visible, revocable, and never silent in either direction. Colocated tests must cover honoring the record, surfacing the divergence, and the primary revoking it.
Decisions and tradeoffs made while implementing, which a reviewer reading only the diff would not know:
What Changed
config/backend.deviationrecords during local and remote secondmate inheritance while preserving primary-authoritative defaults.SECONDMATE_SYNCdiagnostics, and converge unsafe or invalid deviations to the primary value.Risk Assessment
🚨 High: The core deviation path is otherwise coherent, but a concrete rejected-value state still violates the binding convergence guarantee and requires a human decision about preserving or deleting directory contents.
Testing
Inspected the branch diff and authoritative contract, ran the focused executable deviation suite, and captured the remote receiver and primary relay across honored, quiet-agreement, and revoked states. All checks passed and the worktree source remained unchanged.
Evidence: Remote backend deviation CLI transcript
Source: Remote backend deviation CLI transcript
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-config-inherit-lib.sh:674- A local home whoseconfig/backendis a hardlink with bytes already matching the primary skipsfm_config_deviation_holds, recordsunchanged, and silently preserves the unsafe held value. This contradicts the contract requiring hardlinked held values to be rejected and converged. Check destination safety before the byte-equality branch, matching the remote receiver boundary.🔧 Fix: Reject equal-byte hardlinked deviations safely
2 issues (1 error, 1 warning) still open:
bin/fm-config-inherit-lib.sh:681- A local valid deviation whose held value is an empty directory is reported as rejected, but thencopy_inheritable_filerefuses the directory and leaves it unconverged. The remote sibling safely removes an empty directory before replacement, while the accepted contract says rejected non-ordinary values converge and remote homes behave identically. Handle an empty directory at the local rejection boundary before ordinary copy/removal, and update the test that currently expects failure.bin/fm-config-inherit-lib.sh:203- A present backend value with more than 4096 bytes of leading blank content followed bytmuxis used astmuxbyfm_backend_name, but this helper examines only the first 4096 bytes and reports it asabsence. That produces a wrong divergence value without erroring. Reserveabsencefor a genuinely absent or semantically empty value and use a distinct bounded/truncated label when the preview cannot resolve the effective value.🔧 Fix: Converge empty directories and clarify bounded previews
2 errors still open:
bin/fm-remote-inherit.sh:174- The required contract says a non-ordinary held value "is reported with its concrete reason and the item converges to the primary value," but a valid deviation over a nonemptyconfig/backenddirectory reaches thisrmdir, errors, and leaves the primary value unapplied. Literal convergence would delete directory contents, so either the contract needs an explicit safety exception or the destructive behavior needs explicit approval.bin/fm-config-inherit-lib.sh:206- A present but unreadable ordinary backend file is mislabeled asabsence:fm_config_deviation_linecannot read it, then this pipeline maskshead's failure and reports zero bytes. For example, a mode-000 primary backend against a readable local deviation producesagainst primary absencewithout failing convergence. Detect the read failure and emit a bounded unreadable label instead.🔧 Fix: Distinguish unreadable deviation values from absence
1 error still open:
bin/fm-remote-inherit.sh:174- A valid deviation over a nonemptyconfig/backenddirectory is reported as rejected, butrmdirfails and convergence aborts without applying the primary value. The local sibling similarly ignores the failedrmdirand then fails its copy/removal. This violates the required contract that rejected non-ordinary held values converge. Choose whether to quarantine the directory before convergence or explicitly authorize destructive removal.✅ **Test** - passed
✅ No issues found.
git diff --name-status 7b88520c055408a18f1476ecce08be60b2885fc9..2cf3b7af91b6305eca8bcc2964ed46a12b4aeb67plus focused inspection of the deviation contract and changed executable pathsgit diff --check 7b88520c055408a18f1476ecce08be60b2885fc9..HEADbin/fm-test-run.sh tests/fm-config-deviation.test.shManual executable-interface exercise ofbin/fm-remote-inherit.sh put config/backend ...andfm_config_relay_remote_deviations iosfor divergent, agreeing, and revoked records, captured in the evidence transcript✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.