@nextcommerce/campaigns-os 1.37.3 → 1.41.2

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.
Files changed (49) hide show
  1. package/AGENTS.md +114 -10
  2. package/CHANGELOG.md +530 -0
  3. package/README.md +38 -27
  4. package/contracts/agent-relevant-change-policy.v1.json +11 -1
  5. package/contracts/effects.v1.json +4794 -0
  6. package/contracts/release-ledger.json +789 -0
  7. package/contracts/supported-surface.json +25 -5
  8. package/docs/build-packet.md +27 -16
  9. package/docs/demo-preview.md +1 -1
  10. package/docs/diagnostics.md +7 -4
  11. package/docs/effects.md +281 -0
  12. package/docs/gateway-login.md +113 -0
  13. package/docs/orientation-contract-reference.md +4 -1
  14. package/docs/progress-snapshots.md +3 -3
  15. package/docs/qa-and-test-orders.md +3 -3
  16. package/docs/readback.md +523 -0
  17. package/docs/runtime-readiness.md +1 -1
  18. package/docs/sdk-storage-compatibility.md +1 -1
  19. package/docs/skills-revision.md +364 -0
  20. package/docs/supported-surface.md +11 -3
  21. package/docs/versioning.md +8 -4
  22. package/package.json +8 -3
  23. package/schemas/campaign-runtime-build-packet.v0.schema.json +5 -0
  24. package/schemas/campaigns-os-effects.v1.schema.json +211 -0
  25. package/schemas/campaigns-os-readback.v2.schema.json +267 -0
  26. package/skills/campaign-lifecycle-orientation/SKILL.md +174 -0
  27. package/skills/campaign-readback-classification/SKILL.md +230 -0
  28. package/skills/campaign-run-evidence/SKILL.md +140 -0
  29. package/skills/contribution-intake/SKILL.md +85 -0
  30. package/skills/next-campaigns-build/SKILL.md +33 -12
  31. package/skills/next-campaigns-os/SKILL.md +45 -21
  32. package/skills/next-campaigns-os-setup/SKILL.md +35 -14
  33. package/skills/next-campaigns-polish/SKILL.md +43 -17
  34. package/skills/next-campaigns-qa/SKILL.md +48 -24
  35. package/skills.json +39 -6
  36. package/src/admin-transport.mjs +123 -0
  37. package/src/cli.mjs +991 -200
  38. package/src/credential-store.mjs +183 -0
  39. package/src/deviation.mjs +3 -2
  40. package/src/diagnostic.mjs +4 -1
  41. package/src/gate-actions.mjs +2 -2
  42. package/src/install-mode.mjs +17 -9
  43. package/src/lifecycle.mjs +95 -0
  44. package/src/login.mjs +152 -0
  45. package/src/package-install-fixture.mjs +3 -2
  46. package/src/qa-node.mjs +56 -19
  47. package/src/qa-publish.mjs +108 -2
  48. package/src/readback.mjs +1936 -0
  49. package/src/remit.mjs +17 -3
package/README.md CHANGED
@@ -26,10 +26,14 @@ installation, a saved Map, preview observation, and recorded QA each establish.
26
26
 
27
27
  You do not need to clone this repository to use it. The toolkit is pinned as a
28
28
  devDependency of the campaign folder (a page-kit project) and runs through
29
- `npx campaigns-os …` from that folder — the pin is committed in `package.json`
30
- and the lockfile, so CI and the deploy host install the same package bytes. Requirements: Node
31
- `>=20.19.0` and npm 10 or 11 (Node 22 ships npm 10). Three steps, in this
32
- order:
29
+ `npx --no-install campaigns-os …` from that folder — the pin is committed in
30
+ `package.json` and the lockfile, so CI and the deploy host install the same
31
+ package bytes. Keep `--no-install`: `campaigns-os` is only the bin name of
32
+ `@nextcommerce/campaigns-os`, so in a folder without the pinned copy a plain
33
+ `npx campaigns-os` looks that name up on the registry and, with no terminal to
34
+ ask, installs what it finds; with the flag, npx stops with an error instead.
35
+ Requirements: Node `>=20.19.0` and npm 10 or 11 (Node 22 ships npm 10). Three
36
+ steps, in this order:
33
37
 
34
38
  1. **Orient before you run anything.** Read
35
39
  [`AGENTS.md`](AGENTS.md), `contracts/supported-surface.json`,
@@ -44,8 +48,8 @@ mkdir "<route>" && cd "<route>"
44
48
  npm init -y && npm i next-campaign-page-kit
45
49
  npx campaign-init --non-interactive --template <family> --slug "<route>" --name "<campaign name>"
46
50
  npm install --save-dev --save-exact @nextcommerce/campaigns-os@1.37.3
47
- npx campaigns-os tooling status --platform claude
48
- npx campaigns-os install-skills --platform claude
51
+ npx --no-install campaigns-os tooling status --platform claude
52
+ npx --no-install campaigns-os install-skills --platform claude
49
53
  mkdir -p source
50
54
  ```
51
55
 
@@ -76,8 +80,9 @@ dist-tag for a reproducible build. Commit `package.json` and `package-lock.json`
76
80
  A Git source pin remains supported when using an unreleased reviewed commit:
77
81
  `npm install --save-dev --save-exact "github:NextCommerceCo/campaigns-os#<full-sha>"`.
78
82
 
79
- For a visual sample, `npx campaigns-os demo --target ./apollo-sample`
80
- (1.37.0 or later) copies four inert Apollo pages; open the printed
83
+ For a visual sample, run
84
+ `npx --no-install campaigns-os demo --target ./apollo-sample` (1.37.0 or later).
85
+ It copies four inert Apollo pages; open the printed
81
86
  `landing/index.html` directly. It downloads nothing and creates no campaign
82
87
  evidence. Keep sample edits and start a real campaign in a separate new Page Kit
83
88
  folder. See [offline sample preview](docs/demo-preview.md).
@@ -101,15 +106,15 @@ template stock. To update, review the new release source and install its exact v
101
106
  > The first `start` opens a run session in the target folder and, unless you
102
107
  > opt out, the session's Run Record is remitted to the Campaigns telemetry
103
108
  > endpoint with the packet's Campaigns API key. Opt out with
104
- > `npx campaigns-os telemetry off`, `CAMPAIGNS_OS_TELEMETRY=off`, or
109
+ > `npx --no-install campaigns-os telemetry off`, `CAMPAIGNS_OS_TELEMETRY=off`, or
105
110
  > `--no-remit` on the remitting command; capture stays local either way. The
106
111
  > full note — endpoint, payload, what `off` changes, and `--no-run-session` —
107
112
  > is in [docs/quickstart.md](docs/quickstart.md) above the first `start`; the
108
113
  > contract is [Run Telemetry](docs/workflow-findings-sidecar.md).
109
114
 
110
115
  ```bash
111
- npx campaigns-os start --map-id <map-id> --target . --source ./source --template-family <family>
112
- npx campaigns-os next --packet ./campaign-runtime.build.json --json
116
+ npx --no-install campaigns-os start --map-id <map-id> --target . --source ./source --template-family <family>
117
+ npx --no-install campaigns-os next --packet ./campaign-runtime.build.json --json
113
118
  ```
114
119
 
115
120
  `--map-id <id>` starts from a map saved in Campaign Map Builder (add
@@ -127,10 +132,11 @@ normally `BLOCKED` with a list of what to supply — missing screenshot proof,
127
132
  demo values to replace, a scaffold to run. That list is the intake checklist,
128
133
  not a failed install. The demo values are the store profile and SDK pin
129
134
  `campaign-init` seeded into `_data/campaigns.json`; doctor prints the one
130
- command that replaces them from the CampaignSpec, `npx campaigns-os page-kit
131
- sync --packet campaign-runtime.build.json`, and after it both page-kit gates
132
- pass. The reverse write exists for a configured campaign: `npx campaigns-os
133
- spec derive --packet campaign-runtime.build.json` copies what the repo already
135
+ command that replaces them from the CampaignSpec, `npx --no-install
136
+ campaigns-os page-kit sync --packet campaign-runtime.build.json`, and after it
137
+ both page-kit gates pass. The reverse write exists for a configured campaign:
138
+ `npx --no-install campaigns-os spec derive --packet
139
+ campaign-runtime.build.json` copies what the repo already
134
140
  states (the SDK pin, page routes, analytics ids) into the local CampaignSpec,
135
141
  and with `--write-map` records the pin in the saved Map's Build hints too, so
136
142
  a bump in the repo is one edit followed by a derive rather than a hand edit
@@ -145,12 +151,13 @@ fields, and resolve competing edits before the next build.
145
151
 
146
152
  Everything after `start` is agent-driven: after `start`
147
153
  and after every stage, run `next` and do what it prints — it names the skill
148
- and the exact commands for the next stage, already spelled `npx campaigns-os
149
- …` for this install, which is why `install-skills` comes first. The browser
150
- for polish capture and QA is a one-time `npx campaigns-os qa install-browser`,
151
- which installs the browser for the Playwright this toolkit bundles. A pin
152
- older than that command shows `npx playwright install chromium` instead; that
153
- is equivalent only when `npx playwright` resolves to the toolkit's Playwright
154
+ and the exact commands for the next stage, already spelled `npx --no-install
155
+ campaigns-os …` for this install, which is why `install-skills` comes first.
156
+ Releases before 1.41.2 print the same commands without `--no-install`; add it
157
+ when you copy one. The browser for polish capture and QA is a one-time
158
+ `npx --no-install campaigns-os qa install-browser`, which installs the browser
159
+ for the Playwright this toolkit bundles. A pin older than that command shows
160
+ `npx playwright install chromium` instead; that is equivalent only when `npx playwright` resolves to the toolkit's Playwright
154
161
  (a campaign that depends on its own Playwright version gets that one's
155
162
  browser instead), so prefer `qa install-browser` on pins that have it.
156
163
 
@@ -159,9 +166,9 @@ browser instead), so prefer `qa install-browser` on pins that have it.
159
166
  The pinned devDependency above is the primary path. To change the toolkit, use
160
167
  a checkout ([docs/quickstart.md](docs/quickstart.md)): every `npm run
161
168
  campaigns-os -- <command> …` example in this repository is that checkout form,
162
- and from a campaign folder the same command is `npx campaigns-os <command> …`
163
- with identical arguments (`npm run qa:install-browser` is the checkout's
164
- `qa install-browser`).
169
+ and from a campaign folder the same command is
170
+ `npx --no-install campaigns-os <command> …` with identical arguments (`npm run
171
+ qa:install-browser` is the checkout's `qa install-browser`).
165
172
 
166
173
  From a checkout, the same first run uses the bundled example inputs:
167
174
 
@@ -284,9 +291,10 @@ checks that the package metadata, CLI entrypoint, and installed Campaigns OS
284
291
  skills agree. For a checkout it also reports branch, upstream, and ahead/behind;
285
292
  for a package install the pinned commit is the freshness answer, and there is
286
293
  no npm dist-tag to compare against. Neither mode makes agent skills current on
287
- its own: when skills are stale, run `install-skills --platform all` through the
288
- same prefix you ran `tooling status` with (the status output prints the exact
289
- command) and restart local agent sessions.
294
+ its own: when skills are stale, run the refresh command the status output
295
+ prints (it names each stale platform, through the same prefix you ran
296
+ `tooling status` with) and restart local agent sessions. Without `--platform`,
297
+ status checks only the platforms where Campaigns OS skills are installed.
290
298
 
291
299
  Run `campaigns-os qa install-browser` (`npm run qa:install-browser` from a
292
300
  checkout) once after install/update and before mandatory `polish capture` or
@@ -352,11 +360,14 @@ See [`campaign-spec/README.md`](campaign-spec/README.md).
352
360
  - [Setup Profile Parity](docs/setup-profile-parity.md)
353
361
  - [Developer Evaluation](docs/developer-evaluation.md)
354
362
  - [QA And Test Orders](docs/qa-and-test-orders.md)
363
+ - [Run-Artifact Readback](docs/readback.md) — `campaigns-os readback`: a read-only projection of one run's emitted artifacts, with per-artifact freshness against the checkout and a versioned JSON contract to gate on
364
+ - [Declared Command Effects](docs/effects.md) — what every supported invocation writes and sends, one row per command and effect-changing flag, each row proved by a test that runs the real CLI in a disposable target
355
365
  - [Legacy Migration Contract](docs/legacy-migration.md) — pure inventory, preview-plan, receipt, Offer request/readback, and token-free evidence helpers for bounded SDK 0.3.x shadow migrations
356
366
  - [Template Family vs Figma-extraction vs Hybrid](docs/template-vs-extraction-decision.md) — when to mint a template family, when to extract a bespoke design, and when to do both
357
367
  - [Small PR Review Path](docs/small-pr-review-path.md)
358
368
  - [Run Telemetry](docs/workflow-findings-sidecar.md) — per-run Run Record (system signal + workflow findings) tagged by improvement surface; captured locally always, remitted to Next Commerce only with up-front opt-out consent
359
369
  - [Versioning](docs/versioning.md)
370
+ - [ADR 0002: One shipping path](docs/adr/0002-one-shipping-path-campaigns-agent-fold.md) — decides that the agent surface (skills, charter, declared effects, readback) lives in this repository; Campaigns Agent folds in
360
371
 
361
372
  ## Status
362
373
 
@@ -59,8 +59,19 @@
59
59
  { "match": { "kind": "exact", "value": "contracts/agent-relevant-change-policy.v1.json" }, "class": "compatibility_policy" },
60
60
  { "match": { "kind": "exact", "value": "contracts/orientation-limits.v1.json" }, "class": "compatibility_policy" },
61
61
  { "match": { "kind": "exact", "value": "contracts/orientation-reason-codes.v1.json" }, "class": "compatibility_policy" },
62
+ { "match": { "kind": "exact", "value": "contracts/effects.v1.json" }, "class": "compatibility_policy" },
62
63
  { "match": { "kind": "exact", "value": "bin/campaigns-os.mjs" }, "class": "cli_surface" },
63
64
  { "match": { "kind": "exact", "value": "src/cli.mjs" }, "class": "cli_surface" },
65
+ {
66
+ "match": { "kind": "prefix", "value": "src/agent/" },
67
+ "class": "cli_surface",
68
+ "_note": "The agent-facing entry points (skill install, agent context, the tooling-status revision check) are reachable from the supported argv surface, so a change under src/agent/ is a CLI-surface change even though the rest of src/ is unsupported implementation. This rule sits ahead of the broad src/ ignore on purpose: the ignore's reason is 'implementation reachable only through declared package exports', which is exactly what this subtree is not."
69
+ },
70
+ {
71
+ "match": { "kind": "prefix", "value": "agents/" },
72
+ "class": "documentation",
73
+ "_note": "The per-platform agent instruction files an agent orients on (and that `install-agent-context` copies into a target repo). They were ignored as 'illustrative' while nothing consumed them; they are now named supported surface, so a change to one is a documentation change a consumer can see."
74
+ },
64
75
  { "match": { "kind": "exact", "value": "skills.json" }, "class": "skill" },
65
76
  { "match": { "kind": "exact", "value": "skills.sh" }, "class": "skill" },
66
77
  { "match": { "kind": "prefix", "value": "skills/" }, "class": "skill" },
@@ -92,7 +103,6 @@
92
103
  { "match": { "kind": "prefix", "value": "campaign-spec/" }, "reason": "Tests, fixtures, and packaging metadata for the generated runtime. The runtime sources a consumer must rebuild are classified by the generated_runtime rule first; only that rule's exclusions reach here." },
93
104
  { "match": { "kind": "prefix", "value": "examples/" }, "reason": "Illustrative, regenerated at will (docs/supported-surface.md)." },
94
105
  { "match": { "kind": "prefix", "value": "prompts/" }, "reason": "Illustrative, regenerated at will (docs/supported-surface.md)." },
95
- { "match": { "kind": "prefix", "value": "agents/" }, "reason": "Illustrative, regenerated at will (docs/supported-surface.md)." },
96
106
  { "match": { "kind": "prefix", "value": "docs/adr/" }, "reason": "Architecture decision records: rationale, not a consumed contract." },
97
107
  { "match": { "kind": "prefix", "value": "docs/" }, "reason": "Documentation that is not on the named supported surface and not an agent document of record. Named docs are classified by the derived pass first." },
98
108
  { "match": { "kind": "exact", "value": "README.md" }, "reason": "Repository front page; the agent entry point is AGENTS.md." },