fix(daemon): keep an edited seat-skills line at down, and don't write it through a link #1859
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.57) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.57 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #1859"
general
weight: 0.35
mvschwarz
What a user gets
Four protections for the seat-skills line, the one line OpenRig can add to a seat's
CLAUDE.mdorAGENTS.mdwhen a person opts in withrig setup --router-line yes:- Before this,
rig downremoved the line's block even when the person had changed it, and the next start replaced it.- Now
rig downleaves an edited block in place and names it:Kept 1 edited OpenRig block(s) in guidance files; remove them by hand if you don't want them:, followed by<file>: <block id>.- A start leaves an edited block as it is, reports the file as
edited, and warnsseat_skills_line_edited.- An unedited line is still removed by
rig down, back to the file's original bytes.- Before this, a
CLAUDE.mdorAGENTS.mdthat is a symbolic link received the line through the link, often into a file outside the project, and the start said it was delivered.- Now the start leaves the link and its target alone, reports the file as
linkedwith aseat_skills_line_linkedwarning, and starts the seat without the line.rig up --existing(an exact resume) wrote the line back whenever it was missing, even after a no, or with no answer at all. Now it puts the line back only with a yes, and never through a link.- The promise is "one line, plus OpenRig's markers so it can be removed cleanly".
- The preview shows the exact text written (the line between OpenRig's markers), printed as written and in JSON as
written.- It also shows where that text goes: added at the end of the file after two newlines, or as the whole file when there's none.
The change
One rule for "edited" (
managed-blocks.ts):managedBlockBodyMatchescompares a block's body with what OpenRig writes. It uses the exact bytes, ignoring only the writer's own framing (newlines at either end, and CRLF line endings). A person's spaces count, so an indented line is an edit.rig downand a start both use it, so they agree on what is edited.At
rig down(rig-teardown.ts):removeManagedBlocksFromFiletakes the bodies OpenRig writes for named blocks.SEAT_SKILLS_BOOTSTRAP_LINE, which the guidance asset carries exactly). An edited block is kept in place, reported askeptGuidance, and printed byrig down.At a start (
startup-orchestrator.ts,footprint-choice.ts):- if the file itself is a symbolic link, the outcome is
linked;- if it holds an edited seat-skills block, the outcome is
edited.- Either way, nothing is written.
delivered,skippedandunwritable.At an exact resume (
restore-guidance.ts,restore-orchestrator.ts):applySeatSkillsLineRuleleaves the seat-skills block out of the saved guidance unless the saved answer is yes and the file isn't a link. So the repair doesn't write it, and the post-restore guidance check doesn't report it missing.skills.router_line.enabled), as at a start.What setup shows (
seat-skill-storage.ts,setup.ts):written(the line between the markers, built bymanagedBlockText, the helpermergeManagedBlockwrites with),appended(the bytes added to an existing file) andplacement.Limits, stated:
CLAUDE.mdtoAGENTS.mdon purpose, and refusing there would stop all of OpenRig's guidance for them.Tests
rig-teardown.test.ts: for a Claude seat'sCLAUDE.mdand a Codex seat'sAGENTS.md, the blocks are written with the real writer, then a real teardown runs on a real filesystem.- An unedited line returns the file to its original bytes.
- An appended word and an indented line are each kept in place and named in
keptGuidance.- The culture block beside them is still removed.
startup-orchestrator.test.ts, each through the real Codex and Claude adapters:- A linked guidance file: the file outside the project is unchanged, and the outcome is
linked.- An edited line: it is left byte for byte, and the outcome is
edited.- A yes: the start writes exactly the previewed bytes, both into an existing file and into a new one.
restore-guidance-after-down.test.ts: down, then an exact resume. After a no, the line isn't written and there's no guidance gap; after a yes, it is put back.setup.test.ts: the preview'swrittenis the exact block, and setup prints it as written.down.test.ts:rig downprints each kept block.Proof
Each test run was at an exact commit, on a clean, network-off build of the repository.
b679db51):- Before the fix (main
ebfc0fb5plus the new tests): daemon 195 of 200 and CLI 44 of 45. All five failures are the new cases; the one skip is an existing one.- With the fix: daemon 393 of 394 (the same skip) and CLI 129 of 129, across 13 files.
3ce6ca2b):- Before (the first commit plus the new tests): CLI 58 of 59 and daemon 125 of 130. The five failures are the new preview and written-bytes cases.
- With it: daemon 397 of 398 (the same skip) and CLI 226 of 226, across 13 files.
9fdbd6e6, this head):- Before (the second commit plus the new tests): daemon 222 of 228. The five failures are the new cases: the resume after a no, the indented line at down, and an edited line at a start for each harness. The resume after a yes passes.
- With the start test's byte check moved first: both edited-start cases fail on the person's bytes, because the start replaced the edit.
- With it: daemon 674 of 675 (the same skip) and CLI 118 of 118, across 14 files, including the restore orchestrator and per-seat role restore suites.
🤖 Generated with Claude Code
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Setup previews show the exact marked guidance text, where it will be placed, and what happens if you decline.
Startup reports when guidance files are linked or contain edited lines, and leaves those files unchanged.
rig downreports edited guidance blocks it preserves.Bug Fixes
Teardown preserves edited setup guidance while removing other managed guidance.
* Saved seat-skills guidance is restored only when the setup choice was “yes”; linked guidance files are not written through.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->