Repository navigation
fix(skills): enforce read-before-write for all stow findings - #1963
Closed
kunchenguid wants to merge 1 commit into
Closed
kunchenguid wants to merge 1 commit into
kunchenguid wants to merge 1 commit into
Conversation
The public installer-facing stow skill scoped its classify-then-replace discipline to TODO/BACKLOG items only, so findings routed to a memory file had no stated rule against a blind append or a wholesale overwrite, and a superseded body could vanish silently in a rewrite. Step 6 now classifies every finding against the destination's current contents as new, duplicate, superseding, or obsolete, states the considered replacement each classification implies, and requires a superseded body worth keeping to be moved somewhere recoverable in the same pass.
Owner
Author
|
Superseded by #2091. This branch was rebased onto current main to resolve a conflict with #1984 (tiered decaying memory management), which edited the same file. The rebase and conflict reconciliation succeeded, but the no-mistakes gate then refused the push as non-fast-forward and reported Per an explicit captain decision, the recovery is a fresh branch with fresh gate custody rather than a gate force-update - firstmate never force-pushes or hand-clears the no-mistakes gate. #2091 carries the identical reconciled content, validated green on current main. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Port ONLY the read-before-write discipline into the PUBLIC installer-facing stow skill skills/stow/SKILL.md. This is firstmate shared, tracked material, so firstmate-coding-guidelines applies: one-owner rule, knowledge-placement decision tree, one sentence per line in tracked Markdown, plain dash never an em dash, no agent co-author on commits.
What to add: the discipline of inspecting the CURRENT contents of a memory/notes/backlog target BEFORE replacing it; classifying the change as new / duplicate / superseding / obsolete; and writing a CONSIDERED replacement rather than a blind append or overwrite. The stronger-owner / pointer-over-copy and note-discipline points may be folded in ONLY insofar as they are genuinely part of the read-before-write discipline; when in doubt keep it to read-before-write only.
HARD EXCLUSIONS from an explicit captain decision dated 2026-08-08 (captured verbatim in a private decision file). These are deliberate choices, not oversights, and must NOT be flagged as missing:
Implementation decision made while doing the work: the public skill ALREADY carried most of the read-before-write discipline in its step 6 (reading the destination file's current contents in full) and its step 7 curation pass (including the stronger-owner counterweight). The one genuine gap was that the classify-then-replace half of the discipline was scoped only to TODO/BACKLOG/NOTES items, so a finding routed to a memory file had no stated rule against a blind append or a wholesale overwrite, and a superseded body could vanish silently in a rewrite. The change therefore generalizes step 6 rather than adding a new section: classify every finding against the destination's current contents as new / duplicate / superseding / obsolete, state the considered replacement each classification implies, and keep a superseded body somewhere recoverable when it is worth keeping. The minimal, focused diff (5 insertions, 3 deletions in one file) is intentional - a larger restructuring or a duplicated new section would violate the one-owner rule against the existing step 6 and step 7 language.
Acceptance criteria: skills/stow/SKILL.md gains the focused read-before-write discipline and nothing from the excluded list; the internal stow skill is untouched; bin/fm-doc-audience-check.sh passes because the public skill is installer-facing; the diff stays minimal and focused. Delivery is yolo OFF - open a PR and stop for the captain's merge; do not self-merge.
What Changed
Risk Assessment
✅ Low: The focused documentation change closes the stated read-before-write gap for memory destinations, preserves existing ownership boundaries, and introduces none of the explicitly excluded behavior.
Testing
The public skill passed a live end-user-aligned stow scenario: it read existing memory before editing, dropped duplicates, superseded and preserved recoverable history, replaced obsolete information, added new information, and preserved unrelated facts. The installer-facing audience check passed, commit inspection confirmed the minimal public-only scope and clean authorship, the internal skill was untouched, and testing left no worktree artifacts. No visual evidence was captured because this is a non-UI agent skill; the persisted file diff and live tool transcript are the reviewer-visible product evidence.
Evidence: Concise live stow end-to-end transcript
Evidence: Raw Pi live invocation transcript
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
git diff --stat,git diff --name-status, and focused diff from833a9a25...to8288e378...Livepi -p --mode json --no-session --no-extensions --no-context-files --approve --model openai-codex/gpt-5.6-terra --thinking medium --skill <worktree>/skills/stow/SKILL.md ...against a disposable pre-populated project memory filediff -u AGENTS.expected.md AGENTS.mdjq -e '[select(.type == "tool_execution_start") | .toolName] == ["read", "edit"]' pi-stow-transcript.jsonlbin/fm-doc-audience-check.shgit diff --quiet 833a9a25... ..8288e378... -- .agents/skills/stow/SKILL.mdand target commit metadata inspectiongit status --shortafter testing✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.