Skip to content

feat: stable identity map — ownership sidecar, archify locate, drilldown bundles - #367

Draft
tt-a1i wants to merge 17 commits into
mainfrom
feature/identity-map
Draft

feat: stable identity map — ownership sidecar, archify locate, drilldown bundles#367
tt-a1i wants to merge 17 commits into
mainfrom
feature/identity-map

Conversation

@tt-a1i

@tt-a1i tt-a1i commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Problem and behavior

This draft lets an author attach repository-path ownership to diagram components, classify a Git change range against that map, and navigate from an overview into manifest-bound child diagrams. It reports unclaimed and ambiguous paths explicitly. It does not infer runtime impact, recommend review order, or decide whether a PR should merge.

The recovery candidate is cc1b33a7a02351347842dad4ebe9c13278afc166, based on main 6db72a9. The original mixed checkout and index were preserved; all integration was performed in a separate worktree. This PR remains draft and unmerged.

Implementation and compatibility

  • Ownership classification keeps explicit exclusions, ambiguous matches and uncovered paths distinct. Empty-segment/brace subset counterexamples, Unicode paths, genuine Git symlink/gitlink entries and divergent endpoint trees have executable regressions.
  • Locate validates its receipt and HTML, names missing/invalid map fields with repair suggestions, and preserves earlier outputs on failure. Newly added and renamed maps receive explicit comparison states; comparison failure remains supplemental to the Locate receipt. Import observations remain authored facts, not inferred topology.
  • Bundle delivery reuses canonical validation and manifest-bound filenames, including custom sidecars. A moved output directory remains usable after the source is removed. Missing required bundle inputs fail closed; ordinary Locate can omit optional child details while preserving the parent classification.
  • Viewer changes are maintained in modular source. Backspace follows the Escape dismissal/return ladder only in active or nested drilldown. Ordinary pages do not register bundle message listeners; a real nested child still handshakes without its own embedded manifest. Offline messaging keeps source-window, role, payload, ID and digest validation.
  • Projection state and count badges are removed from export clones without changing live interaction state. The ordinary HTML wrapper changes, so HTML byte identity is not promised; all SVG bytes in the final regenerated examples/cases stayed unchanged.
  • README/reference updates document lint ownership semantics, manifest failures and the distinction between requesting descent and a completed child handshake. The named source-string test was replaced with actual receipt assertions. The recovered decision record is historical; six named stale references now use verified fixed-revision symbols.

Broad exclusion presets, a receipt-only output redesign, extra uncovered widgets, an inference engine and automatic PR comments are not included. The reasons and original requirement mapping are in the disposition record.

Validation

  • Final handoff contract checks: 44 passed, zero failed/skipped. They include public CLI field failures preserving previous files, import endpoint attribution, optional child ownership and unsupported comparison types.
  • Final real-browser message/navigation checks: 6 passed, zero skipped, using Chrome 153.0.8010.36. These cover a genuine cross-origin OOPIF, native Tab leaving the frame, ordinary keyboard behavior, child focus-clear/return, repeated navigation, malformed messages, changed child identity, unsafe URLs with no request, and deletion after parent load.
  • Earlier real-browser acceptance also verifies moved-directory child projection after deleting the source and clean SVG export while preserving live state.
  • Packaged/development examples, Gallery, Checkout comparison, pinned MCO artifacts and README animation were regenerated. The official Node 22.23.2 ZIP contains 93 entries; only the expected template/examples, Locate CLI and two reference documents changed from the previous archive. generate-viewer --check, actionlint and diff checks pass.
  • Full local tests on product commit 0e38aa9: 1,489 total, 1,437 passed, zero failed, 52 skipped; tracked source hashes stayed unchanged. The final delta changes only the Motion Governor browser test and repository acceptance prose. Its focused Chrome 153 / Node 22 run passed 9/9 without skips; all hosted CI gates passed on this head in run 34685055776, including the complete Viewer interaction and bundle/portable-output/export suites. After d83f5ce still failed a real file reload, controlled Linux runs reproduced storage loss from a pre-initialization diagnostic read even in equally large script-free HTML. Without that read, generated Viewers and padded controls retained all twenty reloads per condition. The test removes the interfering diagnostic probe; it retains actual storage-value and Governor-mode assertions on five real file reloads and five same-origin HTTP navigations, plus existing reduced-motion/suspension/storage-error coverage. The acceptance record links both controlled runs and preserves earlier failures. No product storage workaround or specific Chromium internal mechanism is claimed.

Recovered evidence and limits

The experiment directories are offline research assets, not shipped Skill code. Most added lines in the recovery packages are fixed JSON observations and inert historical scoring inputs:

  • Fixed boundary replay: 75 observations and six actual CLI runs, including known bad behavior. An independent run produced identical JSON. Six original external map/sidecar files are retained verbatim; the unadopted presets revision is available on an archive branch.
  • First-look recovery: 30 original answers, 15 static ground truths and 180 independent metric checks. Main-sample P@3 is 0.767 without Locate and 0.700 with it; all-15 P@3 is 0.711 and 0.644. One model, one trial per condition and non-blind experimenter ground truth do not establish human review benefit. Complete prompts and noise labels are not all recoverable.
  • E3 recovery: the 100-step replay matches old JSON byte for byte. Nine commits trigger ten scheduled manual edits; that is not measured maintenance time. The recovered script's 61-anchor selection differs from the report's 67-anchor selection; both are retained, and the recorded report coordinates independently reproduce its complete observations.

No new model or simulated human study was performed. The author's Discussions #368 and #369 were corrected to state these evidence and availability boundaries. Separately reproduced main defects are isolated in #396 (renderer diagnostics), #397 (explicit straight routes) and existing #373 (finite SVG attributes); they are not bundled into this feature. Related nested-reading work #280/#281 is not closed or approved by this PR.

Add a component ownership sidecar (<stem>.ownership.json, validated by
ownership.schema.json) and a pure-computation `archify locate` command
that classifies every path in a git range as touched / uncovered /
ambiguous / excluded and every component as touched / untouched / stale.

- No LLM, no inference, no map edits; ambiguity is reported, never
  resolved by implicit glob precedence. `--lint` turns ambiguity into an
  authoring-time failure and reports uncovered as advisory only.
- Receipt (locate-receipt.schema.json) is deterministic: stable code
  point sort, no timestamps, no absolute paths, 40-char SHAs, sha256 of
  map and sidecar. Two runs are byte-identical.
- Renames via `git diff --name-status -M -z`; both sides recorded and a
  moved_between_components fact emitted when owners differ.
- `--facts` attaches import-edge observations; endpoints outside any
  component are `componentId: null`, never dropped.
- When the map itself changed in the range, `archify compare` runs as a
  child process under <out>/compare/ and is linked from mapDelta; the
  locate exit code is independent of the comparison.
- Delta `navigation` field group classifies a changed `drilldown` target
  as `navigation-changed` rather than `changed` or `moved`.
- SVG annotation helpers extracted from architecture-delta.mjs into
  delta/svg-annotate.mjs and shared with the locate HTML.

Tests: archify/test/{locate,locate-glob,locate-html,locate-bundle,
ownership,architecture-delta,generate-validators}.test.mjs. Full suite
1170 tests / 1133 pass / 0 fail / 37 skipped on Node 26; Node 22 package
gates 18 pass. check:validators clean.
…iewer

Add `archify bundle <dir> [--check]`: one entry diagram plus up to twelve
same-directory children of any diagram type, bound by manifest.json
(bundle.schema.json) using diagram ids and two sha256 digests
(spec_sha256 for the runtime handshake, artifact_sha256 for offline
validation). Depth is fixed at two; each level keeps the 12-node cap.

- Architecture components may declare an optional `drilldown: <child id>`
  (schema addition, pending maintainer sign-off). The renderer draws the
  mark into the SVG so it survives canonical export.
- Viewer descends in place: parent SVG is hidden, never transformed;
  breadcrumb + 96px silhouette; child opens in a same-directory iframe;
  Esc/Backspace/breadcrumb ascend and restore scroll. Parent geometry is
  unchanged by construction (drilldown-browser.test.mjs verifies pixels).
- Handshake: hello/ack over postMessage with unconditional event.source
  check and shape validation; id/sha mismatch, unsafe filename, or a
  1200 ms timeout shows an explicit stale card (built with textContent,
  strings via i18n) instead of rendering the child.
- validateBundle runs derived-count checks (manifest schema first,
  fail-closed), including the shared child-ownership subset rule from
  locate/ownership.mjs. Required <entryId>.ownership.json; no directory
  order dependence.
- Locate projection pass-through: `locate --bundle` embeds component and
  child node states; parent chip "N FILES TOUCHED INSIDE" hidden at zero;
  stale gets a distinct non-green treatment.
- Bundle render flags are parsed once at the renderer CLI entry and
  passed explicitly; svgRootAttrs no longer reads process.argv.
- Drilldown runtime exposed as pure functions on Archify.drilldown and
  unit-tested in node:vm; CI webm-artifact job runs the Chrome test.

Tests: bundle-{schema,manifest,validate,ownership}, drilldown-{mark,
viewer,stale,locate,browser}, svg-root-attrs, cli, i18n. Full suite
1170 / 1133 pass / 0 fail; Chrome tests 12/12; actionlint clean except
pre-existing SC2016 in release.yml.
…eriments

- docs/decisions/identity-map-2026-09-09.md: drilldown contract, ownership
  sidecar spec, locate receipt format, diagnostic codes, "what we do not
  do", E1/E3 raw numbers, PR #269/#281 gap assessment, schema changes
  pending sign-off, code-vs-draft divergences, open questions. Every
  decision cites path:line.
- E3 (100-commit replay of a hand-written self-map): 9/100 commits needed
  a map edit, 0 ambiguous, uncovered returns to 0; sources line anchors
  decayed 68.7% over the same range. E1: 8/50 fix commits structural
  (16%), supporting "orientation", not defect-finding, wording.
- docs/cases/archify-self/: ten-component self-map, two children
  (architecture + workflow), sidecars, manifest, receipts for PR #256 and
  PR #352 (regenerable; only receipts are kept), README with commands.
- archify/references/{locate,drilldown-bundles}.md; SKILL.md fast path
  unchanged. CHANGELOG entry; one-clause ROADMAP note that the diagram
  diff stance still holds.
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

archify/assets/template.html gained the drilldown runtime and locate
projection styles, so every artifact that embeds the template is
rebuilt per CONTRIBUTING:

- archify.zip via scripts/build-zip.sh on Node 22.23.2
  (1,959,997 bytes, +82,567 vs origin/main)
- packaged and root examples/*.html goldens, checkout-platform-delta
  html + receipt (compare embeds two explorers)
- docs/gallery via scripts/build-gallery.mjs (11 artifacts / 99 checks)
- docs/cases/mco-runtime.architecture.html and
  experiments/mco-showcase/mco-runtime.html (byte-repro against mco
  @ 9f1a1cf)
- docs/assets/archify-live-proof.{gif,json}: readme-showcase.test.mjs
  pins the gallery artifact sha256 into the receipt, forcing the rebuild

No SVG geometry changes in any golden; diffs are viewer chrome only.
@tt-a1i
tt-a1i force-pushed the feature/identity-map branch from 75ba6d4 to be5fd7c Compare September 8, 2026 20:01
CI's headless Chrome caught a refit on ascend: the first implementation
hid the entry SVG with display:none, so it left layout, the adaptive
reader re-measured the canvas as overflowing on reveal and shrank
--archify-reader-width from 1376px to 960px, scaling every node box by
0.691. Reproduced at 1440x900 with the test's 240px canvas pinch.

The entry SVG now stays in flow with visibility:hidden while the child
is overlaid, and the reader/viewer-chrome measurers are frozen while
data-drilldown-level is set, so no fit runs at all. drilldown-browser
asserts pixel-identical node boxes at 1440x900 and 800x600 with a child
taller than the parent canvas.

Decision record §3.7 and the drilldown reference describe the mechanism
and why. Goldens, gallery, MCO artifacts and README GIF rebuilt for the
template change. npm test: 1170 / 1133 pass / 0 fail / 37 skipped.
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