@awak-app/simy-cli 0.5.16 → 0.5.18

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 (37) hide show
  1. package/README.md +61 -13
  2. package/package.json +2 -2
  3. package/src/cli-contract.js +1 -1
  4. package/src/codex-plugins/simy/.codex-plugin/plugin.json +5 -6
  5. package/src/console/app.js +2 -2
  6. package/src/desktop-host.js +1 -1
  7. package/src/desktop-process-lock.js +41 -4
  8. package/src/desktop-stop-conflicts.js +17 -0
  9. package/src/orchestrator/budget.js +1 -1
  10. package/src/orchestrator/checklist-continuation.js +21 -0
  11. package/src/orchestrator/completion-contract.js +1 -1
  12. package/src/{codex-plugins/simy/skills/agentic-delivery-loop/SKILL.md → orchestrator/delivery/WORKFLOW.md} +65 -13
  13. package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/references/acceptance-evidence.md +27 -3
  14. package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/references/change-boundary-matrix.md +1 -1
  15. package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/references/delivery-levels.md +78 -27
  16. package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/references/minimum-completion.md +3 -3
  17. package/src/orchestrator/delivery/references/pr-closure.md +203 -0
  18. package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/references/state-and-receipts.md +4 -1
  19. package/src/orchestrator/delivery/references/ux-specification.md +98 -0
  20. package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/scripts/production-contract.mjs +1 -1
  21. package/src/orchestrator/delivery-level.js +19 -0
  22. package/src/orchestrator/independent-audit.js +8 -0
  23. package/src/orchestrator/instruction.js +11 -2
  24. package/src/orchestrator/loop.js +1 -1
  25. package/src/orchestrator/minimum-completion.js +2 -2
  26. package/src/orchestrator/pr-closure.js +26 -0
  27. package/src/orchestrator/presentation.js +2 -2
  28. package/src/orchestrator/result.js +2 -2
  29. package/src/orchestrator/ux-specification.js +20 -0
  30. package/src/runner.js +12 -0
  31. package/src/codex-plugins/simy/skills/agentic-delivery-loop/agents/openai.yaml +0 -5
  32. /package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/references/chrome-user-verification.md +0 -0
  33. /package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/references/cross-repository-control.md +0 -0
  34. /package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/references/local-sqm-evidence.md +0 -0
  35. /package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/references/shared-system-specifications.md +0 -0
  36. /package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/scripts/check-acceptance.mjs +0 -0
  37. /package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/scripts/check-minimum-completion.mjs +0 -0
package/README.md CHANGED
@@ -56,6 +56,11 @@ platform installations and refreshes an already enabled SIMY Codex plugin throug
56
56
  receive a fresh cache. Use a new Codex task to pick up updated skills; running
57
57
  tasks are not restarted. Missing or disabled plugins are not enabled automatically.
58
58
  Failed refreshes retry on the next check without blocking daemon startup.
59
+ Delivery Loop is a SIMY Web/CLI runtime workflow, not a local Codex skill.
60
+ The plugin ships only SQM and PR review. Updating to this release removes the
61
+ previously bundled Delivery Loop from managed plugin sources and refreshes the
62
+ enabled cache. Older running CLI releases can restore their old bundled skill
63
+ until upgraded; deleting a local skill alone does not change their updater.
59
64
  `--no-auto-update` or `SIMY_AUTO_UPDATE=0` disables these background updates too;
60
65
  `--no-workflow-prompt` only suppresses the initial installation prompt.
61
66
 
@@ -274,7 +279,7 @@ is not copied into the recovery contract.
274
279
  ## Provider token budget
275
280
 
276
281
  Each run accepts a configurable `token_budget` (or the explicit
277
- `provider_token_budget` alias) from 1 to 10,000,000 Provider tokens. The default
282
+ `provider_token_budget` alias) from 1 to 15,000,000 Provider tokens. The default
278
283
  is 250,000. Provider tokens are the Codex or Claude Code usage reported for the
279
284
  run; they are a safety limit and are not billed as SIMY tokens.
280
285
 
@@ -284,6 +289,12 @@ limit. SIMY Web can edit that suggestion and call
284
289
  `provider_token_budget`. The CLI persists the higher limit and resumes the same
285
290
  run. SIMY token consumption remains a separate platform billing record.
286
291
 
292
+ An in-flight provider call can report usage above the previous limit. Recovery
293
+ keeps that full usage history, including reported cached input; it never resets
294
+ the counter or increases the limit automatically. An explicitly approved higher
295
+ limit must exceed usage already recorded and remain within the finite cap.
296
+ Retry limits and all completion gates still apply after a budget increase.
297
+
287
298
  ## SQM local checks
288
299
 
289
300
  SQM deliberately has two identity-bound stages:
@@ -443,42 +454,79 @@ organization-wide bundle.
443
454
 
444
455
  Every CLI coding-loop promotion now requires a current two-layer observation
445
456
  matrix: the requested operation and result, plus independently checked final
446
- postcondition and integration. See the [minimum completion contract](src/codex-plugins/simy/skills/agentic-delivery-loop/references/minimum-completion.md)
457
+ postcondition and integration. See the [minimum completion contract](src/orchestrator/delivery/references/minimum-completion.md)
447
458
  for the executable format. Missing mappings, mismatching observations, changed
448
459
  artifacts or stale revisions block promotion even when the executor reports
449
460
  success. Independent review checks original-request coverage and the test oracle.
450
461
 
451
462
  Existing v2 run history is retained; resumed/rechecked runs need the new evidence.
452
- The same checker ships in the standalone Delivery Loop skill, but it does not
453
- control the host's final response or establish deployment completion.
463
+ The same checker ships under `src/orchestrator/delivery/scripts/` in the CLI
464
+ package, independent of Codex plugin installation. It does not establish deployment
465
+ completion or intercept another host application's final response.
466
+
467
+ ### PR closure and user-outcome transfer
468
+
469
+ The Web/CLI executor and independent auditor receive the same
470
+ [PR closure procedure](src/orchestrator/delivery/references/pr-closure.md).
471
+ It requires a revision-bound before/after table, reachable normal-user paths
472
+ (including no-workflow fallback), independent review, explicit authority,
473
+ pre-close freshness checks and post-close remote reconciliation. A file match or
474
+ successor link is not proof of UX inheritance; administrative transfer, approved
475
+ retirement and complete inheritance have distinct decisions. Unresolved yellow/red comparison rows require
476
+ remediation PRs (or exact existing open equivalents), mapped by criterion ID,
477
+ owner and acceptance checks. Uncreated plans or unresolved authority/product
478
+ decisions block transfer completion; creating a PR does not make a row green.
479
+ Closure is not a new delivery completion state. This is runtime instruction and review guidance,
480
+ not a GitHub hook that mechanically intercepts every external close command.
454
481
 
455
482
  ### Submit repaired local delivery evidence to SQM
456
483
 
457
484
  The bundled Delivery Loop maintains an external acceptance checklist with separate
458
485
  user-journey and technical-invariant results. It refreshes the table after each
459
486
  evaluated action and marks evidence pending when the code or runtime context
460
- changes. The [acceptance evidence guide](src/codex-plugins/simy/skills/agentic-delivery-loop/references/acceptance-evidence.md)
461
- documents the offline validator shipped inside the skill. Its result establishes
487
+ changes. A non-green table is a checkpoint, not completion: the executor must
488
+ perform feasible authorized repairs, missing verification and bounded waits,
489
+ then re-observe and update the same criteria until the requested endpoint passes.
490
+ A genuine safety/authority/dependency/budget stop remains explicitly unfinished
491
+ with affected IDs and a concrete resumption condition; no automatic budget increase
492
+ or background monitor is implied. Both executor and independent auditor receive
493
+ this continuation contract. The [acceptance evidence guide](src/orchestrator/delivery/references/acceptance-evidence.md)
494
+ documents the offline validator shipped inside the CLI runtime. Its result establishes
462
495
  record completeness and artifact integrity, not overall delivery or deployment.
463
496
  At the start of each new run, the loop recommends and confirms one of five
464
- [delivery levels](src/codex-plugins/simy/skills/agentic-delivery-loop/references/delivery-levels.md)
465
- in chat. Risk-based ceilings keep sensitive or consequential changes on the
466
- required safety level; the selection adjusts verification depth but grants no
467
- additional authority.
497
+ [delivery levels](src/orchestrator/delivery/references/delivery-levels.md)
498
+ in chat. Level 5 is highest assurance; level 1 is lightest. Every selection or
499
+ recommendation shows all five levels (5 to 1), their content and verification scope,
500
+ task-specific hour estimates, and the recommended level with its rationale.
501
+ Estimates distinguish execution from external waits and state assumptions and
502
+ uncertainty; there are no fixed durations by level. Risk-based floors preserve
503
+ mandatory assurance. Historical selections retain their numbering version and
504
+ meaning. These are executor/auditor instructions, not a new deterministic CLI
505
+ selection validator; selecting a level grants no additional authority.
468
506
 
469
507
  `simy sqm submit-evidence --file delivery.json --host https://app-dev.simy.one`
470
508
  submits an explicit bounded summary through your existing organization-bound device
471
509
  session. `--dry-run` previews the exact document without uploading it. See the
472
- [local evidence contract](src/codex-plugins/simy/skills/agentic-delivery-loop/references/local-sqm-evidence.md).
510
+ [local evidence contract](src/orchestrator/delivery/references/local-sqm-evidence.md).
473
511
  The receipt identifies the source digest and analysis job; it is not a declaration
474
512
  that an incident or blocking rule has been published.
475
513
 
476
514
  ## Delivery Loop shared specification
477
515
 
516
+ UX descriptions throughout the Web/CLI lifecycle follow the
517
+ [behavioral-completeness standard](src/orchestrator/delivery/references/ux-specification.md).
518
+ Observable interaction units explicitly cover intent/context, entry, perception,
519
+ control, response, usable outcome, continuation, alternatives/recovery and evidence.
520
+ Independent reconstruction, source coverage, causal continuity, branch closure,
521
+ observability and traceability determine sufficient detail, not word counts or
522
+ product-specific scenarios. Unknowns remain explicit; compact summaries link to
523
+ the complete canonical specification. The same standard is supplied to the actual
524
+ executor and independent auditor; it is not an additional automatic schema gate.
525
+
478
526
  The [Delivery Loop system specification](docs/systems/delivery-loop/README.md)
479
527
  explains its purpose, As-Is and proposed To-Be through twelve linked views. Keep
480
528
  these as shared team documents; each change updates affected views and checks
481
- cross-view consistency. The skill requires independent design, implementation-to-
529
+ cross-view consistency. The workflow requires independent design, implementation-to-
482
530
  To-Be and PR reviews, plus explicitly opted-in SQM before and after PR creation.
483
- The [workflow reference](src/codex-plugins/simy/skills/agentic-delivery-loop/references/shared-system-specifications.md)
531
+ The [workflow reference](src/orchestrator/delivery/references/shared-system-specifications.md)
484
532
  explains baseline updates, historical regression coverage and evidence limits.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awak-app/simy-cli",
3
- "version": "0.5.16",
3
+ "version": "0.5.18",
4
4
  "description": "Local SIMY executor for non-coding Local Tasks and Agentic Loop runs.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -40,7 +40,7 @@
40
40
  "check:auto-update": "node --check ./src/auto-update.js && node --check ./scripts/auto-update-e2e.js && npm run check:sqm",
41
41
  "check:sqm": "node --check ./src/sqm/canonical.js && node --check ./src/sqm/validation.js && node --check ./src/sqm/reliability.js && node --check ./src/sqm/repository.js && node --check ./src/sqm/checkers.js && node --check ./src/sqm/bundle-store.js && node --check ./src/sqm/proof.js && node --check ./src/sqm/evidence-client.js && node --check ./src/sqm/session.js && node --check ./src/sqm/index.js && node --check ./src/sqm/command.js && node --check ./src/sqm/agent-skill.js && node --check ./src/sqm/workflow-onboarding.js && node --check ./src/sqm/workflow-update.js && node --check ./src/sqm/review-worker.js && node --check ./scripts/sqm-complete-loop-e2e.js && node --check ./scripts/sqm-local-review-e2e.js",
42
42
  "check:real-provider-syntax": "node --check ./scripts/real-codex-probe.js && node --check ./scripts/real-claude-probe.js && node --check ./scripts/real-provider-console-fixture.js && node --check ./scripts/real-provider-console-e2e.js",
43
- "check:syntax": "node --check ./src/index.js && node --check ./src/install-update.js && node --check ./src/agent.js && node --check ./src/connection-discovery.js && node --check ./src/codex-plugins/simy/hooks/connection-reminder.mjs && node --check ./src/browser.js && node --check ./src/web-api.js && node --check ./src/durable-local-task-worker.js && node --check ./src/durable-local-task-steps-contract.js && node --check ./src/bounded-local-task-subtasks-contract.js && node --check ./src/bounded-local-task-subtask-pool.js && node --check ./src/local-task-artifact-contract.js && node --check ./src/execution-capability-contract.js && node --check ./src/shutdown.js && node --check ./src/run-registry.js && node --check ./src/direct-executor.js && node --check ./src/execution-guardrail.js && node --check ./src/backend-executable.js && node --check ./src/provider-stream.js && node --check ./src/console/index.js && node --check ./src/console/app.js && node --check ./src/console/commands.js && node --check ./src/local-attachments.js && node --check ./src/repository-inventory.js && node --check ./src/session-store.js && node --check ./src/web-origin.js && node --check ./src/workspace-context.js && node --check ./src/orchestrator/index.js && node --check ./src/orchestrator/shared.js && node --check ./src/orchestrator/recovery.js && node --check ./src/orchestrator/risk.js && node --check ./src/orchestrator/contract.js && node --check ./src/orchestrator/completion-contract.js && node --check ./src/orchestrator/pr-preparation.js && node --check ./src/orchestrator/minimum-completion.js && node --check ./src/codex-plugins/simy/skills/agentic-delivery-loop/scripts/check-minimum-completion.mjs && node --check ./src/orchestrator/instruction.js && node --check ./src/orchestrator/problem-solving.js && node --check ./src/orchestrator/budget.js && node --check ./src/orchestrator/execution-io.js && node --check ./src/orchestrator/presentation.js && node --check ./src/orchestrator/result.js && node --check ./src/orchestrator/retry.js && node --check ./src/orchestrator/evidence.js && node --check ./src/orchestrator/independent-audit.js && node --check ./src/orchestrator/audit.js && node --check ./src/orchestrator/loop.js && node --check ./src/runner.js && node --check ./scripts/fixtures/completion-contract-fixture.js && node --check ./scripts/fixtures/fake-coding-backend.js && node --check ./scripts/e2e-terminal-evidence.js && node --check ./scripts/audit-gate-e2e.js && node --check ./scripts/completion-contract-e2e.js && node --check ./scripts/retry-circuit-e2e.js && node --check ./scripts/follow-up-charter-e2e.js && node --check ./scripts/task-routing-e2e.js && node --check ./scripts/executor-version-preflight-e2e.js && node --check ./scripts/blocked-recovery-e2e.js && node --check ./scripts/process-localization-e2e.js && node --check ./scripts/hypothesis-retries-e2e.js && node --check ./scripts/budget-enforcement-e2e.js && node --check ./scripts/local-task-default-workspace-e2e.js && node --check ./scripts/local-task-idempotency-e2e.js && node --check ./scripts/console-e2e-fixture.js && node --check ./scripts/console-e2e.js && node --check ./scripts/console-recovery-e2e-fixture.js && node --check ./scripts/console-recovery-e2e.js && node --check ./scripts/real-provider-console-fixture.js && node --check ./scripts/real-provider-console-e2e.js && node --check ./scripts/fullstack-cli-smoke.js && node --check ./scripts/check-package-contents.js",
43
+ "check:syntax": "node --check ./src/index.js && node --check ./src/install-update.js && node --check ./src/agent.js && node --check ./src/connection-discovery.js && node --check ./src/codex-plugins/simy/hooks/connection-reminder.mjs && node --check ./src/browser.js && node --check ./src/web-api.js && node --check ./src/durable-local-task-worker.js && node --check ./src/durable-local-task-steps-contract.js && node --check ./src/bounded-local-task-subtasks-contract.js && node --check ./src/bounded-local-task-subtask-pool.js && node --check ./src/local-task-artifact-contract.js && node --check ./src/execution-capability-contract.js && node --check ./src/shutdown.js && node --check ./src/run-registry.js && node --check ./src/direct-executor.js && node --check ./src/execution-guardrail.js && node --check ./src/backend-executable.js && node --check ./src/provider-stream.js && node --check ./src/console/index.js && node --check ./src/console/app.js && node --check ./src/console/commands.js && node --check ./src/local-attachments.js && node --check ./src/repository-inventory.js && node --check ./src/session-store.js && node --check ./src/web-origin.js && node --check ./src/workspace-context.js && node --check ./src/orchestrator/index.js && node --check ./src/orchestrator/shared.js && node --check ./src/orchestrator/recovery.js && node --check ./src/orchestrator/risk.js && node --check ./src/orchestrator/contract.js && node --check ./src/orchestrator/completion-contract.js && node --check ./src/orchestrator/pr-preparation.js && node --check ./src/orchestrator/minimum-completion.js && node --check ./src/orchestrator/delivery/scripts/check-minimum-completion.mjs && node --check ./src/orchestrator/instruction.js && node --check ./src/orchestrator/problem-solving.js && node --check ./src/orchestrator/budget.js && node --check ./src/orchestrator/execution-io.js && node --check ./src/orchestrator/presentation.js && node --check ./src/orchestrator/result.js && node --check ./src/orchestrator/retry.js && node --check ./src/orchestrator/evidence.js && node --check ./src/orchestrator/independent-audit.js && node --check ./src/orchestrator/audit.js && node --check ./src/orchestrator/loop.js && node --check ./src/runner.js && node --check ./scripts/fixtures/completion-contract-fixture.js && node --check ./scripts/fixtures/fake-coding-backend.js && node --check ./scripts/e2e-terminal-evidence.js && node --check ./scripts/audit-gate-e2e.js && node --check ./scripts/completion-contract-e2e.js && node --check ./scripts/retry-circuit-e2e.js && node --check ./scripts/follow-up-charter-e2e.js && node --check ./scripts/task-routing-e2e.js && node --check ./scripts/executor-version-preflight-e2e.js && node --check ./scripts/blocked-recovery-e2e.js && node --check ./scripts/process-localization-e2e.js && node --check ./scripts/hypothesis-retries-e2e.js && node --check ./scripts/budget-enforcement-e2e.js && node --check ./scripts/local-task-default-workspace-e2e.js && node --check ./scripts/local-task-idempotency-e2e.js && node --check ./scripts/console-e2e-fixture.js && node --check ./scripts/console-e2e.js && node --check ./scripts/console-recovery-e2e-fixture.js && node --check ./scripts/console-recovery-e2e.js && node --check ./scripts/real-provider-console-fixture.js && node --check ./scripts/real-provider-console-e2e.js && node --check ./scripts/fullstack-cli-smoke.js && node --check ./scripts/check-package-contents.js",
44
44
  "check:package": "node ./scripts/check-package-contents.js",
45
45
  "build:macos-installer:dev": "bash packaging/build-macos-arm64.sh --unsigned-dev",
46
46
  "build:macos-installer": "bash packaging/build-macos-arm64.sh --production",
@@ -13,7 +13,7 @@ import {
13
13
  } from "./durable-local-task-steps-contract.js";
14
14
  import { buildExecutionCapabilityContract } from "./execution-capability-contract.js";
15
15
 
16
- export const CLI_VERSION = "0.5.16";
16
+ export const CLI_VERSION = "0.5.18";
17
17
  export const CLI_API_CONTRACT_VERSION = 10;
18
18
 
19
19
  export function withCliContract(
@@ -1,25 +1,24 @@
1
1
  {
2
2
  "name": "simy",
3
3
  "version": "0.1.0",
4
- "description": "Run SIMY quality, delivery, and pull request review workflows from the current Codex thread.",
4
+ "description": "Run SIMY quality and pull request review workflows from the current Codex thread.",
5
5
  "author": {
6
6
  "name": "Specialist Doctors Inc.",
7
7
  "url": "https://github.com/SpecialistDoctors-Inc"
8
8
  },
9
9
  "repository": "https://github.com/SpecialistDoctors-Inc/simy-cli",
10
10
  "license": "UNLICENSED",
11
- "keywords": ["simy", "sqm", "delivery", "pull-request"],
11
+ "keywords": ["simy", "sqm", "pull-request"],
12
12
  "skills": "./skills/",
13
13
  "interface": {
14
14
  "displayName": "SIMY",
15
- "shortDescription": "Quality, delivery, and PR workflows for SIMY.",
16
- "longDescription": "SIMY turns the current Codex thread into a bounded quality check, a full evidence-driven delivery loop, or a read-only pull request review.",
15
+ "shortDescription": "Quality and PR review workflows for SIMY.",
16
+ "longDescription": "SIMY turns the current Codex thread into a bounded quality check or a read-only pull request review. Delivery Loop runs through SIMY Web and CLI, not a local Codex skill.",
17
17
  "developerName": "Specialist Doctors Inc.",
18
18
  "category": "Developer Tools",
19
- "capabilities": ["Quality", "Delivery", "Review"],
19
+ "capabilities": ["Quality", "Review"],
20
20
  "defaultPrompt": [
21
21
  "Run the SIMY SQM Loop for the current thread.",
22
- "Run the SIMY Delivery Loop for the current thread.",
23
22
  "Review the current pull request with SIMY."
24
23
  ]
25
24
  }
@@ -96,7 +96,7 @@ export function AgenticLoopConsole({ agent, onQuit = () => {} }) {
96
96
 
97
97
  useEffect(() => {
98
98
  if (selectedRun?.status === "pr_ready_for_review") {
99
- setNotice("Review the pull request, then use /recheck to refresh readiness.");
99
+ setNotice("Unfinished: resolve the pending gates, then use /recheck to refresh readiness.");
100
100
  } else if (
101
101
  selectedRun?.status === "waiting_human" ||
102
102
  selectedRun?.controlState === "waiting_human"
@@ -1174,7 +1174,7 @@ function nextActionForRun(run, repositoryMissing = false) {
1174
1174
  return { tone: "yellow", text: "Press p to resume the local agent." };
1175
1175
  }
1176
1176
  if (run.status === "pr_ready_for_review") {
1177
- return { tone: "yellow", text: "Review the pull request, then press r to refresh its evidence." };
1177
+ return { tone: "yellow", text: "Unfinished: resolve pending gates, then press r to refresh evidence." };
1178
1178
  }
1179
1179
  if (run.status === "merge_ready") {
1180
1180
  return {
@@ -210,7 +210,7 @@ if (isDesktopHostEntry()) {
210
210
  const conflict = error?.code === PROCESS_CONFLICT_CODE;
211
211
  process.stdout.write(`${JSON.stringify({
212
212
  type: "error",
213
- ...(conflict ? { code: PROCESS_CONFLICT_CODE } : {}),
213
+ ...(conflict ? { code: PROCESS_CONFLICT_CODE, conflicts: error.conflicts || [] } : {}),
214
214
  message: conflict
215
215
  ? PROCESS_CONFLICT_MESSAGE
216
216
  : "SIMY could not start. Check whether another SIMY window is already running, then reconnect.",
@@ -10,10 +10,11 @@ export const PROCESS_CONFLICT_MESSAGE =
10
10
  "Another SIMY background service is already running for this Web address. Stop the existing CLI daemon, then reopen SIMY CLI.";
11
11
 
12
12
  export class SimyProcessConflictError extends Error {
13
- constructor(message = PROCESS_CONFLICT_MESSAGE) {
13
+ constructor(message = PROCESS_CONFLICT_MESSAGE, conflicts = []) {
14
14
  super(message);
15
15
  this.name = "SimyProcessConflictError";
16
16
  this.code = PROCESS_CONFLICT_CODE;
17
+ this.conflicts = conflicts;
17
18
  }
18
19
  }
19
20
 
@@ -96,12 +97,13 @@ export async function assertNoDesktopHostForOrigin(
96
97
  throw new SimyProcessConflictError();
97
98
  }
98
99
 
99
- export async function assertNoLegacyCliDaemon(
100
+ export async function findLegacyCliDaemons(
100
101
  webOrigin,
101
102
  {
102
103
  processes = listSameUserProcesses,
103
104
  verifyEntry = verifySimyCliEntry,
104
105
  currentPid = process.pid,
106
+ identity = processStart,
105
107
  } = {},
106
108
  ) {
107
109
  const requestedOrigin = normalizeWebOrigin(webOrigin);
@@ -113,13 +115,48 @@ export async function assertNoLegacyCliDaemon(
113
115
  "SIMY could not verify whether another CLI service is running. Stop the existing CLI daemon, then reopen SIMY CLI.",
114
116
  );
115
117
  }
118
+ const conflicts = [];
116
119
  for (const processInfo of candidates) {
117
- if (processInfo.pid === currentPid) continue;
120
+ if (!Number.isSafeInteger(processInfo.pid) || processInfo.pid <= 0 || processInfo.pid === currentPid) continue;
118
121
  const parsed = parseLegacyAgentArguments(processInfo.command ?? processInfo.args);
119
122
  if (!parsed || !(await verifyEntry(parsed.entryPath))) continue;
120
123
  if (parsed.webOrigin && parsed.webOrigin !== requestedOrigin) continue;
121
- throw new SimyProcessConflictError();
124
+ const startedAt = await identity(processInfo.pid).catch(() => null);
125
+ conflicts.push({ pid: processInfo.pid, entryPath: parsed.entryPath, startedAt });
122
126
  }
127
+ return conflicts;
128
+ }
129
+
130
+
131
+ export async function assertNoLegacyCliDaemon(webOrigin, options) {
132
+ const conflicts = await findLegacyCliDaemons(webOrigin, options);
133
+ if (conflicts.length) throw new SimyProcessConflictError(PROCESS_CONFLICT_MESSAGE, conflicts);
134
+ }
135
+
136
+ // Re-discover same-user SIMY processes and compare their start time immediately
137
+ // before signaling. A PID alone is never sufficient authorization after a dialog.
138
+ export async function stopConfirmedCliConflicts(webOrigin, approved, { force = false,
139
+ discover = findLegacyCliDaemons, signal = process.kill.bind(process),
140
+ alive = processAlive, wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
141
+ } = {}) {
142
+ if (!Array.isArray(approved) || !approved.length || approved.length > 100) throw new Error("No confirmed SIMY process.");
143
+ const stopped = [];
144
+ for (const expected of approved) {
145
+ if (!Number.isSafeInteger(expected.pid) || expected.pid <= 0 || !expected.startedAt || typeof expected.entryPath !== "string") {
146
+ throw new Error("SIMY process identity is unavailable. Refresh and try again.");
147
+ }
148
+ const current = (await discover(webOrigin)).find((item) => item.pid === expected.pid);
149
+ if (!current) continue;
150
+ if (current.startedAt !== expected.startedAt || current.entryPath !== expected.entryPath) {
151
+ throw new Error("The process changed. Refresh before stopping it.");
152
+ }
153
+ try { signal(current.pid, force ? "SIGKILL" : "SIGTERM"); }
154
+ catch (error) { if (error.code !== "ESRCH") throw error; }
155
+ stopped.push(current);
156
+ }
157
+ for (let n = 0; n < 40 && stopped.some((item) => alive(item.pid)); n++) await wait(250);
158
+ const remaining = await discover(webOrigin);
159
+ return { remaining: remaining.filter((item) => stopped.some((old) => old.pid === item.pid && old.startedAt === item.startedAt && old.entryPath === item.entryPath)) };
123
160
  }
124
161
 
125
162
  export function parseLegacyAgentArguments(args) {
@@ -0,0 +1,17 @@
1
+ import { stopConfirmedCliConflicts } from "./desktop-process-lock.js";
2
+ import { resolveWebOrigin } from "./web-origin.js";
3
+
4
+ // Invoked by the native confirmation dialog, never automatically at startup.
5
+ let input = "";
6
+ try {
7
+ for await (const chunk of process.stdin) {
8
+ input += chunk;
9
+ if (input.length > 32768) throw new Error("Confirmation is too large.");
10
+ }
11
+ const request = JSON.parse(input);
12
+ const result = await stopConfirmedCliConflicts(resolveWebOrigin(null, process.env), request.conflicts, { force: request.force === true });
13
+ process.stdout.write(JSON.stringify({ ok: true, ...result }));
14
+ } catch {
15
+ process.stdout.write(JSON.stringify({ ok: false }));
16
+ process.exitCode = 1;
17
+ }
@@ -2,7 +2,7 @@ import { clampAttempts } from "./shared.js";
2
2
 
3
3
  export const DEFAULT_TOKEN_BUDGET = 250_000;
4
4
  export const DEFAULT_RETRY_BUDGET = 2;
5
- export const MAX_PROVIDER_TOKEN_BUDGET = 10_000_000;
5
+ export const MAX_PROVIDER_TOKEN_BUDGET = 15_000_000;
6
6
  const PROVIDER_TOKEN_BUDGET_STEP = 250_000;
7
7
 
8
8
  export function resolveRunBudgets(request = {}) {
@@ -0,0 +1,21 @@
1
+ import { fileURLToPath } from "node:url";
2
+ import { section } from "./shared.js";
3
+
4
+ export const ACCEPTANCE_EVIDENCE_PATH = fileURLToPath(
5
+ new URL("./delivery/references/acceptance-evidence.md", import.meta.url),
6
+ );
7
+
8
+ export function buildChecklistContinuationInstruction({ auditor = false } = {}) {
9
+ return section("checklist_continuation_contract", [
10
+ `The table is a progress checkpoint, not the deliverable or a stopping condition. Read: ${ACCEPTANCE_EVIDENCE_PATH}`,
11
+ "Show the complete 依頼チェックリスト with columns #, ご依頼, 現状, 判定 after chartering, each evaluated attempt, and in the final receipt. Preserve stable criterion IDs, all rows and both applicable evidence layers. ✅ requires current valid passing evidence for every applicable layer; ❌ means an observed failure; 🟡 means pending, missing, stale, blocked or unverifiable evidence. Show counts and highest proven state.",
12
+ "After presenting any non-green row, classify its cause and immediately take the next safe authorized action: implement missing behavior, repair a failure, exercise an untested path, collect missing evidence, or rerun stale verification. Re-observe the same criterion against the current candidate, run the validator, update the table, and repeat until every applicable requested outcome and gate for the authorized endpoint is verified. A next-action list without performing feasible actions is not completion. Never require another continue request merely because a table was shown.",
13
+ "For CI or other in-progress dependencies, use the available bounded wait/recheck or approved monitoring mechanism and maintain progress communication. Unchanged external state is not itself a blocker. Do not start duplicate jobs or busy-poll. Recheck current revision/results, repair authorized failures, and keep waiting only within the existing time, attempt and cost limits. If waiting cannot continue, report the concrete limit and explicit resumption condition; do not silently abandon it or promise an unscheduled follow-up.",
14
+ "If a row genuinely requires new authority, credentials, a user/product decision, an unavailable dependency or an exhausted safety budget, retain it as non-green and record affected IDs, evidence of the blocker, safe alternatives attempted, exact missing input, owner and resumption trigger. Continue independent in-scope work. Stop with blocked, best_available, failed or cancelled as appropriate, explicitly unfinished, not verified_complete. Never raise budgets, bypass a stop, or expand authority to force green.",
15
+ "Do not end successfully while a safe authorized repair, verification or bounded wait remains. All-green applies to the frozen authorized endpoint: PR-only work does not authorize merge/deploy, but a PR URL, an improvement PR, an issue, a narrower test or a future plan does not satisfy an unmet outcome. Never drop/merge away rows, weaken criteria, relabel applicable checks as not_applicable, recolor unknowns, or copy new digests onto old evidence to force green. Do not change the requested endpoint to match the work already completed.",
16
+ "Before the final response, independently reconcile the original request with all criterion IDs and current evidence, check remaining endpoint gates, and display the full table and explicit disposition. Distinguish a partial artifact from verified completion and state both yellow/red counts and what remains. A pr_ready_for_review or blocked controller state is not proof of overall completion. These instructions strengthen continuation and reporting; they do not add a background scheduler or remove controller limits.",
17
+ auditor
18
+ ? "Remain read-only. Check that the executor performed feasible follow-up actions after non-green tables. Report premature stopping, omitted rows, unsupported green claims, or a blocker without evidence as findings, alongside exact criterion IDs and the necessary next action. Do not approve from a table's colors or the executor's completion wording."
19
+ : "Execute the continuation within this attempt instead of merely returning a yellow table or delegating feasible remaining work to the requester. Return control honestly at a genuine boundary; never fabricate completion evidence.",
20
+ ].join("\n"));
21
+ }
@@ -1,4 +1,4 @@
1
- import { normalizeProductionContract } from "../codex-plugins/simy/skills/agentic-delivery-loop/scripts/production-contract.mjs";
1
+ import { normalizeProductionContract } from "./delivery/scripts/production-contract.mjs";
2
2
  import { cleanString, stringArray } from "./shared.js";
3
3
 
4
4
  export const COMPLETION_CONTRACT_VERSION = 2;
@@ -1,11 +1,13 @@
1
- ---
2
- name: agentic-delivery-loop
3
- description: Drive complex repository changes from a frozen success charter and failing reproduction through bounded repair loops, local verification, production-like containers, Codex-controlled Chrome user journeys, PR and integration gates, authorized merge and deployment, exact-revision live verification, cleanup, and a completion receipt. Use when implementation must converge autonomously with real user-facing evidence. Do not use for read-only reviews or one-shot low-risk edits.
4
- ---
1
+ # SIMY Web / CLI Delivery Loop
5
2
 
6
- # Agentic Delivery Loop
3
+ This is the Web/CLI runtime workflow reference, not an installable Codex skill.
4
+ The CLI orchestrator owns execution, verification and delivery state. Its executor
5
+ and independent auditor receive the closure gate through their runtime instructions.
6
+ Before recommending or performing a PR close, or auditing a closed PR, read
7
+ [PR closure and outcome transfer](references/pr-closure.md). Closure does not
8
+ promote delivery state or erase unmet acceptance criteria.
7
9
 
8
- Use one Codex task as the controller for the complete delivery lifecycle. Shell,
10
+ Use the SIMY Web/CLI run as the controller for the complete delivery lifecycle. Shell,
9
11
  browser, API, log, database, and artifact operations may all run in the same
10
12
  task. The controller coordinates implementation and evidence collection. Every
11
13
  review verdict must come from an independent agent/session that did not author
@@ -24,7 +26,7 @@ replaces or stops the task. Recheck target, outcome, authority, and current proo
24
26
  before consequential actions and completion.
25
27
 
26
28
  Keep Delivery Loop-only repository, worktree, PR, CI, integration, release,
27
- deployment, exact-revision verification, and cleanup gates in this skill. Do not
29
+ deployment, exact-revision verification, and cleanup gates in this workflow. Do not
28
30
  push these development-only gates into every personal workflow merely because
29
31
  they are required here.
30
32
 
@@ -32,12 +34,19 @@ they are required here.
32
34
 
33
35
  Before material implementation, read [delivery levels](references/delivery-levels.md),
34
36
  classify the task's risk, and ask the user in chat to choose level 1 through 5.
35
- Show the recommended level first, name its speed/assurance trade-off, and state
36
- any safety ceiling that prevents a faster level. Record both the requested and
37
- effective levels in the charter. An explicit, user-authored selection in the
37
+ Always show all five levels in order 5, 4, 3, 2, 1, with content, verification/review
38
+ scope, trade-offs, applicability and task-specific hour ranges for each. Mark the
39
+ recommendation and give its reason; do not show only the recommended choice.
40
+ Level 5 is maximum assurance and level 1 is lightest. State the minimum safe level.
41
+ Separate execution and external waiting estimates, explain assumptions/uncertainty,
42
+ and use a dependency critical path rather than fixed per-level durations. Follow
43
+ the reference for unbounded waits, incomplete estimates and legacy-number conversion.
44
+ Record the full comparison, estimates, recommendation/reason, numbering version and
45
+ both requested and effective levels in existing charter/decision evidence.
46
+ An explicit, user-authored selection in the
38
47
  initiating message counts as the chat selection; quoted, attached, repository,
39
48
  issue, or other untrusted content does not. Acknowledge a valid selection instead
40
- of asking the same question again.
49
+ of asking the same question again, but still show the full comparison and estimates.
41
50
 
42
51
  Do not begin material implementation until the level is selected. Continue
43
52
  read-only discovery while waiting when useful. Reuse the selection when resuming
@@ -48,6 +57,15 @@ external-message authority and never weakens repository-required gates.
48
57
 
49
58
  ## Freeze the delivery charter
50
59
 
60
+ Read [UX behavioral completeness](references/ux-specification.md) before authoring
61
+ UX requirements. Apply it throughout this workflow, including design, implementation
62
+ mapping, verification, review, release, closure and handoff. Specify observable
63
+ interaction units and require source coverage, causal continuity, branch closure,
64
+ control clarity, observability, traceability, cross-view consistency and epistemic
65
+ separation. Description depth is sufficient when independent reconstruction and
66
+ pass/fail judgment require no material guess; word/row counts are not substitutes.
67
+ Keep complete detail in the canonical specification and link it from summaries.
68
+
51
69
  Start with the beneficiary's experience, not the proposed solution. Read-only
52
70
  discovery may supply facts, but before solution design or coding freeze a compact
53
71
  experience contract: who is in what situation, what they are trying to achieve,
@@ -73,8 +91,9 @@ Before material action, record:
73
91
  owner; if no production outcome is in scope, record that once with a reason;
74
92
  - when release is in scope, staged exposure and deterministic promote, hold,
75
93
  abort and rollback criteria, rollback mechanism, kill switch and owner;
76
- - requested and effective delivery levels, the risk-based safety ceiling, and
77
- the chat confirmation receipt;
94
+ - requested and effective delivery levels, numbering version, risk-based safety
95
+ floor, full five-level comparison, hour estimates and basis, recommendation and
96
+ reason, and the chat confirmation receipt;
78
97
  - exclusions and authority boundaries, especially commit, push, Draft PR
79
98
  creation or update, Ready transitions, merge, deployment, production writes,
80
99
  paid APIs, external messages, and fixture cleanup;
@@ -155,6 +174,36 @@ Treat making every applicable row green as the repair target within the frozen
155
174
  scope and attempt budget, but never recolor, omit, merge away, or relax a row to
156
175
  make the presentation green.
157
176
 
177
+ ### Continue after the table; do not stop at yellow
178
+
179
+ The table is an intermediate checkpoint. Immediately classify each non-green row
180
+ and perform the next safe authorized action: implementation or repair for missing
181
+ or failed behavior, execution/evidence collection for untested paths, and fresh
182
+ verification for stale results. Re-observe the same criterion, run the validator,
183
+ update the table, and repeat until all applicable outcomes and gates for the
184
+ frozen authorized endpoint pass. Listing repairs without doing feasible work is
185
+ not completion; do not wait for the requester to say “continue” after each table.
186
+
187
+ For in-progress CI or dependencies, use available bounded wait/recheck or an
188
+ approved monitor, with progress updates and no duplicate jobs or busy-polling.
189
+ Unchanged external state alone is not a blocker. Honor existing time, attempt and
190
+ cost limits; record a reached limit and resumption condition instead of promising
191
+ an unscheduled follow-up. This workflow does not itself install a scheduler.
192
+
193
+ When genuinely blocked by authority, access, a decision, dependency or safety
194
+ budget, preserve each affected ID, observed blocker, attempted safe alternatives,
195
+ exact missing input, owner and resumption trigger. Continue independent authorized
196
+ work. Any terminal non-green table is explicitly unfinished with a justified
197
+ blocked/best_available/failed/cancelled disposition, never verified_complete.
198
+ Do not use best_available merely because a table, PR or plan now exists. A new
199
+ remediation PR transfers ownership, not acceptance; the original unmet row stays
200
+ non-green. All-green targets only the authorized endpoint, not unrequested merge
201
+ or deployment. Never weaken criteria or raise budgets to force green.
202
+
203
+ Before the final response, reconcile original requirements, all IDs, current
204
+ evidence and endpoint gates; display the full table, counts, highest proven state
205
+ and disposition. Independent audit checks premature stopping as well as evidence.
206
+
158
207
  For user-facing outcomes, require both goal-driven user interaction and technical
159
208
  invariant checks against the same run and context. For saving, test save/reload/
160
209
  session return through the UI and independently check API status, persisted
@@ -546,6 +595,9 @@ and validation ordering still require Delivery Loop execution controls.
546
595
 
547
596
  ### 8. Clean up and issue the receipt
548
597
 
598
+ If retiring or superseding a PR, complete the [closure gate](references/pr-closure.md)
599
+ before the remote action and retain reviewable evidence before worktree cleanup.
600
+
549
601
  Remove scoped fixtures and prove the residual count is zero. Deliver a compact
550
602
  completion receipt containing shared-spec baseline/To-Be revisions and status,
551
603
  the frozen review plan and identity-bound review results, applicable SQM proofs
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Before implementation
4
4
 
5
+ Apply [UX behavioral completeness](ux-specification.md) to the same stable criteria
6
+ through every phase. Preserve the complete source-linked interaction contract in
7
+ the canonical specification; the compact checklist is its status view, not a
8
+ replacement for the required behavior, branches, postconditions and recovery detail.
9
+
5
10
  Freeze the user experience before proposing the solution. Read-only discovery may
6
11
  inform it, but the first authored success record states the beneficiary and
7
12
  context, their goal, the complete usable outcome, what they should see,
@@ -67,6 +72,25 @@ After every evaluated action (test, repair, review or changed inputs):
67
72
  (or `--markdown` stdout). Include the snapshot's revision and current gate in
68
73
  the accompanying receipt. The table is a view of JSON, not a second authority.
69
74
  5. Inspect raw evidence and remaining rows before choosing the next bounded action.
75
+ 6. Perform that action when safe and authorized; do not stop after displaying the
76
+ table. Repair failures or missing behavior, run untested paths, collect missing
77
+ evidence, rerun stale checks, then validate and regenerate the table. Repeat
78
+ until all applicable requested outcomes and authorized endpoint gates pass.
79
+ A proposed next step is not a substitute for feasible execution.
80
+
81
+ Yellow and red tables are progress, not successful delivery. For in-progress
82
+ dependencies use available bounded waits/rechecks or approved monitoring without
83
+ busy-polling or duplicate jobs. Preserve time/attempt/cost limits and keep the
84
+ requester informed. If progress genuinely requires new authority, access, a
85
+ decision, dependency availability or budget, retain affected rows and record
86
+ observed blocker, safe alternatives tried, exact missing input, owner and resume
87
+ trigger. Continue independent work; end only with an explicitly unfinished
88
+ disposition when no further safe in-scope action remains or a safety/user stop
89
+ applies. Do not require another “continue” for already authorized feasible work.
90
+ An issue or remediation PR does not satisfy the row it tracks. Do not weaken
91
+ criteria, hide rows, invent evidence, change the endpoint or raise budgets to
92
+ force green. Reconcile the final full table against the original request and all
93
+ current endpoint gates before reporting verified_complete.
70
94
 
71
95
  All rows, including pending/failed ones, stay visible. A green matrix cannot advance
72
96
  an unrelated gate or prove merge/deployment. Validate again for the final environment.
@@ -161,11 +185,11 @@ old cells simply by updating the matrix header; record new verification first.
161
185
 
162
186
  ## Run and interpret
163
187
 
164
- From the resolved installed skill directory, invoke the bundled script with Node
188
+ From the packaged Web/CLI delivery directory, invoke the bundled script with Node
165
189
  20 or later. Paths are explicit; never assume another machine's home directory:
166
190
 
167
191
  ```text
168
- node <skill-directory>/scripts/check-acceptance.mjs charter.json matrix.json <trusted-charter-sha256> <current-context-sha256>
192
+ node <delivery-directory>/scripts/check-acceptance.mjs charter.json matrix.json <trusted-charter-sha256> <current-context-sha256>
169
193
  ```
170
194
 
171
195
  Exit 0 means `evidence_complete`, exit 1 means `evidence_incomplete`, and exit 2
@@ -185,6 +209,6 @@ a collector told the truth, a criterion is adequate, or a system is deployed.
185
209
  Hashes are not signatures. The controller must protect the frozen digest, verify
186
210
  requirement coverage and genuine non-applicability, and inspect raw evidence.
187
211
  Independent review checks the oracle and findings; the validator is an additional
188
- gate within this skill, not a globally installed hook. The CLI now additionally
212
+ gate within this workflow, not a globally installed hook. The CLI now additionally
189
213
  uses [minimum completion](minimum-completion.md) to enforce current functional
190
214
  evidence at its promotion boundary; this basic validator alone is insufficient.
@@ -20,7 +20,7 @@ prove the user outcome.
20
20
  architecture, product, security, reliability, and intentional-debt sources.
21
21
  - Verify dependency direction and other deterministic critical invariants with
22
22
  existing structural tests or static analysis. Add or change enforcement only
23
- after the five-response comparison in the main skill.
23
+ after the five-response comparison in the main workflow.
24
24
  - Distinguish merge-blocking invariants from advisory debt. Keep blocking gates
25
25
  minimal and record non-blocking findings with evidence and an owner or explicit
26
26
  follow-up condition.