@nextcommerce/campaigns-os 1.37.2 → 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 (50) hide show
  1. package/AGENTS.md +115 -11
  2. package/CHANGELOG.md +556 -0
  3. package/README.md +43 -36
  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 +873 -0
  7. package/contracts/supported-surface.json +25 -5
  8. package/docs/activation-and-evidence.md +1 -1
  9. package/docs/build-packet.md +27 -16
  10. package/docs/demo-preview.md +3 -4
  11. package/docs/diagnostics.md +7 -4
  12. package/docs/effects.md +281 -0
  13. package/docs/gateway-login.md +113 -0
  14. package/docs/orientation-contract-reference.md +4 -1
  15. package/docs/progress-snapshots.md +3 -3
  16. package/docs/qa-and-test-orders.md +3 -3
  17. package/docs/readback.md +523 -0
  18. package/docs/runtime-readiness.md +1 -1
  19. package/docs/sdk-storage-compatibility.md +1 -1
  20. package/docs/skills-revision.md +364 -0
  21. package/docs/supported-surface.md +12 -4
  22. package/docs/versioning.md +8 -4
  23. package/package.json +8 -3
  24. package/schemas/campaign-runtime-build-packet.v0.schema.json +5 -0
  25. package/schemas/campaigns-os-effects.v1.schema.json +211 -0
  26. package/schemas/campaigns-os-readback.v2.schema.json +267 -0
  27. package/skills/campaign-lifecycle-orientation/SKILL.md +174 -0
  28. package/skills/campaign-readback-classification/SKILL.md +230 -0
  29. package/skills/campaign-run-evidence/SKILL.md +140 -0
  30. package/skills/contribution-intake/SKILL.md +85 -0
  31. package/skills/next-campaigns-build/SKILL.md +33 -12
  32. package/skills/next-campaigns-os/SKILL.md +45 -21
  33. package/skills/next-campaigns-os-setup/SKILL.md +35 -14
  34. package/skills/next-campaigns-polish/SKILL.md +43 -17
  35. package/skills/next-campaigns-qa/SKILL.md +48 -24
  36. package/skills.json +39 -6
  37. package/src/admin-transport.mjs +123 -0
  38. package/src/cli.mjs +991 -200
  39. package/src/credential-store.mjs +183 -0
  40. package/src/deviation.mjs +3 -2
  41. package/src/diagnostic.mjs +4 -1
  42. package/src/gate-actions.mjs +2 -2
  43. package/src/install-mode.mjs +17 -9
  44. package/src/lifecycle.mjs +95 -0
  45. package/src/login.mjs +152 -0
  46. package/src/package-install-fixture.mjs +3 -2
  47. package/src/qa-node.mjs +56 -19
  48. package/src/qa-publish.mjs +108 -2
  49. package/src/readback.mjs +1936 -0
  50. 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`,
@@ -43,9 +47,9 @@ order:
43
47
  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
- npm install --save-dev --save-exact @nextcommerce/campaigns-os@1.34.1
47
- npx campaigns-os tooling status --platform claude
48
- npx campaigns-os install-skills --platform claude
50
+ npm install --save-dev --save-exact @nextcommerce/campaigns-os@1.37.3
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
 
@@ -53,7 +57,7 @@ The toolkit is also published to npm as `@nextcommerce/campaigns-os`, so the
53
57
  CLI can be installed once, globally, instead of pinned per campaign:
54
58
 
55
59
  ```bash
56
- npm install -g @nextcommerce/campaigns-os@1.34.1
60
+ npm install -g @nextcommerce/campaigns-os@1.37.3
57
61
  campaigns-os tooling status --platform claude
58
62
  campaigns-os install-skills --platform claude
59
63
  ```
@@ -69,20 +73,17 @@ runs the full check in an unprivileged job and publishes the verified tarball
69
73
  with provenance from a second, environment-gated job.
70
74
 
71
75
  For an existing page-kit campaign, skip the first three lines and `cd` into it
72
- (its `package.json` already declares `next-campaign-page-kit`). `1.34.1` is
76
+ (its `package.json` already declares `next-campaign-page-kit`). `1.37.3` is
73
77
  an exact published example; choose the release you reviewed, never a floating
74
78
  dist-tag for a reproducible build. Commit `package.json` and `package-lock.json`.
75
- The new `tooling diagnose` command requires 1.35.0 or later. When that release
76
- is not published yet, use the reviewed full-SHA source pin below; the 1.34.1
77
- example does not include diagnostics or the global invocation rendering fix.
79
+ `tooling diagnose` requires 1.35.0 or later and `demo` requires 1.37.0 or later.
78
80
  A Git source pin remains supported when using an unreleased reviewed commit:
79
81
  `npm install --save-dev --save-exact "github:NextCommerceCo/campaigns-os#<full-sha>"`.
80
82
 
81
- For a visual sample, candidate 1.37.0 adds
82
- `npx campaigns-os demo --target ./apollo-sample`. Open the printed
83
- `landing/index.html` directly to explore four inert Apollo pages. This command
84
- requires a reviewed candidate or a published release at least 1.37.0; the 1.34.1
85
- example above does not include it. It downloads nothing and creates no campaign
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
86
+ `landing/index.html` directly. It downloads nothing and creates no campaign
86
87
  evidence. Keep sample edits and start a real campaign in a separate new Page Kit
87
88
  folder. See [offline sample preview](docs/demo-preview.md).
88
89
  The lockfile records the resolved source and integrity; `tooling status` reports
@@ -105,15 +106,15 @@ template stock. To update, review the new release source and install its exact v
105
106
  > The first `start` opens a run session in the target folder and, unless you
106
107
  > opt out, the session's Run Record is remitted to the Campaigns telemetry
107
108
  > endpoint with the packet's Campaigns API key. Opt out with
108
- > `npx campaigns-os telemetry off`, `CAMPAIGNS_OS_TELEMETRY=off`, or
109
+ > `npx --no-install campaigns-os telemetry off`, `CAMPAIGNS_OS_TELEMETRY=off`, or
109
110
  > `--no-remit` on the remitting command; capture stays local either way. The
110
111
  > full note — endpoint, payload, what `off` changes, and `--no-run-session` —
111
112
  > is in [docs/quickstart.md](docs/quickstart.md) above the first `start`; the
112
113
  > contract is [Run Telemetry](docs/workflow-findings-sidecar.md).
113
114
 
114
115
  ```bash
115
- npx campaigns-os start --map-id <map-id> --target . --source ./source --template-family <family>
116
- 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
117
118
  ```
118
119
 
119
120
  `--map-id <id>` starts from a map saved in Campaign Map Builder (add
@@ -131,10 +132,11 @@ normally `BLOCKED` with a list of what to supply — missing screenshot proof,
131
132
  demo values to replace, a scaffold to run. That list is the intake checklist,
132
133
  not a failed install. The demo values are the store profile and SDK pin
133
134
  `campaign-init` seeded into `_data/campaigns.json`; doctor prints the one
134
- command that replaces them from the CampaignSpec, `npx campaigns-os page-kit
135
- sync --packet campaign-runtime.build.json`, and after it both page-kit gates
136
- pass. The reverse write exists for a configured campaign: `npx campaigns-os
137
- 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
138
140
  states (the SDK pin, page routes, analytics ids) into the local CampaignSpec,
139
141
  and with `--write-map` records the pin in the saved Map's Build hints too, so
140
142
  a bump in the repo is one edit followed by a derive rather than a hand edit
@@ -149,12 +151,13 @@ fields, and resolve competing edits before the next build.
149
151
 
150
152
  Everything after `start` is agent-driven: after `start`
151
153
  and after every stage, run `next` and do what it prints — it names the skill
152
- and the exact commands for the next stage, already spelled `npx campaigns-os
153
- …` for this install, which is why `install-skills` comes first. The browser
154
- for polish capture and QA is a one-time `npx campaigns-os qa install-browser`,
155
- which installs the browser for the Playwright this toolkit bundles. A pin
156
- older than that command shows `npx playwright install chromium` instead; that
157
- 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
158
161
  (a campaign that depends on its own Playwright version gets that one's
159
162
  browser instead), so prefer `qa install-browser` on pins that have it.
160
163
 
@@ -163,9 +166,9 @@ browser instead), so prefer `qa install-browser` on pins that have it.
163
166
  The pinned devDependency above is the primary path. To change the toolkit, use
164
167
  a checkout ([docs/quickstart.md](docs/quickstart.md)): every `npm run
165
168
  campaigns-os -- <command> …` example in this repository is that checkout form,
166
- and from a campaign folder the same command is `npx campaigns-os <command> …`
167
- with identical arguments (`npm run qa:install-browser` is the checkout's
168
- `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`).
169
172
 
170
173
  From a checkout, the same first run uses the bundled example inputs:
171
174
 
@@ -288,9 +291,10 @@ checks that the package metadata, CLI entrypoint, and installed Campaigns OS
288
291
  skills agree. For a checkout it also reports branch, upstream, and ahead/behind;
289
292
  for a package install the pinned commit is the freshness answer, and there is
290
293
  no npm dist-tag to compare against. Neither mode makes agent skills current on
291
- its own: when skills are stale, run `install-skills --platform all` through the
292
- same prefix you ran `tooling status` with (the status output prints the exact
293
- 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.
294
298
 
295
299
  Run `campaigns-os qa install-browser` (`npm run qa:install-browser` from a
296
300
  checkout) once after install/update and before mandatory `polish capture` or
@@ -356,11 +360,14 @@ See [`campaign-spec/README.md`](campaign-spec/README.md).
356
360
  - [Setup Profile Parity](docs/setup-profile-parity.md)
357
361
  - [Developer Evaluation](docs/developer-evaluation.md)
358
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
359
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
360
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
361
367
  - [Small PR Review Path](docs/small-pr-review-path.md)
362
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
363
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
364
371
 
365
372
  ## Status
366
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." },