codechart 0.7.0 → 0.8.0

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
@@ -2,6 +2,25 @@
2
2
 
3
3
  What's new in each codechart release. Update with `codechart update`; the [releases page](https://github.com/freeleex/codechart/releases) has the same notes.
4
4
 
5
+ ## 0.8.0 (2026-11-08)
6
+
7
+ ### New
8
+
9
+ - Business map: ask your agent for a plain-words page of a change for a product owner with no repo access: journeys today and after, rules before and after, saved data, questions.
10
+ - The owner answers, says Yes or No to the agent's guesses, adds notes and presses *Send back to developer*, even days later; paste the text to your agent.
11
+ - Review on the page: comment on any node, diff line or arrow, ask a question or ask for a deletion. *Finish review* copies your notes; paste them into your agent chat.
12
+ - Review in the terminal: `codechart review` opens the map in your editor as a diff. Write notes under any line, save, and tell your agent "review done".
13
+ - Plan vs built: when the work is done, the summary is compared with the saved plan. What was dropped, added or built differently is marked, each with the agent's reason.
14
+ - `codechart render --tech <spec.json>` names the technical map a business map links to; `codechart schema --business` prints the business map format.
15
+
16
+ ### Fixed
17
+
18
+ - Plan vs built no longer compares an old plan with later, unrelated summaries on the same branch.
19
+
20
+ ### Changed
21
+
22
+ - README is shorter, with a features table; details moved to pages under [docs](https://github.com/freeleex/codechart/tree/main/docs).
23
+
5
24
  ## 0.7.0 (2026-11-06)
6
25
 
7
26
  ### New
package/README.md CHANGED
@@ -14,7 +14,7 @@
14
14
  </p>
15
15
 
16
16
  <p align="center">
17
- <a href="#install">Install</a> · <a href="#what-you-get">What you get</a> · <a href="#why-you-can-trust-the-diagram">Trust</a> · <a href="#cost">Cost</a> · <a href="docs/configuration.md">Configure</a> · <a href="docs/README.md">Docs</a>
17
+ <a href="#install">Install</a> · <a href="#features">Features</a> · <a href="#why-you-can-trust-the-diagram">Trust</a> · <a href="#cost">Cost</a> · <a href="docs/configuration.md">Configure</a> · <a href="docs/README.md">Docs</a>
18
18
  </p>
19
19
 
20
20
  <p align="center">
@@ -85,116 +85,138 @@ That's it. Open your coding agent in any repo and try:
85
85
  > show me the flow of accepting an invite
86
86
  ```
87
87
 
88
- Works with Claude Code, Codex, Gemini CLI, GitHub Copilot, Cursor, OpenCode and any other agent that supports [Agent Skills](https://agentskills.io). `install-skill` asks which agents get the skill, and adds a reminder line, a Claude Code hook and an OpenCode plugin so agents don't forget it in long sessions. `codechart update` brings everything up to date (what changed: [CHANGELOG.md](CHANGELOG.md)), and codechart tells you once a day when there's a new version. No diagram appeared? `codechart doctor` checks the setup (`--fix` repairs it, `--last` explains the last turn). Details, other agents, updating and uninstalling: [Install and agents](docs/install.md).
88
+ Works with Claude Code, Codex, Gemini CLI, GitHub Copilot, Cursor, OpenCode and any other agent that supports [Agent Skills](https://agentskills.io). Reminders that keep agents using it, updating, `codechart doctor` when no diagram appears, and uninstalling: [Install and agents](docs/install.md).
89
89
 
90
- ## What you get
90
+ ## Features
91
91
 
92
- ### Flows: what the code actually does
92
+ <table>
93
+ <tr>
94
+ <td width="46%" valign="middle">
93
95
 
94
- Ask "how does this work?", "what are the edge cases?" or "walk me through the logic" and you get a **flow**: decisions, edge cases and outcomes, drawn only if the agent saw them in the code. Branches it didn't verify go under `gaps` instead of being drawn.
96
+ ### Flows
95
97
 
96
- **Flow** _(key: + new ~ changed ? planned ◇ decision ⤷ shared step)_
97
- ```text
98
- Accept a team invite
99
- ────────────────────
100
- +look up invite by token
101
- ◇ +invite found?
102
- ├─ no → +404 invite not found
103
- └─ yes → ◇ +expired?
104
- ├─ yes → +410 invite expired
105
- └─ no → ◇ +already a member?
106
- ├─ yes → +return already a member
107
- └─ no → +save membership → +return joined
108
-
109
- 9 steps · 9 new · 0 changed · 0 planned · ✓ 15 anchors checked
110
- gaps: did not check what happens when two requests accept the same invite at
111
- once
112
- ```
98
+ Ask how something works and get its decisions, edge cases and outcomes as a flow. Every step is tied to a real line of code; click one on the page to see it.
113
99
 
114
- Every step and branch is anchored to a `file:line` or a quoted line, and the render fails if the line doesn't exist. On the full page, clicking a step shows the exact code behind it and each branch:
100
+ More: [Flows](docs/flows.md)
115
101
 
116
- ![Full flow page: the clicked decision shows its source line and the code behind each branch](docs/images/flow.png)
102
+ </td>
103
+ <td width="54%" valign="middle"><img src="docs/images/flow.gif" alt="On the flow page, clicking a decision step shows its source line and the code behind each branch, then a second step is clicked"></td>
104
+ </tr>
105
+ <tr>
106
+ <td width="46%" valign="middle">
117
107
 
118
- ### Plans: Now and After, side by side
108
+ ### Plans: Now and After
119
109
 
120
- Maps and flows work for **plans** too, so you can catch a wrong design before any code exists. A plan that touches existing code opens as **Now** and **After plan**: same positions in both panes, panning together (the header's *Panes: linked* toggle sets them free). What the plan removes is red in Now; what it adds is green (maps) or dashed (flows).
110
+ A plan that touches existing code opens as two panes side by side. What it removes is red in Now; what it adds is green in After.
121
111
 
122
- ![Plan map: Now pane with the removed env var in red, After pane with the new table and migration in green](docs/images/plan-map.png)
112
+ More: [Plans](docs/plans.md)
123
113
 
124
- A plan that changes existing behaviour gets the same treatment as a flow — the dropped branch red on the left, the planned one dashed on the right:
114
+ </td>
115
+ <td width="54%" valign="middle"><img src="docs/images/plan-map.png" alt="Plan map: Now pane with the removed env var in red, After pane with the new table and migration in green"></td>
116
+ </tr>
117
+ <tr>
118
+ <td width="46%" valign="middle">
125
119
 
126
- ![Plan flow: Now pane with the branch the plan removes in red, After pane with the planned revoked? decision dashed](docs/images/plan-flow.png)
120
+ ### Plan vs built
127
121
 
128
- ### Infrastructure maps
122
+ When the work is done, the summary is compared with the plan. What was dropped, added or built differently is marked, each with the agent's reason.
129
123
 
130
- Terraform, OpenTofu, Helm, Kustomize and Kubernetes changes get a map of resources, modules and what they reference — built in, no rule to write:
124
+ More: [Plan vs built](docs/plans.md#plan-vs-built)
131
125
 
132
- **Map** _(key: + new ~ changed - removed ◆ config · unmarked = unchanged)_
133
- ```diff
134
- storage
135
- + aws_s3_bucket.logs
136
- + aws_s3_bucket_lifecycle_c… ─bucket──────────▶ aws_s3_bucket.logs
137
- ─expiration.days─▶ var.log_retention_days
126
+ </td>
127
+ <td width="54%" valign="middle"><img src="docs/images/plan-vs-built.gif" alt="The header's differences-from-the-plan link opens the list; clicking an item shows its plan-vs-built box with the agent's reason, and a dashed NOT BUILT box marks what was planned but not built"></td>
128
+ </tr>
129
+ <tr>
130
+ <td width="46%" valign="middle">
138
131
 
139
- network
140
- ~ aws_lb.api ─access_logs.bucket─▶ aws_s3_bucket.logs
141
- ─subnets────────────▶ module.vpc
132
+ ### Infrastructure
142
133
 
143
- config
144
- ◆ var.log_retention_days
134
+ Terraform, OpenTofu, Helm, Kustomize and Kubernetes changes get a map of resources and what they reference. Built in, no rule to write.
145
135
 
146
- 5 nodes · 2 new · 1 changed · 1 config · ✓ 5 checked
147
- gaps: terraform plan not run · module.vpc internals not read
148
- ```
136
+ More: [Infrastructure maps](docs/infrastructure.md)
137
+
138
+ </td>
139
+ <td width="54%" valign="middle"><img src="docs/images/infra.png" alt="Infrastructure map in light theme: the changed load balancer shows its Terraform diff and new access_logs attributes"></td>
140
+ </tr>
141
+ <tr>
142
+ <td width="46%" valign="middle">
143
+
144
+ ### Review on the page
145
+
146
+ Comment on any node, line or arrow, ask a question, or ask for a deletion. *Finish review* copies your notes; paste them into your agent chat.
147
+
148
+ More: [Review on the page](docs/review.md#on-the-page)
149
149
 
150
- On the full page, a changed resource shows its HCL diff and changed attributes (light theme here; every page has light, dark and auto):
150
+ </td>
151
+ <td width="54%" valign="middle"><img src="docs/images/page-review.gif" alt="On the map page the user adds a comment under a new line and a delete note under a removed line, clicks Finish review, then Copy and close, and the sent notes turn dimmed"></td>
152
+ </tr>
153
+ <tr>
154
+ <td width="46%" valign="middle">
151
155
 
152
- ![Infrastructure map in light theme: the changed load balancer shows its Terraform diff and new access_logs attributes](docs/images/infra.png)
156
+ ### Review in the terminal
153
157
 
154
- ### Terminal first, page when it helps
158
+ `codechart review` opens the map in your editor as a diff. Write notes under any line, save, and tell your agent "review done".
155
159
 
156
- Small diagrams stay in the reply. Big ones also get a self-contained HTML page: zoom, pan, light and dark themes, a node panel with back/forward through the nodes you opened and a *Used by* / *Uses* list of the node's links (selecting a node dims all but it and its neighbours; Esc clears), a row of status chips under the header that count, explain and fade nodes (*Δ changes only* hides the context), nothing loaded from the internet. In a change summary, a node's diff is read from git when the page is built, so the agent spends no tokens on it (lockfiles, minified bundles, `dist/` and files marked `linguist-generated` are skipped). Each node's panel shows the whole diff (up to 1000 lines per file) as foldable hunks in a GitHub-style layout (full-row red/green tints, line numbers, long unchanged runs collapsed into a click-to-open row), a tickbox left of the panel title to mark the node reviewed (*7/12 reviewed* in that row, *Next unreviewed*; a tick lasts until the node's diff changes) a pager bar (‹ 3 / 10 ›, *+ all* / *− all*) and keys: `n`/`p` hunks (open one, fold the rest; every hunk starts folded), `f` zoom to the selected node (also a ◎ button next to the panel's ← →; the selected node has a blue glow, so you can tell it from its lit neighbours), `]`/`[` unreviewed nodes, `r` reviewed, `o`/`O` fold, `?` help.
160
+ More: [Review in the terminal](docs/review.md#in-the-terminal)
161
+
162
+ </td>
163
+ <td width="54%" valign="middle"><img src="docs/images/console-review-short.gif" alt="codechart review opens the map's diffs in vim, the user writes a comment and a question under diff lines, saves, and codechart feedback --take prints them"></td>
164
+ </tr>
165
+ <tr>
166
+ <td width="46%" valign="middle">
157
167
 
158
168
  ### Maps in pull requests
159
169
 
160
- Reviewers get the map too. Turn it on once per repo (`codechart setup-pr-maps`, or ask your agent): it shows the CI file and asks before writing anything. From then on, PR and MR descriptions the agent writes end with a collapsed map, and CI redraws it on every push, so new ✗ flags appear when the code moves on. No AI or tokens in CI. [How it works and setup for GitHub and GitLab](docs/pr-maps.md).
170
+ PR and MR descriptions end with a collapsed map, and CI redraws it on every push. No AI or tokens in CI. Turn it on once per repo.
161
171
 
162
- ![PR description with the Map section open: check line, the map image, what was left out or not read, collapsed node details and the key](docs/images/pr-map.png)
172
+ More: [Maps in pull requests](docs/pr-maps.md)
163
173
 
164
- ### When it fires, and when it stays quiet
174
+ </td>
175
+ <td width="54%" valign="middle"><img src="docs/images/pr-map.png" alt="PR description with the Map section open: check line, the map image, what was left out or not read, collapsed node details and the key"></td>
176
+ </tr>
177
+ <tr>
178
+ <td width="46%" valign="middle">
165
179
 
166
- The skill fires when the agent summarizes a change, writes a plan or explains how code behaves. Built-in rules decide: migrations and models, infrastructure files, 3+ related files (map), 2+ decisions or edge cases (flow). One-file text, comment, formatting or version-bump changes are skipped. Your own rules in `.codechart.yaml` run first: [Configuration](docs/configuration.md).
180
+ ### Business map
167
181
 
168
- ## Why you can trust the diagram
182
+ On request, a plain-words page for a product owner with no repo access: journeys, rules, saved data and questions. They answer, confirm and send it back.
169
183
 
170
- - **The agent writes data, codechart draws.** LLMs misalign hand-drawn ASCII, so the agent only describes nodes and links as JSON. Layout is code.
171
- - **Map claims are checked.** Each node's file must exist, a quoted line must be in it, and in a change summary every new, changed or removed node must be in the git diff (`--git`, `--since <base>`, `--commit <sha>`). When everything matches, the footer says `✓ 10 checked`. When it doesn't, the output opens with the mismatch — straight from a render where the agent claimed an untouched table changed:
184
+ More: [Business map](docs/business-map.md)
172
185
 
173
- ```text
174
- ✗ 1 claim doesn't match the code: ~customers not in diff
175
- ```
186
+ </td>
187
+ <td width="54%" valign="middle"><img src="docs/images/business-map.png" alt="Business page: a journey with Now and After columns, rule cards, one dashed card asking for a yes or no, and a question with an answer box"></td>
188
+ </tr>
189
+ </table>
176
190
 
177
- The agent is told to fix its spec, or to keep the `✗` and own up when the change really differs from its summary. `--strict` turns mismatches into a non-zero exit.
178
- - **Nothing left off quietly.** With a diff, every changed file must sit under a node's path or be named in *Not on map* (lockfiles and generated files excepted), else `✗ 1 changed file not on map: src/x.ts`. A summary rendered without a diff says `diff not checked` instead of looking verified.
179
- - **Flows are anchored to real code.** Every step that exists in code names its `file:line` or quotes the line. If the line doesn't exist, the render fails and the agent has to fix it. For a commit that isn't checked out, `--at <rev>` reads anchors from that revision.
180
- - **Gaps are explicit.** Whatever the agent didn't read is listed under `gaps`, not guessed.
181
- - **Validated input.** Specs are checked against a schema, with clear errors the agent can act on.
191
+ ## The full page
182
192
 
183
- ## Cost
193
+ Big diagrams also get a self-contained HTML page: click a node for its summary and diff, read straight from git, tick nodes as reviewed, and move around with the keyboard. Nothing is loaded from the internet. More: [The full page](docs/page.md).
194
+
195
+ ## When it fires
196
+
197
+ When the agent summarizes a change, writes a plan or explains how code behaves: migrations and models, infrastructure, 3+ related files (map), 2+ decisions or edge cases (flow). One-file text, comment, formatting or version-bump changes are skipped. Your own rules run first: [Configuration](docs/configuration.md).
184
198
 
185
- A diagram is about **2–3 extra API calls**. In a long session that's roughly 2–3% of your usage per diagram, and nothing for trivial changes. That's an estimate from Claude Code sessions with Sonnet; other agents and models will differ, and shorter sessions pay proportionally more. Measured runs are in [docs/efficiency.md](docs/efficiency.md).
199
+ ## Why you can trust the diagram
200
+
201
+ - **The agent writes data, codechart draws.** Layout is code, not hand-drawn ASCII.
202
+ - **Claims are checked** against your files and the git diff: `✓ 10 checked`, or a `✗` that says what doesn't match.
203
+ - **Nothing left off quietly:** every changed file is on the map or listed as left out.
204
+ - **Flows are tied to real lines,** and whatever the agent didn't read is listed under `gaps`.
205
+
206
+ More: [Why you can trust the diagram](docs/trust.md).
207
+
208
+ ## Cost
186
209
 
187
- The CLI is small: a 112.2 kB package, 5 runtime dependencies, and a cold start around 150 ms.
210
+ A diagram is about **2–3 extra API calls**, roughly 2–3% of a long session's usage, and nothing for trivial changes. The CLI is a 158.4 kB package. Measured runs: [Efficiency](docs/efficiency.md).
188
211
 
189
212
  ## Safe to run
190
213
 
191
- - No telemetry, no shell: only read-only `git` and your OS opener. The only network calls are a once-a-day version check to npm, plus a read of the changelog from GitHub when there's a newer one ([off with one setting](docs/install.md#updating)) and opt-in [PR maps](docs/pr-maps.md), whose CI job edits the PR description and publishes the map image.
192
- - HTML pages load nothing external, all text is escaped, and they're saved to `~/.cache/codechart`, never to your repo. A summary page holds your diff: share it only where you'd share the diff.
214
+ - No telemetry, no shell, read-only `git`. Pages load nothing external and are saved to `~/.cache/codechart`, never to your repo. The only network calls: a daily version check, plus that version's changelog from GitHub when there's a newer one ([off with one setting](docs/install.md#updating)), and opt-in [PR maps](docs/pr-maps.md).
193
215
  - Audited before release across 8 areas, including untrusted repos and prompt-injected specs: [SECURITY.md](SECURITY.md) and [docs/security-review.md](docs/security-review.md).
194
216
 
195
217
  ## Configure
196
218
 
197
- Works with zero config. `codechart init` writes a commented `.codechart.yaml` for your own rules ("always map `app/models/**`", "draw a flow for API changes"), and `codechart config` shows what's in effect. Every key: [Configuration](docs/configuration.md). Every command: [CLI](docs/cli.md).
219
+ Works with zero config. `codechart init` writes a commented `.codechart.yaml` for your own rules, and `codechart config` shows what's in effect: [Configuration](docs/configuration.md), [CLI](docs/cli.md).
198
220
 
199
221
  ## FAQ
200
222