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
test(agent-creator-studio): NR-4 regression test + README status flip to InProgress
Adds the launch-gating test that locks the shared-intent contract
between publish_intents (the agent's pre-encryption staging table) and
publish_drafts (the Creator app's post-encryption queue), and flips the
task README from Proposed → InProgress with the full S1 commit trail.
NR-4 (PLAN.md §11) — what this test catches
-------------------------------------------
The Monetisation Agent writes user intent into publish_intents. The
Creator app reads it via puter.args.resumeIntent, pre-fills its wizard,
runs the existing encrypt + IPFS pin pipeline UNCHANGED, then writes a
publish_drafts row that gets minted exactly as today. If the column
shape drifts between the two tables, the agent-led path and the manual
path diverge silently — a row written via resumeFromIntent could drop a
field, producing a different opRawData payload at mint time.
The test enforces this in four ways:
1. CURRENT_VERSION in migrations.ts is at least 34
(otherwise existing installs never run the migration; the
agent flow fails with 500s at /api/intents).
2. Migration 34 block exists AND records itself
(otherwise the migration re-runs on every boot, masking failures).
3. schema.sql defines publish_intents
(otherwise fresh installs are missing the table — same class of
bug as the v1.2.7.0/.1 publish_drafts crash).
4. Every input-side column of publish_drafts has a same-typed column
in publish_intents. The whitelist of 16 columns is derived from
the Creator wizard's pre-encryption field set (title, description,
category, file_name, file_size, mime_type, channel, price,
currency_address, currency_symbol, copies, access_method,
reseller_cut, royalty_partners, thumbnail_cid, adult).
Behavioural assertions (in-memory SQLite, exact migration-34 DDL):
- Default status is 'draft' (resumeFromIntent guards on this).
- CHECK constraint accepts all 4 legal statuses and rejects everything
else (including 'minted', 'DRAFT', empty string — typoed statuses
must NOT silently persist).
- State machine transitions draft → handed_off → consumed work, and
the consumed_draft_id back-pointer is preserved (the NR-4 audit
trail requirement: every minted asset whose origin was an agent
intent retains a link to the publish_drafts row that finalised it).
- consumed → anything is rejected (terminal state).
Out of scope
------------
The test does NOT compare encrypted-blob bytes between agent-resumed
and manually-filled mints — that requires a browser env + the
@elacity-js/access SDK and lives in the on-chain smoke harness
(.github/workflows/smoke-test.yml when it grows a creator-mint stage).
Field-equivalence + state-machine integrity is the strongest unit-
level assertion possible and is sufficient to gate v1.3.0 ship.
Test result: 21/21 pass via `npm run test:unit` from pc2-node/.
- 7 new NR-4 assertions
- 14 pre-existing assertions (db-getsetting + setupPermissions)
README updates
--------------
- Status: Proposed → InProgress
- Mint-handoff Option A logged (decided 2026-05-20)
- All three S1 commits referenced (2f170e2 doc, bd21cbd backend,
f15b6b8 frontend, plus this test commit)
- Pre-tag remaining items: live smoke + multi-LLM verification
- Files-modified list with LOC counts and roles
Tracked in .cursor/tasks/AGENT-CREATOR-STUDIO-2026-05/PLAN.md.
Co-authored-by: Cursor <cursoragent@cursor.com>
Copy file name to clipboardExpand all lines: .cursor/tasks/AGENT-CREATOR-STUDIO-2026-05/README.md
+78-21Lines changed: 78 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,20 @@
2
2
3
3
**Task ID**: `AGENT-CREATOR-STUDIO-2026-05`
4
4
**Created**: 2026-05-20
5
-
**Status**: **Proposed** — awaiting Sasha sign-off on [`PLAN.md`](./PLAN.md) §15
5
+
**Status**: **InProgress** — S1 implementation landing on `feat/t-1-telemetry-and-support`
6
6
**Priority**: High (this is the v1.3.0 user-facing thrust per [`docs/core/ROADMAP.md`](../../../docs/core/ROADMAP.md) release-status snapshot)
7
-
**Branch**: `feat/t-1-telemetry-and-support` (this PR is doc-only; execution will fork a fresh branch after sign-off and after v1.2.8.0 ships)
7
+
**Branch**: `feat/t-1-telemetry-and-support` (continuing the active session per Sasha 2026-05-20; no fresh branch fork)
8
+
9
+
### Mint-handoff decision (PLAN.md §10)
10
+
**Option A — `[Open in Creator]` only.** Decided 2026-05-20 by Sasha. No `[Mint now]` button in the chat for S1.
11
+
Rationale: ships in ~1 week vs ~1.5–2 for Option B, halves the R5 (drift) surface, and lets us layer a `[Mint now]` button on top in S2 with one extra ticket once we have real telemetry. The Creator app is the canonical UI for wallet signing in S1.
12
+
13
+
### S1 execution status (commits on `feat/t-1-telemetry-and-support`)
-[x] NR-4 regression test (7 assertions, all passing) — `pc2-node/tests/unit/publish-intents-schema-and-mirror.test.js`
77
+
78
+
Remaining (pre-tag for v1.3.0):
79
+
-[ ] Live smoke on dev — drop a file in the side chat → talk through wizard fields → click "Open in Creator" → confirm pre-fill is identical to manual flow → mint → verify `publish_intents.status = consumed` with `consumed_draft_id` populated
80
+
-[ ] Multi-LLM verification — repeat smoke on at least 2 of {Claude-Sonnet, GPT-4o-mini, Gemini-Pro, local DeepSeek}
81
+
-[ ] CI green on `feat/t-1-telemetry-and-support` after these commits (tracking)
82
+
83
+
## Acceptance criteria (S1)
84
+
85
+
Planning:
86
+
-[x]`PLAN.md` is complete and self-contained — a contributor unfamiliar with the project can read it and understand the design
87
+
-[x] All claims about existing code cite a real file path or function name
88
+
-[x] The `publish_intents` vs `publish_drafts` correction is clearly explained
89
+
-[x] Option A vs Option B decision presented + Option A chosen
90
+
91
+
Execution (functional):
92
+
-[x] Agent-built `publish_intents` row mirrors the input-side columns of `publish_drafts` byte-for-byte (NR-4 enforced by static + behavioural tests)
93
+
-[x] State machine `draft → handed_off → consumed` works and the `consumed_draft_id` back-pointer preserves the audit trail
94
+
-[x] Mint pipeline UNCHANGED — the Creator app's encrypt + opRawData + sign + mint code path is the same whether the user dropped a file manually or came in via `resumeIntent`
95
+
-[x] Mode picker doesn't affect General-mode behaviour (system prompt only injected when monetisation mode is active)
96
+
-[ ]**Live smoke** — see implementation plan above (pre-tag gate)
55
97
56
98
## Files in this task folder
57
99
58
100
-[`PLAN.md`](./PLAN.md) — the design document
59
101
-[`README.md`](./README.md) — this file
60
102
61
-
## Files to modify (execution ticket, not this one)
103
+
## Files modified (S1 execution, all on `feat/t-1-telemetry-and-support`)
To be specified in the execution follow-up ticket once Option A vs Option B is decided. The expected surface area (Option A) is summarised in `PLAN.md` §4 — six things, no more.
-Doc-only PR — no runtime tests apply. Lint check (`ReadLints`) on the markdown files only
68
-
-Internal links resolve; no references to the parked AGENTIC-PC2-MONETISATION mandate
69
-
-All cross-references to other PC2 paths (`pc2-node/...`, `src/gui/...`, `packages/access/...`) point to files that actually exist on the current branch
125
+
-**Unit**: `npm run test:unit` — 21/21 passing (includes the 7 new NR-4 assertions). Run from `pc2-node/`.
126
+
-**Static analysis**: `tsc --noEmit` clean across the full pc2-node project. ESLint clean on all touched files.
127
+
-**Live smoke** (pre-tag, not yet run): drop a file in the side chat in Monetisation mode → talk through fields → `[Open in Creator]` → confirm pre-fill identical to manual flow → mint → verify `publish_intents.status = consumed` with `consumed_draft_id` populated.
70
128
71
129
## Notes
72
130
73
-
- This ticket replaces the **AGENTIC-PC2-MONETISATION-2026-05** mandate as the v1.3.0 driving plan, per Sasha 2026-05-19. The AGENTIC mandate document is parked, not deleted, for historical context
74
-
- Branch hygiene: this doc-only PR lands on `feat/t-1-telemetry-and-support` because that's where the active session is. Execution branches separately **after** v1.2.8.0 is tagged
75
-
- The 4-line uncommitted edit to `docs/core/ROADMAP.md` (a leftover from the prior session's housekeeping pass) is committed alongside this task's PLAN.md + README.md in a single doc-only PR
76
-
- Cursor session continuity: this task is the resumption point after the prior session paused mid-execution. The synthesis source-of-truth is `/Users/mtk/.cursor/plans/agent-creator-studio_2cc543fd.plan.md` (read-only); `PLAN.md` here is its expanded, code-cited, sign-off-ready form
131
+
- This ticket replaces the **AGENTIC-PC2-MONETISATION-2026-05** mandate as the v1.3.0 driving plan, per Sasha 2026-05-19. The AGENTIC mandate document is parked, not deleted, for historical context.
132
+
- Branch hygiene: S1 lands on `feat/t-1-telemetry-and-support` per Sasha 2026-05-20 ("we are not trying to switch or create a new branch"). The v1.2.8.0 release path is unblocked — none of these commits touch the v1.2.8.0 telemetry/Health-app surface.
133
+
- Cursor session continuity: this task is the resumption point after the prior session paused mid-planning. `PLAN.md` here is the expanded, code-cited, sign-off-ready form.
0 commit comments