Repository navigation
feat(structure): commits carry a map of what they contain (STR-02b) - #166
Merged
Merged
Conversation
added 8 commits
September 26, 2026 22:53
Split from STR-02. The committed map must come from the staged snapshot; today the hook stages the working-tree map, which carries untracked and unstaged content into commits.
…ndex (STR-02b T04)
… the index-built map (STR-02b T06)
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.
Implements spec
.frame/specs/str-02b-commit-map-publication/(tasks T01–T06). Per-task detail and deviations are in itsoutcome.md.Why — a leak
The pre-commit hook staged the on-disk STRUCTURE.json, which STR-01/STR-02 keep as the working-tree view, untracked files included. Verified in a scratch repository: after committing an unrelated change, the committed map contained an untracked
private-notes.mdwith its first heading as the description. STR-02 made this continuous.What changes
update-structure.js --staged(scripts/structure-commit.js): builds the commit's map from the effective index (GIT_INDEX_FILE, pathspec commits, linked worktrees, unborn HEAD) and publishes it into the index only. The index is read throughls-files -s -z/cat-file --batchas a small read-only fs, so STR-01 discovery and generation run unchanged. Publication rechecks the index hash and usesupdate-index --cacheinfounder Git's own lock; a map path that is ignored or under local sharing is never force-added. The working map is never written. Results go to.frame/runtime/structure/commit.json.--stagedand nevergit add. The hooks directory is resolved with Git (linked worktrees used to fail). An unmodified earlier Frame template is upgraded on init and on open, recognized by SHA-256 of every template ever shipped. Husky, lefthook,core.hooksPathfolders and edited hooks are never touched — they get instructions.check-freshnessreports hooks still running the old--changed+git addsnippet, and commits whose map could not be staged..githooks/pre-commitnow runs--stagedon every commit; this PR's last commit already used it.Decisions (asked during planning)
.frame/STRUCTURE.json(agents read it directly). Accepted costs, documented:git statusshows the map as modified while the two views differ, and--no-verifyskips the hook..frame/bin/).Also note
scripts/structure-snapshot.js(outside the planned footprint) lets the extraction cache parse from the index, so identical content is not re-extracted across views.Verification
npm test: 1089/1089.