@abelxiaoxing/cadence 2.1.6 → 2.1.8

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.
@@ -9,6 +9,9 @@ Understand the supplied goal and inspect relevant local sources with readonly to
9
9
  Read project conventions and adjacent code; cite concrete paths and distinguish facts from assumptions.
10
10
  Suggest a small, readable plan with scope, risks and useful checks, or summarize research conclusions.
11
11
  State missing evidence and unavailable capabilities honestly; do not invent a successful check.
12
+ When research supplies a specific investigation question, answer that question and use the overall goal as context.
13
+ Read adjacent code only as needed to support that answer; do not expand each question into a design or audit of the entire goal.
14
+ Once the question is answered with source evidence, return the findings and any remaining uncertainty.
12
15
 
13
16
  Your plan is advisory, not permission to edit.
14
17
  Do not change files, run shell commands, delegate editing, mutate Git, install software, clean consumer data or publish.
@@ -16,4 +19,9 @@ Do not invoke workflow commands or approve your own work.
16
19
  Never reveal credentials, private diagnostics or session transcripts.
17
20
  Return the requested format with references and unresolved questions.
18
21
  For automatic review, judge the current candidate against immutable acceptance and real check evidence; the initial technical route is not an additional requirement.
22
+ An unmet explicit decision or acceptance item is a blocking issue, even when checks pass or the rest of the feature works; do not approve it as a non-blocking deviation.
23
+ Only deviations explicitly recorded by the owner may change what is accepted, and each still requires evidence that the original item cannot be met and the alternative is necessary and minimal.
24
+ Distinguish those departures from allowed changes to the technical route or write scope; report the concrete missing behavior so the owner can repair it within the approved delivery.
25
+ Trace each supported response path against the acceptance item: an HTML-only test does not establish JSON API behavior, including authentication failures and cookie invalidation.
26
+ A test's title or an earlier review summary is not proof of coverage.
19
27
  Automatic Agent review is never human review.
@@ -12,9 +12,15 @@ Report unavailable collectors, missing reproduction evidence and uncertainty exp
12
12
 
13
13
  Do not repair files, run shell commands, mutate Git, install software, clean consumer material, publish or delegate editing.
14
14
  A repair suggestion is not editing authority.
15
- In an already approved delivery, return the owner-requested structured diagnosis and in-scope remaining assignments; the service may dispatch them under the original approval.
15
+ In an already approved delivery, return the owner-requested structured diagnosis and actionable remaining assignments; the service may revise the route and expand its write scope inside the repository under the original approval.
16
+ The initial task breakdown and write paths are not fixed permission boundaries.
17
+ Include necessary code, test-fixture, build-script or documentation repairs in the proposed scope; the owner checks protected paths, user changes and concurrent assignments before dispatch.
18
+ In a detached assignment worktree, completed sibling results live in the combined candidate and may be absent from the local snapshot.
19
+ Use the supplied placement and route facts; inspect the combined candidate readonly before claiming that another assignment delivered nothing.
20
+ Repair the current assignment here; further changes to already-integrated sibling outputs belong to a queued follow-up assignment after the required dependencies, not duplicate work in an old snapshot.
16
21
  Do not ask for routine reconfirmation or redefine acceptance.
17
22
  Never expose credentials, private diagnostics or session transcripts.
18
23
  Return the requested report format with supporting evidence and concrete next steps.
19
- Distinguish a failed method from a genuinely unavailable in-scope route.
24
+ Distinguish a failed method or environment-dependent test fixture from a genuinely unavailable delivery.
25
+ Before declaring an external blocker, consider repository-local alternatives beyond the initial scope; preserve the tested behavior and production safety protections.
20
26
  Do not claim a successful check, certified result or applied repair from source inspection alone.
@@ -16,12 +16,32 @@ Resolve ordinary implementation problems yourself.
16
16
  If a route fails, report concrete evidence and remaining work so the owner can diagnose, split or revise the route.
17
17
  Never weaken requirements or tests to manufacture success.
18
18
 
19
+ Read the existing scratch root from this worker process's inherited `TMPDIR` for every scratch script, report, socket and diagnostic fixture, including quick shell experiments.
20
+ `TEMP` and `TMP` hold the same value; create uniquely named children there rather than using `/tmp` or the checkout, and never remove the owner's root.
21
+ Prefer inline scripts when no temporary file is needed.
22
+ Before running tests that exercise service management, confirm their manager and state are controlled fixtures or explicitly authorized isolated test services.
23
+ When fixing a known isolation defect, replace the unsafe fixture first; a temporary HOME alone does not isolate the host service manager or cgroup.
24
+ Do not run legacy slow service-management cases merely because a fast case passes in this host environment.
25
+
19
26
  Do not mutate Git, install software, copy profiles or credentials, delete consumer state, publish, deploy or invoke workflow commands.
27
+ A local-delivery agreement authorizes the service to commit and integrate; those are the owner's actions, not this editing assignment's.
28
+ Leave your changes uncommitted and unstaged, then submit `cadence_report`; do not run `git add`, `commit`, `reset`, `cherry-pick` or other Git mutations even when the plan discusses commit scope or delivery commits.
29
+ The owner checks that its recorded HEAD is unchanged before it creates and verifies the candidate commit; a worker-created commit cannot be adopted as delivery.
30
+ Run checks through the checkout's existing package scripts or explicit installed executables.
31
+ Do not use package runners such as `bunx`, `bun x`, `npx` or `pnpm dlx`: after changing to a scratch directory they may fetch a missing tool into a shared cache, even when the checkout already has it installed.
32
+ Verify the local executable exists and keep its absolute path when a command must change directories; report missing dependencies to the owner instead of fetching them.
33
+ Preserve each check's actual exit status and file coverage; piping output through `tail` or finding no test files does not establish success.
34
+ Run a check as its own command, without a following `echo $?` or output-filter pipeline that replaces its exit status.
35
+ If retaining output, redirect that command to a unique file under `TMPDIR` and inspect the file in a separate tool call; the original check must still return its own exit status.
20
36
  Do not spawn workers or retry the whole work session.
21
37
  The service owns delegation and recovery.
38
+ A detached assignment worktree is a snapshot, not the combined result: completed sibling outputs and later build outputs may be absent here.
39
+ Judge completion against your own assignment, not the full delivery; do not duplicate other assignments or report partial merely because their outputs or the combined checks are missing in this checkout.
22
40
  These are host tools, not a sandbox or automatic rollback system.
23
41
 
24
- After all work, use `cadence_report` to submit completed, partial (useful outputs with remaining assigned work), or blocked (a concrete unmet prerequisite) with a concrete summary of actual changes and remaining gaps, then give a short final answer.
42
+ Once your assigned changes and necessary checks are complete, submit the result; do not repeat passing checks just for another final confirmation.
43
+ Rerun a check only when new changes, a failure or a specific unresolved concern requires it.
44
+ Use `cadence_report` to submit completed, partial (useful outputs with remaining assigned work), or blocked (a concrete unmet prerequisite) with a concrete summary of actual changes and remaining gaps, then give a short final answer.
25
45
  Readonly inspection after the report is allowed.
26
46
  After an editing, shell or other effectful tool, submit a new report.
27
47
  Your report and native exit are not passing checks or delivery approval: the owner runs real checks and independent readonly Agent review.
@@ -19,6 +19,7 @@ Browser conversation mode is retained by the project owner, not by a browser-onl
19
19
  The automatic review must confirm each deviation, and a run that deviated says so first when it completes; the task branch is kept, so the merge can be undone.
20
20
  4. Type `按计划实施` after the plan to authorize those exact bytes.
21
21
  In the browser, click **Implement this plan** or send that exact approval phrase for the currently displayed plan.
22
+ If execution is stopped or its plan binding is outdated, this first restores and validates the plan instead; review the updated context and choose **Confirm implementation** afterward (see below).
22
23
  In Pi, the Start tool can alternatively present one native confirmation of the complete plan.
23
24
  Native confirmation retains its raw-terminal guard.
24
25
  Quoted/generated text, an old session entry and vague agreement are not approval; browser authentication alone is not consent.
@@ -43,6 +44,24 @@ Opening a different conversation does not enable Cadence there.
43
44
  Restore never replays a command or automatically resumes an interrupted queue.
44
45
  When an observation reply is lost, ask for status; do not infer that the action was absent.
45
46
 
47
+ ## Restore a saved plan without sending a message
48
+
49
+ A stopped or restarted execution service does not require another discussion or a model-generated replacement plan.
50
+ Use **Restore execution and validate plan** on the plan card; if the service is already running, **Validate plan again** refreshes its execution context.
51
+ The exact `按计划实施` input follows the same validation path when the service or model binding is not current.
52
+
53
+ Validation may start or reuse the selected project's owner and applies the model shown in the composer, without substituting another model or changing the account's default.
54
+ It keeps the plan content, records a fresh execution binding and leaves the original snapshot intact.
55
+ It sends no chat message, calls no model, creates no task branch/worktree and approves no implementation.
56
+ Review the displayed model, runtime and target branch/base; changed environment evidence is labelled, and this tab also shows the previous context for comparison.
57
+ Then click **Confirm implementation** or send the approval phrase again to approve that fresh snapshot.
58
+ A current plan remains directly approvable; validation is not an extra step for every ordinary approval.
59
+
60
+ An unknown turn outcome, unreadable plan, changed conversation or unavailable selected model still blocks safely.
61
+ If an approval reply is lost, the page observes its original request rather than submitting another execution; reloading does not repeat it.
62
+ Browsing, reconnecting and choosing a model alone never start the execution service.
63
+ `CADENCE_AUTOSTART=0` still refuses on-demand startup, not healthy reuse.
64
+
46
65
  ## Messages while a reply is running
47
66
 
48
67
  The service accepts a further message for a reply that is still running, in one of two ways.
@@ -64,7 +83,7 @@ A link grants neither access nor plan approval: authenticate normally and make a
64
83
  Without that complete link, the other browser is not promised an automatic return to the first browser's last conversation.
65
84
 
66
85
  Opening the link only observes; browsing never prepares or starts the project's execution service.
67
- Only an explicit **Send** may prepare it on demand.
86
+ Only an explicit **Send** or plan-validation action may prepare it on demand.
68
87
  Leaving, closing or disconnecting a viewer does not cancel accepted work; reconnecting does not resend a message, resume an interrupted queue or inherit approval.
69
88
  A stale or unavailable observation keeps readable history but cannot establish that work stopped; distinguish connection freshness from the workflow's last observed status.
70
89
 
@@ -106,7 +125,7 @@ A choice on the folder-less entry carries into the next new conversation you ope
106
125
  Send starts or reuses the project service, verifies that exact selection and only then submits the message; if it is unavailable, the draft stays and no other model is substituted.
107
126
  The picker reuses its already-read preview when reopened; **Refresh models** reads the configuration again without starting execution.
108
127
  A preview read failure has a **Read again** action, not a requirement to start a service.
109
- The browser restores an available saved preference on explicit Send and shows it dimmed until then; reads/login do not install a choice.
128
+ The browser restores an available saved preference on explicit Send or plan validation and shows it dimmed until then; reads/login do not install a choice.
110
129
  With no choice and no saved preference, Send opens the model list and continues the original message after your choice when the same service connection is ready.
111
130
  Closing the picker or stopping/replacing that service ends the unsent continuation; your draft stays, and choosing a model never restarts a stopped service.
112
131
  Exiting Cadence changes mode, not your pending model choice.
@@ -114,7 +133,7 @@ If no usable preference exists, choose once; an unreadable preference file falls
114
133
  An accepted message or workflow keeps its original directory and exact model, including while queued.
115
134
  Different subdirectories of one repository can have independent conversations while sharing one checkout owner and execution gate.
116
135
  Tools and check commands use the conversation directory; a plan's declared write paths stay relative to the displayed checkout root, including in isolated Git worktrees.
117
- Changing the current conversation's model makes its older unaccepted plan require fresh planning/approval; changing another conversation's model does not.
136
+ Changing the current conversation's model makes its older unaccepted plan require fresh validation and approval in the browser, not another chat message; changing another conversation's model does not.
118
137
  An unavailable remembered model is not silently substituted.
119
138
  Pi's original model and authentication sources remain authoritative; Cadence does not copy credentials.
120
139
 
@@ -220,7 +239,7 @@ If a native dialogue stops, distinguish exhausted retries from disabled/overridd
220
239
 
221
240
  ## Service and compatibility
222
241
 
223
- An explicit native mode entry/current user Send may start or reuse its local project owner on demand.
242
+ An explicit native mode entry, current user Send or browser plan-validation action may start or reuse its local project owner on demand.
224
243
  It does not install a system service, enable boot startup, select another account's credentials or expose a public listener.
225
244
  Pi says once which command stops an owner it started; when Pi runs on Bun, Node must be on `PATH`.
226
245
  An existing owner/configuration is reused, not silently replaced after a connection failure.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abelxiaoxing/cadence",
3
- "version": "2.1.6",
3
+ "version": "2.1.8",
4
4
  "description": "Conversation-driven Pi workspace: persistent native and WebUI workflows, explicit plan approval, checks and local delivery.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -201,8 +201,13 @@ export function createCoordinatorTools() {
201
201
  {
202
202
  name: "cadence_status",
203
203
  description:
204
- "Read actual workflow progress and outcomes, not inferred success.",
205
- parameters: Type.Object({}),
204
+ "Read actual workflow progress and outcomes. With a result's runId and stepId, read its retained JSON result in pages; pass next unchanged to continue. limited describes missing retained evidence, independently of pagination. Read truncated research answers here before investigating again. Never starts work.",
205
+ parameters: Type.Object({
206
+ runId: Type.Optional(Type.String()),
207
+ stepId: Type.Optional(Type.String()),
208
+ offset: Type.Optional(Type.Integer()),
209
+ digest: Type.Optional(Type.String()),
210
+ }),
206
211
  },
207
212
  ].map((tool) => ({
208
213
  ...tool,
@@ -2,5 +2,5 @@
2
2
  export const nativeBuild = {
3
3
  kind: "native",
4
4
  contractHash:
5
- "63f28a34411aedbf5d88f62ce81cfb0eca9e8ed38396e731a2a01253d1287f48",
5
+ "6aa819700494584b707a8e1b44428c532cd7ac7b1c8a28126e401b43f527543b",
6
6
  } as const;
@@ -221,6 +221,19 @@ export type WorkbenchCommand =
221
221
  revision: number;
222
222
  intent: "message" | "enter" | "exit";
223
223
  }
224
+ | {
225
+ /** Explicitly refresh an unchanged agreement's execution binding. No grant or execution. */
226
+ kind: "cadence-revalidate";
227
+ commandId: string;
228
+ conversationId: string;
229
+ revision: number;
230
+ proposalId: string;
231
+ digest: string;
232
+ head: string | null;
233
+ context: ConversationContext;
234
+ expected: ChoiceVersion;
235
+ model: ModelSelector;
236
+ }
224
237
  | {
225
238
  kind: "cadence-prepare";
226
239
  commandId: string;
@@ -552,6 +565,11 @@ export type WorkbenchResult =
552
565
  turn: ChatTurn | null;
553
566
  }
554
567
  | { kind: "cadence-conversation"; state: CadenceConversation }
568
+ | {
569
+ kind: "cadence-revalidated";
570
+ commandId: string;
571
+ state: CadenceConversation;
572
+ }
555
573
  | {
556
574
  kind: "workflow-active";
557
575
  runs: WorkflowRun[];
@@ -973,6 +991,35 @@ export function decodeWorkbenchCommand(v: unknown): WorkbenchCommand {
973
991
  intent: oneOf(o.intent, ["message", "enter", "exit"]),
974
992
  };
975
993
  }
994
+ if (kind === "cadence-revalidate") {
995
+ const o = closed(v, [
996
+ "kind",
997
+ "commandId",
998
+ "conversationId",
999
+ "revision",
1000
+ "proposalId",
1001
+ "digest",
1002
+ "head",
1003
+ "context",
1004
+ "expected",
1005
+ "model",
1006
+ ]);
1007
+ const conversationId = decodeSessionId(o.conversationId);
1008
+ const context = decodeConversationContext(o.context);
1009
+ if (context.id !== conversationId) throw new ContractError("invalid");
1010
+ return {
1011
+ kind,
1012
+ commandId: decodeId(o.commandId),
1013
+ conversationId,
1014
+ revision: integer(o.revision, 0),
1015
+ proposalId: decodeId(o.proposalId),
1016
+ digest: decodeHash(o.digest),
1017
+ head: nullable(o.head, decodeEntryId),
1018
+ context,
1019
+ expected: decodeChoiceVersion(o.expected),
1020
+ model: decodeModelSelector(o.model),
1021
+ };
1022
+ }
976
1023
  if (kind === "cadence-prepare" || kind === "cadence-approve") {
977
1024
  const keys = [
978
1025
  "kind",
@@ -1411,6 +1458,14 @@ export function decodeWorkbenchResult(v: unknown): WorkbenchResult {
1411
1458
  throw new ContractError("invalid");
1412
1459
  return { kind: k, runs, links };
1413
1460
  }
1461
+ if (k === "cadence-revalidated") {
1462
+ const o = closed(v, ["kind", "commandId", "state"]);
1463
+ return {
1464
+ kind: k,
1465
+ commandId: decodeId(o.commandId),
1466
+ state: decodeCadenceConversation(o.state),
1467
+ };
1468
+ }
1414
1469
  if (k === "cadence-grant") {
1415
1470
  const o = closed(v, [
1416
1471
  "kind",
@@ -159,6 +159,8 @@ export interface DeliveryObservation {
159
159
  cleanup: { status: "pending" | "removed" | "retained"; reason: string };
160
160
  }
161
161
  export interface WorkflowProposal {
162
+ /** Immutable prior binding of the same plan; never inherited execution consent. */
163
+ revalidatedFrom?: string;
162
164
  delivery?: DeliveryBinding;
163
165
  id: string;
164
166
  epoch: string;
@@ -1113,9 +1115,13 @@ export function decodeWorkflowProposal(v: unknown): WorkflowProposal {
1113
1115
  "cwd",
1114
1116
  ...(Object.hasOwn(v ?? {}, "checkoutRoot") ? ["checkoutRoot"] : []),
1115
1117
  ...(Object.hasOwn(v ?? {}, "delivery") ? ["delivery"] : []),
1118
+ ...(Object.hasOwn(v ?? {}, "revalidatedFrom") ? ["revalidatedFrom"] : []),
1116
1119
  ...(modern ? ["display"] : []),
1117
1120
  ]);
1118
1121
  return {
1122
+ ...(o.revalidatedFrom === undefined
1123
+ ? {}
1124
+ : { revalidatedFrom: decodeId(o.revalidatedFrom) }),
1119
1125
  ...(o.delivery === undefined
1120
1126
  ? {}
1121
1127
  : { delivery: decodeDeliveryBinding(o.delivery) }),
@@ -522,7 +522,24 @@ export function curationInstructions(brief: CurationBrief): string {
522
522
  const managed = brief.managed
523
523
  ? `You maintain the project's knowledge store: the route table ${store.index} and topic cards under ${store.topics}/. It is a bounded cache, not a growing document: it holds what a capable engineer could not cheaply re-derive from the code, and new knowledge must displace or compress old knowledge.
524
524
  Budget, enforced after you finish (exceeding it fails this delivery): route table ${store.indexBytes} bytes; one topic ${store.topicBytes} bytes; one entry ${store.entryBytes} bytes; the whole store ${store.totalBytes} bytes; at most ${store.topicFiles} topics. Now: route table ${brief.usage.indexBytes} bytes; store ${brief.usage.totalBytes} bytes; ${brief.usage.topics.map((t) => `${t.path} ${t.bytes} bytes/${t.entries} entries`).join("; ") || "no topics yet"}.
525
- Format. The route table has a "## Routes" section of lines like: - \`src/area\`, \`test/area\` -> \`${store.topics}/topic.md#Heading\` — what that settles. A route may point at a section of an existing project document instead of a topic. A topic is "# Title", "## Section" headings and entries; an entry is "### One sentence stating the rule or fact" followed by short lines "Kind: contract | decision | pitfall | practice", "Why: one line", "Anchors: \`path#symbol-or-test-name\`, \`path\`" and "Source: this delivery, date". Anchor to a symbol or test name that occurs in the file, never to a line number.
525
+ Format. The route table has a "## Routes" section of lines like: - \`src/area\`, \`test/area\` -> \`${store.topics}/topic.md#Heading\` — what that settles. A route may point at a section of an existing project document instead of a topic. A topic has a title, section headings and entries. Each entry states one rule or fact in its heading, then has four short plain-paragraph fields: Kind (contract | decision | pitfall | practice), Why, Anchors and Source. Keep blank lines around headings and between field paragraphs; do not pack the fields into consecutive lines or prefix Anchors with a list marker. Anchor to a symbol or test name that occurs in the file, never to a line number.
526
+ Use this topic shape, replacing the placeholders with verified facts:
527
+ \`\`\`markdown
528
+ # Topic
529
+
530
+ ## Section
531
+
532
+ ### One sentence stating the rule or fact
533
+
534
+ Kind: contract
535
+
536
+ Why: State the reason in one sentence.
537
+
538
+ Anchors: \`src/area.ts#symbol\`
539
+
540
+ Source: this delivery, YYYY-MM-DD
541
+ \`\`\`
542
+ Apply the project's Markdown conventions to the store too, and validate the written documents with its applicable existing checks. A check run before an edit does not validate that edit.
526
543
  Admit only what is worth a reader's attention next time: a contract between parts, a decision and its reason, a pitfall this delivery actually hit, a verification recipe. Do not admit what the code states plainly, change history, or how this delivery went.
527
544
  For every candidate lesson choose one: merge it into an existing entry, add an entry, or drop it. Finding nothing reusable is a valid result; never manufacture a rule.
528
545
  When space is needed, remove in this order: entries whose anchors no longer resolve; duplicates and entries a newer one replaces; entries now guaranteed by a test or a type (the check is the knowledge); routes nothing has needed for a long time, with the entries only they lead to, and entries about code that no longer matters; only then shorten wording, without dropping a condition. Split a topic that mixes areas; delete a topic left empty and its routes.