Skip to content

STR-02c: working-tree map in runtime - #167

Merged
kaanozhan merged 8 commits into
mainfrom
feat/str-02c-working-view-in-runtime
Sep 30, 2026
Merged

kaanozhan merged 8 commits into
mainfrom
feat/str-02c-working-view-in-runtime

Conversation

@kaanozhan

Copy link
Copy Markdown
Owner

Reverses STR-02b D1. While the tracked .frame/STRUCTURE.json held the working-tree view, it differed from the committed map, and Git refused checkout/switch/pull.

What changes

  • Two views. The live working-tree view lives in .frame/runtime/structure/working.json (never committed). The tracked STRUCTURE.json is the committed view plus prose edits, and is the generation prior for the live view (D1, D2). --full, explicit files and --check operate on the live view (D3).
  • Untracked maps (no Git, local sharing, before the first commit) keep mirroring the live view (D5).
  • Commit side. The hook stages the index-built map and writes the same bytes to disk, so git status stays clean after a commit. A file with unstaged edits is never overwritten. The worker repairs the stale index a pathspec commit leaves behind (D6). --changed is now the same as --staged, so old --changed + git add snippets work; that check-freshness finding is gone (D7).
  • Loss-free upgrade. A tracked map that differs from the index only in generated content (compared with the new authoredView) is archived to recovery/ and restored. Hand edits are kept, and check-freshness reports them (D8).
  • Readers. find-module, module-hint, check-freshness and frameStore.getStructure read the live view first (D9). AGENTS/REFERENCE/QUICKSTART wording is updated. The STR-02b hook template's hash is added to the upgradable list.

Tests

npm test: 1109 passing. New real-repository tests cover switch/checkout/pull with live untracked and unstaged work, a clean map after a normal commit, pathspec repair, an old snippet, the upgrade (restored or kept), and working-first readers.

Also checked on this repo: structure-lifecycle.js --once restored the tracked map (old bytes archived), and git status is clean for it.

Spec: .frame/specs/str-02c-working-view-in-runtime/

@kaanozhan
kaanozhan merged commit 262f91b into main Sep 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant