You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fe248c2
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: .ai/typed-data-access.adf
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ ADF: 0.1
17
17
- billing_critical — writable only by the owning service plus its designated payment-webhook handler; never leaves the owning service boundary even via RPC (e.g., subscription, invoice)
18
18
- secrets — never leaves the owning service boundary under any circumstance (e.g., api_key)
19
19
20
-
⚠ CONSTRAINTS [load-bearing]:
20
+
⚠️ CONSTRAINTS [load-bearing]:
21
21
- New code referencing a business concept MUST check the canonical registry first; terms not in the registry or its aliases MUST be added before the code lands
22
22
- Non-owning services reading or writing `cross_service_rpc` concepts MUST use the declared accessor — raw storage access to another service's table is a violation
23
23
- `pii_scoped` access requires an audit-log entry at the call site — no silent reads
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,8 @@ The format is based on Keep a Changelog and follows Semantic Versioning.
8
8
9
9
### Changed
10
10
11
+
- **`charter adf fmt` keeps the emoji form of the standard `CONSTRAINTS`, `FILES` and `TOOLS` decorations** (`#351`). These are written with a U+FE0F variation selector (`⚠️`, `🗂️`, `🛠️`), as every Charter scaffold writes `⚠️ CONSTRAINTS`. The parser drops the selector, and the formatter used to emit what it parsed, so `adf fmt --write` rewrote them to the text-style glyph (`⚠`) and `adf fmt --check` reported a freshly scaffolded file as non-canonical. The formatter now emits a section's standard decoration whenever the parsed one equals it apart from U+FE0F, whichever form the file had; any other decoration is emitted as parsed (still without U+FE0F, which the parser does not keep). **`adf fmt --write` output changes for files with a bare `⚠ CONSTRAINTS`, `🗂 FILES` or `🛠 TOOLS` header** (it now writes the U+FE0F form), and `adf fmt --check` reports such files as non-canonical until rewritten. The other commands that re-render a whole `.adf` file through the formatter (`adf tidy`, `adf migrate`, `adf patch`, `adf metrics`, the MCP patch tool) write the same headers. The parsed AST is unchanged, so commands that read these files behave as before. `adf sync` hashes the raw bytes, so once one of these writers rewrites a sync source, `adf sync --check` reports it as changed until `adf sync --write`. That check fails the same way after any edit. `adf populate` and the other text-preserving writers add a section header in the same form `adf fmt` emits; a non-standard text-style decoration (say `⚙ NOTES`) is no longer given a U+FE0F that `adf fmt` would then remove. New export `canonicalDecoration(key, decoration)` in `@stackbilt/adf`. This repo's `.ai/*.adf` headers were rewritten to `⚠️ CONSTRAINTS`.
12
+
11
13
- **`bootstrap --ci github` and `setup --ci github` no longer overwrite a hand-edited `.github/workflows/charter-governance.yml`, and no longer silently widen its permissions** (`#374`). Without `--force`, an existing workflow is refreshed only when it is the current npm or pnpm template; a switch between the two is named (`Updated … (package manager npm → pnpm; adds pnpm/action-setup@v4)`, `packageManagerChange` in JSON). The known templates, each with a `safe` flag and a hand-written description, are listed in `commands/github-workflow.ts`. Every older Charter template had `contents: read` and ran on `pull_request` only. It is now kept with a warning that says what refreshing it changes (`contents: read → write; adds push and workflow_dispatch triggers; adds a step that commits and pushes to the repo`) and names `--force`; when the upgrade also switches package manager, the warning, the `Replaced` line and JSON (`packageManagerChange`) say so (`package manager npm → pnpm (adds pnpm/action-setup@v4)`). Before this change `bootstrap --ci github` made that upgrade silently. Any other workflow is treated as hand-edited and kept byte for byte, with a warning that states what the current template grants and asks you to review it before `--force`. Charter does not describe what a hand edit changed. The warnings name what else `--force` does in each command, and say that deleting the workflow and re-running replaces only it. Comparison drops a leading BOM, CRLF line endings, trailing whitespace and trailing blank lines. A pinned `@stackbilt/[email protected]` is normalized too, but the only template that pinned one predates the current permissions, so a pinned workflow is kept unless `--force`. JSON: bootstrap lists a kept workflow in `setup.details.kept` (platform separator, like the `.charter/` entries) and records `setup.details.workflow: { file, action, reason?, changes?, templatePermissions?, backup?, packageManagerChange? }`; setup sets `workflow.kept`, `workflow.reason`, `workflow.changes` and `workflow.templatePermissions`. `reason` is `hand-edited` or `would-widen-permissions`. Under `--force` the workflow is first copied to `.charter/.backup/github-workflows-charter-governance.yml.<timestamp>` (gitignored), then replaced, printed as `Replaced … (backup: …; changes: …)` or `(backup: …; the current Charter template grants …)` (`setup.details.replaced` in bootstrap JSON; `workflow.backup` and an entry in top-level `replaced` in setup JSON). If that backup fails, the workflow is not replaced and the command exits 1: bootstrap lists it in `setup.details.notReplaced`, fails the setup step (JSON `status: "partial"`) and prints `Bootstrap finished with failures.` instead of `Bootstrap complete.`; setup lists it in `notReplaced` (with `reason`), sets `workflow.notReplaced: true` and prints `CI policy gate: not replaced (backup failed)`. A missing workflow is still created and an identical one left alone. `setup --ci github` without `--force` now refreshes the other package manager's current template, which it used to leave alone; setup's `mutationPlan.workflow.action` is `noop` for a workflow it will keep.
12
14
-**`charter init --guided --format json` is refused** (`#375`). It used to ask its questions on a terminal and then print the init result document, with the banner and prompts mixed into stdout ahead of it; with a closed stdin it exited 0 having printed no JSON at all. It now exits 1 before asking anything and prints one JSON document: `error`, `errorCode: "GUIDED_REQUIRES_TEXT"`, `guided: true`, `writesPerformed: 0`. For a JSON result, use `charter init --preset <name> --format json`.
13
15
-**`charter init --guided --ci` is refused** (`#375`): exit 1 before asking anything, with a message on stderr naming `charter init --preset <name>`. A CI stdin that stays open would otherwise leave guided mode waiting forever.
@@ -38,7 +40,10 @@ The format is based on Keep a Changelog and follows Semantic Versioning.
38
40
- In each of those three cases, Charter is not called again.
39
41
-**1.x:** one warning to upgrade `@stackbilt/cli` to 2.x (as a devDependency, or your global install), since 1.x ignores `--staged` and `--print-paths`.
40
42
41
-
A doctor that ran and reported findings gets no devDependency hint. When tidy leaves a staged vendor file alone (for example, an unmanaged one), its note is shown under `[pre-commit] adf tidy notes:`. Neither that case nor a failed tidy dry run goes on to say "Vendor config files are clean." `charter doctor` and the hook now detect PnP from one shared source. The `CHARTER_HOOK_SCOPED_DOCTOR` token flow is unchanged. Scope: this fix covers the pre-commit hook only; the CI workflow `charter setup` generates still calls `npx charter` (tracked separately). **Installed hooks do not update themselves:** run `charter hook install --pre-commit` again (no `--force` needed for a Charter-managed hook). This is needed under Yarn PnP and recommended everywhere else. `charter doctor` reports an older hook as INFO in a PnP repo.
43
+
A doctor that ran and reported findings gets no devDependency hint. When tidy leaves a staged vendor file alone (for example, an unmanaged one), its note is shown under `[pre-commit] adf tidy notes:`. Neither that case nor a failed tidy dry run goes on to say "Vendor config files are clean." `charter doctor` and the hook now detect PnP from one shared source. The `CHARTER_HOOK_SCOPED_DOCTOR` token flow is unchanged. Scope: this fix covers the pre-commit hook only; the CI workflow `charter setup` generates is fixed separately (`#380`). **Installed hooks do not update themselves:** run `charter hook install --pre-commit` again (no `--force` needed for a Charter-managed hook). This is needed under Yarn PnP and recommended everywhere else. `charter doctor` reports an older hook as INFO in a PnP repo.
44
+
- **The GitHub workflow that `charter setup --ci github` and `charter bootstrap --ci github` generate no longer runs a bare `npx charter`** (`#380`). When `@stackbilt/cli` was not installed, `npx charter` fetched the unrelated `charter` registry package (no executable, so the step failed with `could not determine executable to run`). Each step now runs the CLI the install step put in `node_modules`: `pnpm exec charter …` for pnpm, and `npm exec --no --package=@stackbilt/cli -- charter …` for npm. Neither form installs anything; without a local `@stackbilt/cli` the step fails. `setup` and `bootstrap` add it to `devDependencies`, except under `--no-dependency-sync` or in a repo with no root `package.json`. The npm form still contains `charter validate --ci`, so doctor's gate-enforcement check recognizes it. The template has no Yarn form (it supports npm and pnpm only), so a Yarn repo gets the npm form. The previous template (003ec8d, with `npx charter`) has the same permissions and triggers, so `setup`/`bootstrap` refresh it without a warning, as before. Its `KNOWN_WORKFLOWS` entry stays `safe` and records what the refresh changes.
45
+
-**`charter adf compile --target claude --write --mode compiled` no longer carries the template's empty `## Environment` placeholder into the retained block** (`#364`). A `CLAUDE.md` written by any bootstrap since 0.3.3 (the 1.9.3 upgrade path included) holds `## Environment` with only the `<!-- Add runtime/OS/shell-specific notes here (not stack rules) -->` comment. When you had added a second `## Environment` of your own, converting the pointer to compiled output carried both, comment included, and reported `kept ## Environment, ## Environment`. Each retained section is now compared with the pointer templates on its own (ignoring CRLF, whitespace at line ends and blank lines around the body), so the untouched placeholder is dropped as template text and only your section is carried. A placeholder you wrote under is yours and is carried as before. A retained block that an earlier compile already wrote is copied verbatim as always: if yours holds the placeholder, delete it from the block by hand.
46
+
-**`charter adf migrate` and `charter bootstrap` wrote the generic "This project uses [ADF]…" pointer instead of the named template when run from the CLI** (`#355`). This hit `GEMINI.md`, `AGENTS.md`, `.cursorrules` and `copilot-instructions.md` in the default mode, and `CLAUDE.md` too under `--replace`. `adf-migrate` built its template table when the module loaded, and the CLI loads it while `adf.ts` is still initialising (`index` → `doctor` → `adf` → `adf-migrate`), so every entry was `undefined`. The template is now looked up when the pointer is written. Unit tests that imported `adf-migrate` directly never saw the cycle.
42
47
-**`charter adf populate`, and so every `charter bootstrap`, re-added stack constraints to a `CONSTRAINTS` section you had edited** (`#371`; 2.1.0 listed this as still open under `#354`). Deleting a bullet from `core.adf` and re-running bootstrap brought a stack rule back (for example the Cloudflare `No Node.js-specific APIs in Worker handlers` rule), because populate appended any detected stack constraint it did not find. Populate now remembers what it has added or offered in a new file, `.ai/.populate.json` (`{ "version": 1, "constraints": { "core.adf": { "added": [...], "offered": [...] } } }`, sorted, written only when it changes). Commit it with the rest of `.ai/`; bootstrap lists it under what it created, and its `git add .ai` next step already includes it. The rules:
43
48
- A constraint recorded as added or offered is never added again, whether it is still in the section or you deleted it. Deleting the one rule populate added to a plain Worker repo now sticks, and a deleted `CONSTRAINTS` section is not recreated once the file has a record.
44
49
- New constraints go only into a section that is untouched: the template's bullets, in order, followed by nothing but bullets populate recorded as added. A missing section is created only while there is no record. It goes right after whichever of `GUIDE` and `CONTEXT` comes later, which in the scaffold's order is its own place, rather than at the end of the file (when populate adds a missing `CONTEXT` in the same run, that one is appended at the end and `CONSTRAINTS` follows it); its header is written as the scaffold writes it (`⚠️ CONSTRAINTS [load-bearing]:`).
@@ -54,6 +59,7 @@ The format is based on Keep a Changelog and follows Semantic Versioning.
54
59
-**The interactive y/N prompts (`bootstrap`'s "Register these modules now?" and the `--reset-adf` "Replace them?") left the CLI to exit 0 mid-run when stdin closed at the prompt or Ctrl-C was pressed** (`#375`). Ctrl-D on an empty line (or any close before an answer) now counts as N, with `No answer (input closed); treating it as N.` on stderr: bootstrap leaves the orphan modules unregistered and carries on, and `--reset-adf` is declined (exit 1, nothing written). Ctrl-C stops the command: it prints `charter: Aborted.` on stderr and exits 130 (the usage-log event is still recorded), so bootstrap does not go on to migrate agent configs or install packages.
55
60
-**`charter init --guided --preset <name>` silently ignored `--preset`** (`#375`). It now seeds the answer: the preset is used when the language answer names no known stack (blank, or something like `cobol`), and the first question says `blank keeps --preset <name>`. A recognized language or a Cloudflare `y` still decides, as before.
56
61
- Preset lists named four or five presets where six are accepted: the root `--help` (`charter init`, `charter setup` and the `--preset` option), `charter adf --help`, `packages/cli/README.md`, `docs-snippets/charter-cli-reference.md` and the Global Flags table of `docs/cli-reference.md` now list all six (`worker|frontend|backend|fullstack|docs|rust-wasm`).
62
+
-**Help text gaps** (`#363`). The root `--help` lists `charter doctor [--adf-only] [--ci] [--format text|json]` and the pre-commit-hook-only `--staged [--tidy-skipped "<files>"]`, and its `charter adf` entry names all fifteen subcommands (it named nine). `charter adf --help` describes `tidy --source` and `--print-paths`, gives each `adf vendor` subcommand (`status`, `set`, `init`, `restore`, `rename-legacy`) its own line and flags, and documents `adf context`, which it left out. `docs/cli-reference.md` lists doctor's `--format json`.
0 commit comments