Skip to content

Fix gaps from an end-to-end map run; add map mode, source and carried entries - #45

Merged
DeanOuY merged 4 commits into
mainfrom
fix/trial-bugs
Nov 23, 2026
Merged

DeanOuY merged 4 commits into
mainfrom
fix/trial-bugs

Conversation

@DeanOuY

@DeanOuY DeanOuY commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Summary

An end-to-end run (map a project, keep the map with a spec, then review a change) turned up gaps in genesis map. This PR fixes them. It also adds what another tool needs to rely on a map: what kind of map it is, which code it was read from, and a way to start a review from a committed map.

Fixes

  • One exclusion rule. Capture, the other-language count, source paths and map size all use the same rule. Changed files in .genesis/ or in --exclude folders are counted by folder. Changed files in dependency, build or cache folders stay listed, with the reason they were not analyzed.
  • map size takes --exclude and the other options prepare uses to choose files, and it picks the same engine.
  • Entry triggers. A step that carries an entry anchor takes no range anchors from the lines leading into the entry, so a dispatcher's code is no longer pulled into the entry's flow.
  • unittest setUp/asyncSetUp. A single unconditional assignment there counts like one in __init__, so a test reaches the code its set-up object runs.
  • Shared explanations. summary.md and graph.html print an explanation shared by several changes at one place only once.

Map and review contract

  • mode (map | change) in business-map.json says whether the file is a project map or a review map. Older files have no mode; read a missing one as unknown.
  • source records the code the map was read from: revision, worktree_dirty, integrity_status (complete | partial), and files, a SHA-256 per file of the bytes as revision stores them (git show <revision>:<path>). Every file the map cites must be listed. It is attached at render. view.html and view.share.html leave it out.
  • Risks on files Genesis did not analyze. A risk names change_ids, paths (changed files listed under unanalyzed_changes), or both. Accepted risks can be withdrawn by id with withdrawn_risks. A risk whose files a later prepare leaves out is named by the risks_not_shown limitation, not dropped.
  • Carried entries and flows. A Python change review starts from the entries the latest map proposed and the way it grouped entries into flows. With map prepare --entries-from <business-map.json> it starts from a named map instead, such as one committed with a spec, so every clone gets the same flows. A change that removes a carried entry shows the map's flow as removed. The agent engine refuses --entries-from.

Worktree comparison

  • worktree_dirty and the list of changed files no longer flag a clean checkout whose line endings, ident or encoding Git converts. Files whose raw bytes differ from the commit go to one git hash-object --stdin-paths call with every filter driver switched off, and the user's own core.autocrlf is honored. A file counts as unchanged only if a second read finds the same bytes, inode and times.
  • Files Git is told not to check (assume-unchanged, core.ignoreStat) are compared by their bytes.
  • Untracked files in a dependency, build or cache folder that holds no tracked file are counted by folder (untracked_by_folder, and the untracked_files_by_folder limitation), so a virtual environment no longer crowds the change's own files out of the list.

Known limits, unchanged

  • diff-index does not list a changed assume-unchanged file outside the capture, as with git status.
  • An edit that only changes line endings under conversion counts as unchanged, as with git add.
  • In two rare combinations a removed flow gets an id of its own rather than the map's id.

Checks

  • pytest: 613 passed.
  • ruff check, ruff format --check, check_public_boundary.py and check_packages.py pass, and both wheels build.
  • build_map_fixtures.py leaves no diff.
  • Viewer: node --test (65), eslint, tsc -b and vite build pass, and the built page is byte-identical to the committed assets/viewer/index.html.
  • One synthetic end-to-end review: map, commit the map, change, prepare --entries-from, submit, withdraw a risk, render.

🤖 Generated with Claude Code

DeanOuY and others added 4 commits November 22, 2026 23:55
- One exclusion rule decides what every capture leaves out, and the
  other-language count, source paths and `map size` use it. Changed
  files in `.genesis/` or in folders passed to `--exclude` are counted
  by folder; changed files in other left-out folders stay listed.
- `map size` takes `--exclude` and the other options `prepare` uses to
  choose files, and picks the engine `prepare` picks.
- A step that carries an entry anchor takes no range anchors from the
  lines that lead into the entry, so the code that dispatches to an
  entry is not pulled into its flow.
- A single unconditional assignment in unittest `setUp` or `asyncSetUp`
  counts like one in `__init__`, so a test reaches the code its set-up
  object runs.
- `summary.md` and `graph.html` print an explanation shared by changes
  at one place once.
- `business-map.json` says whether it is a project map or a review map
  (`mode`) and records the code it was read from (`source`: revision,
  worktree_dirty, integrity_status and a digest per file).
- A risk may name changed files Genesis did not analyze (`paths`), and
  accepted risks can be withdrawn by id (`withdrawn_risks`).
- A Python change review starts from the entries and flows of the
  latest map that proposed entries, or of the map passed to
  `map prepare --entries-from`, so changes land on the flows the map
  showed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- `worktree_dirty` no longer flags a clean checkout whose line endings
  Git converted, including through the user's own `core.autocrlf`, or
  a file a filter driver converts while the index vouches for it.
  Filter drivers never run.
- `source.files` holds digests of the files as their commit stores
  them, read in one `cat-file --batch` call.
- The agent engine reports a committed file it did not read as removed.
- A business map without `mode` is of unknown kind; the field has no
  default.
- Entries a map gave one flow stay in one flow in the skeleton and the
  default plan, and a change that removes a carried entry shows its
  flow as removed.
- Changed and new files in dependency, build or cache folders say why
  they were not analyzed.
- A risk on a file a later `prepare` leaves out is named by the
  `risks_not_shown` limitation and listed by `diff`, not dropped.
- The exported JSON Schema requires a risk to name changes or files,
  and the view pages carry no `source`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Line endings count as converted only where the file's attributes and
  `core.autocrlf` make Git convert them.
- Files Git is told not to check (assume-unchanged, `core.ignoreStat`)
  are compared by their bytes; the index never vouches for them.
- A file restored while it is read is read again.
- Untracked files in a dependency, build or cache folder that holds no
  tracked file no longer crowd the changes out of the list, and changed
  tracked files come before new files when the list is cut.
- A flow that loses carried entries is shown removed once, with the id
  the map gave it.
- The latest map that grouped entries into one flow is carried even
  when it proposed no entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Replace the in-process copy of Git's line-ending rules with one
  `git hash-object --stdin-paths` call, filter drivers off. A file
  counts as unchanged only if a second read finds the same bytes,
  inode and times.
- Untracked files in a dependency, build or cache folder that holds no
  tracked file are counted by folder (`untracked_by_folder` and the
  `untracked_files_by_folder` limitation) instead of being dropped.
- A removed flow shows an agent-proposed entry as the map had it.
- The skill and the usage docs say how moved carried entries and new
  files in such folders are reported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DeanOuY
DeanOuY merged commit 9c0c914 into main Nov 23, 2026
4 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