@astrosheep/keiyaku 2.9.5 → 2.9.7

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 (75) hide show
  1. package/build/.tsbuildinfo +1 -1
  2. package/build/agents/harness/outcome.js +20 -4
  3. package/build/agents/harness/projection.js +8 -7
  4. package/build/agents/harness/router.js +2 -1
  5. package/build/agents/providers/claude-agent-sdk/adapter.js +13 -1
  6. package/build/agents/providers/claude-agent-sdk/registration.js +2 -1
  7. package/build/agents/providers/codex-app-server/adapter.js +11 -10
  8. package/build/agents/providers/codex-app-server/registration.js +2 -1
  9. package/build/agents/providers/opencode-sdk/adapter.js +7 -0
  10. package/build/agents/providers/opencode-sdk/registration.js +2 -1
  11. package/build/agents/providers/pi/adapter.js +10 -0
  12. package/build/agents/providers/pi/registration.js +3 -1
  13. package/build/cli/commands/contract/bind/handler.js +10 -4
  14. package/build/cli/commands/contract/bind/meta.js +6 -6
  15. package/build/cli/commands/contract/petition/handler.js +16 -3
  16. package/build/cli/commands/contract/petition/meta.js +4 -4
  17. package/build/cli/commands/metadata.js +3 -2
  18. package/build/cli/commands/projection/tell/handler.js +10 -2
  19. package/build/cli/commands/projection/tell/meta.js +3 -3
  20. package/build/cli/commands/task/catalog.js +2 -0
  21. package/build/cli/commands/task/log/handler.js +12 -0
  22. package/build/cli/commands/task/log/meta.js +8 -0
  23. package/build/cli/completion.js +9 -2
  24. package/build/cli/flags.js +11 -2
  25. package/build/cli/index.js +10 -6
  26. package/build/cli/parse-flags.js +6 -0
  27. package/build/cli/parse-metadata.js +1 -1
  28. package/build/cli/render/errors.js +18 -1
  29. package/build/cli/render/format.js +5 -2
  30. package/build/cli/render/line-width.js +33 -0
  31. package/build/cli/render/path-prefix-compaction.js +88 -0
  32. package/build/cli/render/petition.js +4 -0
  33. package/build/cli/render/projection-activity.js +93 -20
  34. package/build/cli/render/shared.js +34 -12
  35. package/build/cli/render/success-response.js +2 -0
  36. package/build/cli/render/tool-presentation.js +3 -3
  37. package/build/cli/render/wait.js +68 -48
  38. package/build/cli/subagent-guard.js +3 -0
  39. package/build/cli/types.js +1 -1
  40. package/build/core/audit/candidate.js +48 -0
  41. package/build/core/audit/coordinates.js +180 -0
  42. package/build/core/audit/evidence.js +158 -0
  43. package/build/core/audit/facade.js +42 -0
  44. package/build/core/audit/readiness.js +4 -0
  45. package/build/core/audit/report.js +38 -0
  46. package/build/core/audit.js +1 -650
  47. package/build/core/bind.js +111 -6
  48. package/build/core/draft.js +1 -1
  49. package/build/core/projection/generation/database.js +21 -2
  50. package/build/core/projection/generation/model.js +24 -3
  51. package/build/core/projection/generation/projection-generation-continuation.js +75 -10
  52. package/build/core/projection/generation/projection-generation-execution.js +4 -3
  53. package/build/core/projection/generation/projection-generation-runner.js +96 -53
  54. package/build/core/projection/generation/projection-generation-runtime.js +19 -0
  55. package/build/core/projection/generation/store.js +9 -0
  56. package/build/core/projection/generation/transitions.js +105 -3
  57. package/build/core/projection/index.js +2 -2
  58. package/build/core/projection/projection-core.js +1 -1
  59. package/build/core/projection/projection-kill.js +31 -0
  60. package/build/core/projection/projection-life-protocol.js +10 -0
  61. package/build/core/projection/projection-wait.js +53 -15
  62. package/build/core/projection/projection-wake.js +35 -3
  63. package/build/core/projection/tell/database.js +18 -0
  64. package/build/core/projection/tell/model.js +1 -0
  65. package/build/core/projection/tell/store.js +102 -55
  66. package/build/core/registry.js +82 -69
  67. package/build/core/scope.js +9 -9
  68. package/build/core/task/index.js +2 -2
  69. package/build/core/task/query.js +65 -23
  70. package/build/core/task/task-contract.js +18 -0
  71. package/build/core/task/task-git-store.js +50 -0
  72. package/build/generated/version.js +2 -2
  73. package/package.json +1 -1
  74. package/skills/keiyaku-akuma/SKILL.md +10 -0
  75. package/skills/keiyaku-workflow/SKILL.md +82 -7
@@ -0,0 +1,38 @@
1
+ export function collectFindings(input) {
2
+ const findings = [];
3
+ const selector = `keiyaku @${input.contractId}`;
4
+ if (input.rehearsal.status === "clean")
5
+ findings.push({ code: "BASE_DRIFT", detail: `${input.rehearsal.oldBase} -> ${input.rehearsal.newBase}`, nextCommand: `${selector} renew` });
6
+ if (input.rehearsal.status === "conflict")
7
+ findings.push({ code: "RENEW_CONFLICT", detail: input.rehearsal.paths.join(", "), nextCommand: `${selector} renew` });
8
+ if (input.rehearsal.status === "unknown")
9
+ findings.push({ code: "RENEW_UNKNOWN", detail: `${input.rehearsal.cause.code}: ${input.rehearsal.cause.message}`, nextCommand: `${selector} audit` });
10
+ for (const row of input.scope?.filter((item) => item.class === "violated") ?? [])
11
+ findings.push({ code: "SCOPE_RESIDUE", detail: `${row.path}: ${row.residue.length} unexplained changes`, nextCommand: `${selector} amend --scope-add ${JSON.stringify(row.path)}` });
12
+ if (input.verification.status === "evaluated") {
13
+ for (const result of input.verification.results) {
14
+ if (result.status === "executed" && result.exitCode !== 0)
15
+ findings.push({ code: "VERIFICATION_FAILED", detail: `${result.label} exited ${result.exitCode}`, nextCommand: result.command });
16
+ if (result.status === "unverifiable")
17
+ findings.push({ code: "VERIFICATION_UNVERIFIABLE", detail: `${result.label}: ${result.cause}`, nextCommand: result.command });
18
+ }
19
+ }
20
+ const residue = input.readiness.deliveryResidue;
21
+ if (residue.tracked.length + residue.staged.length + residue.unstaged.length + residue.untracked.length > 0)
22
+ findings.push({ code: "DELIVERY_RESIDUE", detail: `registered delivery worktree has uncommitted residue at ${input.deliveryCwd}`, nextCommand: `git -C ${JSON.stringify(input.deliveryCwd)} status --short` });
23
+ if (input.readiness.arc.max > 0 && input.readiness.arc.open === null && input.readiness.arc.looseCommits.length > 0)
24
+ findings.push({ code: "LOOSE_COMMITS", detail: `${input.readiness.arc.looseCommits.length} loose commits after fence`, nextCommand: `printf '# Continue\\n\\n## Objective\\nReceipt loose commits.\\n\\n## Brief\\nContinue delivery.\\n' | ${selector} arc` });
25
+ if (input.readiness.renewSession.open)
26
+ findings.push({ code: "RENEW_SESSION_OPEN", detail: "renew recovery session is open", nextCommand: `${selector} renew --continue` });
27
+ if (input.readiness.rewriteGuard.liveProjection)
28
+ findings.push({ code: "LIVE_REWRITE_GUARD", detail: "a live projection owns the delivery worktree", nextCommand: "keiyaku status" });
29
+ for (const dependency of input.readiness.dependencies.filter((item) => !item.satisfied))
30
+ findings.push({ code: "DEPENDENCY_OPEN", detail: `dependency ${dependency.id} is ${dependency.state}`, nextCommand: `keiyaku @${dependency.id} log` });
31
+ if (input.readiness.petition.state === "petitioned" && input.readiness.petition.queue?.position !== 1)
32
+ findings.push({ code: "PETITION_QUEUE", detail: `petition queue position ${input.readiness.petition.queue?.position ?? "unknown"}`, nextCommand: "keiyaku status" });
33
+ return findings;
34
+ }
35
+ export function emptyRaceReport(input) {
36
+ const findings = [{ code: "COORDINATE_RACE", detail: input.detail, nextCommand: `keiyaku @${input.contractId} audit`, race: input.race }];
37
+ return { contract: input.contractId, coordinates: input.coordinates, terms: input.terms, rehearsal: { status: "unknown", cause: { code: "COORDINATE_RACE", message: input.detail } }, candidate: null, diff: null, presentation: null, files: null, scope: null, verification: { status: "not_evaluated", reason: "coordinate_race", results: [] }, readiness: null, findings, counts: { files: 0, selected: 0, omitted: 0, inScope: 0, downgraded: 0, violated: 0, findings: 1 } };
38
+ }