codebase-snapshot 0.9.5 → 0.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -21,6 +21,86 @@ Two versions exist on the registry that are not releases, and both are deprecate
21
21
  Deleting them requires account-level rights that the release pipeline does not have, so they are
22
22
  deprecated with an explanatory message instead. `latest` has pointed at 0.9.0 since it existed.
23
23
 
24
+ ## 0.9.7
25
+
26
+ ### The setup menu stops eating its own screen
27
+
28
+ Reported with a screenshot from a terminal about 70 columns wide: every keypress on `snapshot`'s
29
+ first question added another `◆ How should I set this up?` line, until 28 of them were piled above
30
+ the live menu.
31
+
32
+ The wizard repaints a prompt in place by moving the cursor up by the height of the last frame it
33
+ drew — and it counted that height in *lines*, while a terminal lays out *rows*. The recommended
34
+ answer carries the hint `node-lib · config · npm scripts · install · generate`, which makes that
35
+ line 83 cells wide. In a narrow terminal the terminal wrapped it into two rows itself, so the frame
36
+ was one row taller than the erase believed, and moving up one row short left the top of the old
37
+ frame behind. Every keypress. Notice that the leftover was always exactly one line: the question.
38
+
39
+ Frames are now wrapped to the visible width before they are drawn, so the height that is counted is
40
+ the height that is shown. Continuation lines keep their indent, a token longer than the line breaks
41
+ rather than overflowing it, and the width is re-read on every draw so a window that changed size is
42
+ measured as it is now rather than as it was. Two cells of slack are left for `◆ ❯ ◻ ←`, which some
43
+ fonts draw double-width.
44
+
45
+ No existing test could have caught this: every one of them pinned `columns` to 120, where nothing
46
+ wraps and the two counts agree. `tests/wizard-frame.test.js` drives the real wizard at 70, 60 and 50
47
+ columns, replays the escape sequences through a small terminal simulator, and asserts that the
48
+ screen shows one question rather than one per keypress. Putting the old arithmetic back turns three
49
+ of its seven tests red.
50
+
51
+ ### Install pins in the docs are now maintained, not remembered
52
+
53
+ `docs/mcp.md` told clients to run `codebase-snapshot@0.9.6` in four places that have to change at
54
+ every release, and a comment marker cannot live inside a JSON fence. `sync-docs` now rewrites any
55
+ `codebase-snapshot@x.y.z` pin and the `Added devDependency:` examples by shape, so the next release
56
+ cannot leave a copy-pasteable snippet pointing at an old version. `@latest` is untouched.
57
+
58
+ ## 0.9.6
59
+
60
+ ### It tells you when it is out of date
61
+
62
+ The tool's claim is that you can prove a thing is current, so it now asks that about itself. After
63
+ a command finishes, if a newer release is published, it says so on stderr:
64
+
65
+ ```
66
+ ↑ codebase-snapshot 0.9.6 is available — you have 0.9.5.
67
+ npm install -g codebase-snapshot
68
+ ```
69
+
70
+ The constraints matter more than the feature, because this is a network call in a tool people run
71
+ in CI and behind firewalls:
72
+
73
+ - **One GET, no identifier.** `registry.npmjs.org/codebase-snapshot/latest` and nothing else. The
74
+ registry learns that some machine ran this version; there is no telemetry, query string or install
75
+ id.
76
+ - **It never runs where it costs something.** Not when stdout is not a terminal, not in CI, not in
77
+ any `--format json` invocation, and never in `mcp` — the server still makes no outbound
78
+ connections at all, which `docs/mcp.md` promises.
79
+ - **It cannot break a command.** A 1.2 s cap, every failure returns null, and a cold cache is a miss
80
+ rather than an error. The request starts before the command and is awaited after it, so on real
81
+ work it overlaps entirely and adds no wall time.
82
+ - **One request per machine per day.** A 24 h cache holds the answer; a *failed* check is remembered
83
+ for one hour, so a single blip neither hides a release for a day nor retries on every run.
84
+ - **Off if you want.** `--no-update-check` or `CODEBASE_SNAPSHOT_NO_UPDATE_CHECK=1`.
85
+
86
+ ### A tool argument that arrived as a string is no longer rejected
87
+
88
+ Reported from a real client session: the same `snapshot_read` call worked through one code path and
89
+ failed through another because the client serialised `fromLine` as `"1"`. A digit string is the same
90
+ value in a different spelling, and the caller cannot fix what their client did — so numeric fields
91
+ now accept it.
92
+
93
+ This is not a loosening of validation: only fields the schema declares as numbers are converted, only
94
+ strings that parse to a finite number are converted, and `"ten"` still fails with the type message.
95
+ `"1.5"` for an integer field still fails too.
96
+
97
+ ### Also
98
+
99
+ - `--no-update-check` is scoped to the commands that can show the notice; it is not accepted by
100
+ `describe`, `skill` or `mcp`, whose scope would make it a flag that does nothing.
101
+ - The `describe` contract gained the option, and the contract-diff test keeps it in step with the
102
+ parser.
103
+
24
104
  ## 0.9.5
25
105
 
26
106
  ### Every question in the wizard is reversible
package/README.md CHANGED
@@ -188,6 +188,9 @@ to trust it.
188
188
  Exit codes: `0` success · `1` drift, refused generation, or nothing to snapshot · `2` usage error,
189
189
  or a first run with no terminal and no `--autopilot`.
190
190
 
191
+ Once a day it checks the npm registry for a newer release and mentions it on stderr — skipped in CI,
192
+ in any `--format json` run, and in `mcp`. Turn it off with `--no-update-check`.
193
+
191
194
  → [Full CLI reference](https://github.com/ankurhalder/codebase-snapshot/blob/main/docs/cli.md)
192
195
 
193
196
  ## For AI agents
@@ -197,7 +200,7 @@ Everything an agent needs is available as data, and the tool can install its own
197
200
  ```bash
198
201
  npx codebase-snapshot describe --format json # contract: workflow, options, exit codes
199
202
  npx codebase-snapshot skill --install # into .claude/skills + .cursor/rules
200
- npx -y codebase-snapshot@0.9.5 mcp # or serve it over MCP
203
+ npx -y codebase-snapshot@0.9.7 mcp # or serve it over MCP
201
204
  ```
202
205
 
203
206
  An agent told only "use `npx codebase-snapshot`" can read the contract, follow its ordered