Repository navigation
feat(tools): say when the Ix architecture map is stale - #36
Merged
Merged
Conversation
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>
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.
What
ix-subsystemsandix-mapnow say when the Ix architecture map is stale, in one line under the heading: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._diagnostic code=map_stalerecord 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.map_stale === true(plusregions_as_ofwhen it is there) adds the same line. This includes the "No subsystems found" case.ix subsystemscalls ([scope]and--list) can report it. The tool says it once and prefers whichever call names the map.ix statsdoesn't read regions, so it isn't checked.New helper:
runtime/map-stale.ts. It never throws. Anything other thanmap_stale === truecounts as not stale, and a malformedregions_as_ofis ignored.parseIxErrordoesn't treat adiagnosticrecord 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:regions_as_of, stale without it, and fresh, for both the JSON and llm paths of ix-subsystems--listcall reporting stale, with the call that names the map preferred, and with a scope and stats offtests/map-stale.test.ts: unit tests for parsing, including malformed or missing fields.tests/fixtures/ix-v0.12.0/synthetic/subsystems*-stale*, which are thesuccess/captures with the #880 keys/record added. They are described in the fixtures README.bun run typecheckis clean, andbun testgives 353 pass, 11 skip (the live suite), 0 fail.🤖 Generated with Claude Code