Skip to content

feat(tools): say when the Ix architecture map is stale - #36

Merged
KageBinary merged 1 commit into
mainfrom
feat/show-map-stale
Oct 24, 2026
Merged

KageBinary merged 1 commit into
mainfrom
feat/show-map-stale

Conversation

@KageBinary

Copy link
Copy Markdown
Collaborator

What

ix-subsystems and ix-map now say when the Ix architecture map is stale, in one line under the heading:

## ix-subsystems

_Map is stale (regions as of map rev 7, 42 files); recent edits may not be reflected — a background refresh is running._

**11 subsystems** — 38 files, 2 levels
...

The parenthetical appears only when Ix gives regions_as_of. Otherwise the line is _Map is stale; recent edits may not be reflected — a background refresh is running._

  • ix-subsystems, llm path: a diagnostic code=map_stale record becomes the line, and the raw record is taken out of the body so it isn't said twice. The map rev and file count are read from the record's (map rev N, M files) message.
  • ix-subsystems, JSON path: top-level map_stale === true (plus regions_as_of when it is there) adds the same line. This includes the "No subsystems found" case.
  • ix-map: both of its ix subsystems calls ([scope] and --list) can report it. The tool says it once and prefers whichever call names the map. ix stats doesn't read regions, so it isn't checked.

New helper: runtime/map-stale.ts. It never throws. Anything other than map_stale === true counts as not stale, and a malformed regions_as_of is ignored. parseIxError doesn't treat a diagnostic record as an error (there's a test for this).

Why

Since Ix #841, automatic maps may put off recomputing the architecture map after edits. Region readers answer from the last map and refresh in the background. Until now these tools showed those counts as current. This mirrors the matching openclaw change.

Compatibility

This depends on Ix #880 emitting the field and record. With a fresh map, or any CLI from before #880, output is byte-for-byte what it is today, and the tests check that. Which commands run, runtime/automap.ts, error handling and exit behaviour are all unchanged. No version fields changed.

Tests

  • tests/success-fixtures.test.ts, new "a stale architecture map is said once" block:
    • stale with regions_as_of, stale without it, and fresh, for both the JSON and llm paths of ix-subsystems
    • ix-map stale and fresh, with the llm fast path allowed and not allowed (ix-map has no llm path)
    • ix-map with only the --list call reporting stale, with the call that names the map preferred, and with a scope and stats off
    • each stale case checks that removing the line gives exactly the fresh output
  • tests/map-stale.test.ts: unit tests for parsing, including malformed or missing fields.
  • Fixtures: tests/fixtures/ix-v0.12.0/synthetic/subsystems*-stale*, which are the success/ captures with the #880 keys/record added. They are described in the fixtures README.
  • Ran locally with Bun 1.4.2 (the CI version): bun run typecheck is clean, and bun test gives 353 pass, 11 skip (the live suite), 0 fail.

🤖 Generated with Claude Code

Since Ix #841 automatic maps may defer the architecture map after an edit,
and region readers answer from the last map while a background refresh
runs. Ix #880 reports this in machine output (JSON `map_stale` /
`regions_as_of`, llm `diagnostic code=map_stale`). ix-subsystems (llm and
JSON paths) and ix-map now turn it into one line under the heading, and
the llm path drops the raw record so it is not said twice. Without the
signal (fresh map, older CLI) output is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@KageBinary
KageBinary merged commit 7e626d2 into main Oct 24, 2026
7 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