Skip to content

refactor(cli): one path-confinement helper and one atomic writer - #77

Merged
N4M3Z merged 3 commits into
mainfrom
fable/spec-roles
Oct 18, 2026
Merged

N4M3Z merged 3 commits into
mainfrom
fable/spec-roles

Conversation

@runewright

@runewright runewright Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Draft for fable/spec-roles: the session agent fills this body before rune sign open.

Plan

Why this shape, one or two sentences.

Changes

  • Fill in: verb-first, file-anchored claims the diff upholds.

Testing

  • Fill in: the command run and its outcome.

Release Notes

  • N/A

Note

Consolidate path confinement and atomic writes into shared services

The repo had many local copies of path-confinement checks and temporary-file-then-rename write logic. This PR moves both into shared modules and migrates all callers.

  • Adds atomic.rs with write_atomic, which writes to an exclusive temporary file, preserves permissions, refuses symlink destinations, and renames over the target. CLI, TUI, manifest, bench, proof, adopt, deploy, and copy writers now delegate to it.
  • Adds typed Violation variants and is_plain_relative in confine.rs, replacing string errors and local canonicalize/prefix checks in plugin, deploy, dashboard, provenance, and adopt code.
  • The glossary and term machinery moved from a single Markdown glossary file to per-term generated pages backed by the ontology; lint rules now check undefined, draft, first-use, and legacy term links, and rune spec fix can rewrite links and create draft terms.
  • Many docs/changes directories and proof assets were renamed to plain-language names; the skills template schema frontmatter and section rules were tightened.
  • Behavioral Change: repos without an ontology no longer get term definitions from a glossary file (Terms::load and TermSource in terms.rs); rune spec glossary outputs a directory of pages; archive now refuses changes with draft or undefined term links (refuse_unsettled_terms in commands.rs); symlink destinations are now refused by write_atomic where previous callers allowed them.

Macroscope summarized eb6cec3.

Claude Fable 5.1 (claude-fable-5-1) and others added 3 commits October 18, 2026 20:21
… and archive refusal

A term is marked once per file by an emphasized link to its page under
docs/specs/glossary/, and the tag resolves to the page's address in the
ontology. The validator reports an undefined, draft, legacy, unemphasized,
or stale-page term, with delta twins. rune spec glossary writes one page
per term and an index and checks the bytes. rune spec fix adds draft terms
for unresolved links and rewrites the legacy italics form across a
repository. rune spec archive refuses a change that links to a draft or an
undefined term. The default name floor is four words. The three term-model
changes and the cli's own specifications and records carry the link form.

Co-Authored-By: Martin Zeman <N4M3Z@users.noreply.github.com>
…s, nothing archived

The 115 requirements of the seventeen later changes say what happens and
who does it (validator, assembler, generator, deployer, fixer, signer,
archiver), and every command, flag, hook id, and diagnostic moves into a
Commands table in each change's design. Two changes are new: specifications
in plain language, and edge cases that accompany specs with MUST, SHOULD,
and MAY as the keyword levels. The two delta specifications over 150 lines
split into five capabilities: the owner's key marks a draft ready, the
review scorecard admits the merge, every seal gets verified, the queue
holds signing requests, and a mutex protects signing. Review scorecard
replaces ledger in prose. Every change id and capability name has at least
four words, the four archived changes are active again, two empty
templates are gone, and the init skill schema matches the deck's.

Co-Authored-By: Martin Zeman <N4M3Z@users.noreply.github.com>
Adopt, deploy, and doctor share the hardened confinement walk that refuses
symlink escapes, parent segments, and absolute paths outside the root. Every
writer that replaces an existing file goes through the atomic write, the
review record and the bench writers included. Closes the last two tasks of
the cross-vendor review fixes.

Co-Authored-By: Martin Zeman <N4M3Z@users.noreply.github.com>
@github-actions github-actions Bot added size:xlarge auto: changed-lines bucket area:docs auto: documentation and markdown area:schemas auto: mdschema files labels Oct 18, 2026
@github-actions

Copy link
Copy Markdown

review/correctness stood down on eb6cec35: free lanes only: deterministic check quality is pending on this head. Apply review:runeseer to force a paid round.

@N4M3Z
N4M3Z merged commit eb6cec3 into main Oct 18, 2026
28 of 30 checks passed
@N4M3Z
N4M3Z deleted the fable/spec-roles branch October 18, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs auto: documentation and markdown area:schemas auto: mdschema files size:xlarge auto: changed-lines bucket

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant