@wildo-ai/dev-companion 1.1.2 → 1.1.3

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 (61) hide show
  1. package/dist/esm/.tsbuildinfo +1 -1
  2. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts.map +1 -1
  3. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js +4 -12
  4. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
  5. package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts +0 -16
  6. package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts.map +1 -1
  7. package/dist/esm/claude-cli/services/research-evidence-store.companion.js +0 -17
  8. package/dist/esm/claude-cli/services/research-evidence-store.companion.js.map +1 -1
  9. package/dist/esm/companion-api/controllers/companion.controller.d.ts +0 -1
  10. package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
  11. package/dist/esm/companion-api/controllers/companion.controller.js +2 -27
  12. package/dist/esm/companion-api/controllers/companion.controller.js.map +1 -1
  13. package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.d.ts.map +1 -1
  14. package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js +1 -8
  15. package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js.map +1 -1
  16. package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.d.ts +9 -4
  17. package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.d.ts.map +1 -1
  18. package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.js.map +1 -1
  19. package/dist/esm/core/introspection/subprocess/family-aspects.behavior.d.ts +21 -0
  20. package/dist/esm/core/introspection/subprocess/family-aspects.behavior.d.ts.map +1 -1
  21. package/dist/esm/core/introspection/subprocess/family-aspects.behavior.js +1 -39
  22. package/dist/esm/core/introspection/subprocess/family-aspects.behavior.js.map +1 -1
  23. package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.d.ts +1 -3
  24. package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.d.ts.map +1 -1
  25. package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.js +23 -36
  26. package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.js.map +1 -1
  27. package/dist/esm/core/runtime/companion-startup-assembly.d.ts.map +1 -1
  28. package/dist/esm/core/runtime/companion-startup-assembly.js +0 -5
  29. package/dist/esm/core/runtime/companion-startup-assembly.js.map +1 -1
  30. package/dist/esm/executions/services/companion-executions.companion.service.d.ts +3 -82
  31. package/dist/esm/executions/services/companion-executions.companion.service.d.ts.map +1 -1
  32. package/dist/esm/executions/services/companion-executions.companion.service.js +4 -113
  33. package/dist/esm/executions/services/companion-executions.companion.service.js.map +1 -1
  34. package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.d.ts +3 -82
  35. package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.d.ts.map +1 -1
  36. package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.js +54 -138
  37. package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.js.map +1 -1
  38. package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.d.ts +1 -27
  39. package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.d.ts.map +1 -1
  40. package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.js +5 -38
  41. package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.js.map +1 -1
  42. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +0 -25
  43. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts.map +1 -1
  44. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js +0 -37
  45. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js.map +1 -1
  46. package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts +2 -7
  47. package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts.map +1 -1
  48. package/dist/esm/meta-workflows/services/playbook-run.companion.service.js +30 -122
  49. package/dist/esm/meta-workflows/services/playbook-run.companion.service.js.map +1 -1
  50. package/dist/esm/technical-doc/services/technical-doc.companion.service.d.ts.map +1 -1
  51. package/dist/esm/technical-doc/services/technical-doc.companion.service.js +0 -2
  52. package/dist/esm/technical-doc/services/technical-doc.companion.service.js.map +1 -1
  53. package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.d.ts +1 -3
  54. package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.d.ts.map +1 -1
  55. package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.js +1 -38
  56. package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.js.map +1 -1
  57. package/package.json +17 -17
  58. package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.d.ts +0 -36
  59. package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.d.ts.map +0 -1
  60. package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.js +0 -75
  61. package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.js.map +0 -1
@@ -46,22 +46,6 @@ export declare function slugifyEvidenceScope(scope: string): string;
46
46
  * property of the LANE, and a convention restated per method drifts. The instruction is explicit
47
47
  * that the directory is the ONLY writable location — the predicate enforces it, but an agent told
48
48
  * the boundary spends its turn researching instead of discovering refusals.
49
- *
50
- * ## Why it also carries a SOURCE-NEUTRALITY clause (2026-09-05)
51
- *
52
- * A compliance researcher enumerating "which regimes apply" reaches for proprietary security
53
- * certification and attestation standards unprompted, alongside the public law that is the actual
54
- * subject. Public law is fine — statutes and regulations are quotable. The proprietary standards are
55
- * not: their control catalogues and identifiers are licensed material, and `CLAUDE.md` confines every
56
- * external framework name, identifier and mapping to a rights-classified boundary that this store is
57
- * not. `pnpm check:assurance-control-boundary` refuses them repository-wide against a baseline drained
58
- * to zero, so a dogfood application's committed store is a surface where they land in FRAMEWORK git.
59
- *
60
- * That is not hypothetical: Wonder CRM's first accepted evidence population carried six such names —
61
- * every one of them merely listing the standard as "voluntary, not a legal obligation, never
62
- * researched" — and reddened the gate on the shared branch. The finding survives its neutral phrasing
63
- * intact, which is why the instruction asks for the CATEGORY rather than forbidding the conclusion:
64
- * an agent told only "do not name X" tends to drop the finding along with the name.
65
49
  */
66
50
  export declare function composeEvidenceStoreInstruction(evidenceDirectoryAbsolutePath: string): string;
67
51
  /** What the companion persists about one COMPLETED research task, beside whatever the agent wrote. */
@@ -1 +1 @@
1
- {"version":3,"file":"research-evidence-store.companion.d.ts","sourceRoot":"","sources":["../../../../../src/claude-cli/services/research-evidence-store.companion.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,uGAAuG;AACvG,eAAO,MAAM,+BAA+B,qCAAqC,CAAC;AAElF;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAExF;AAED,iGAAiG;AACjG,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAO1D;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,+BAA+B,CAAC,6BAA6B,EAAE,MAAM,GAAG,MAAM,CAS7F;AAED,sGAAsG;AACtG,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,6BAA6B,EAAE,MAAM,CAAC;IAC/C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,yFAAyF;IACzF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,wBAAwB,GAAG,MAAM,CAgChF"}
1
+ {"version":3,"file":"research-evidence-store.companion.d.ts","sourceRoot":"","sources":["../../../../../src/claude-cli/services/research-evidence-store.companion.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,uGAAuG;AACvG,eAAO,MAAM,+BAA+B,qCAAqC,CAAC;AAElF;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAExF;AAED,iGAAiG;AACjG,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAO1D;AAED;;;;;;;GAOG;AACH,wBAAgB,+BAA+B,CAAC,6BAA6B,EAAE,MAAM,GAAG,MAAM,CAQ7F;AAED,sGAAsG;AACtG,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,6BAA6B,EAAE,MAAM,CAAC;IAC/C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,yFAAyF;IACzF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,wBAAwB,GAAG,MAAM,CAgChF"}
@@ -57,22 +57,6 @@ export function slugifyEvidenceScope(scope) {
57
57
  * property of the LANE, and a convention restated per method drifts. The instruction is explicit
58
58
  * that the directory is the ONLY writable location — the predicate enforces it, but an agent told
59
59
  * the boundary spends its turn researching instead of discovering refusals.
60
- *
61
- * ## Why it also carries a SOURCE-NEUTRALITY clause (2026-09-05)
62
- *
63
- * A compliance researcher enumerating "which regimes apply" reaches for proprietary security
64
- * certification and attestation standards unprompted, alongside the public law that is the actual
65
- * subject. Public law is fine — statutes and regulations are quotable. The proprietary standards are
66
- * not: their control catalogues and identifiers are licensed material, and `CLAUDE.md` confines every
67
- * external framework name, identifier and mapping to a rights-classified boundary that this store is
68
- * not. `pnpm check:assurance-control-boundary` refuses them repository-wide against a baseline drained
69
- * to zero, so a dogfood application's committed store is a surface where they land in FRAMEWORK git.
70
- *
71
- * That is not hypothetical: Wonder CRM's first accepted evidence population carried six such names —
72
- * every one of them merely listing the standard as "voluntary, not a legal obligation, never
73
- * researched" — and reddened the gate on the shared branch. The finding survives its neutral phrasing
74
- * intact, which is why the instruction asks for the CATEGORY rather than forbidding the conclusion:
75
- * an agent told only "do not name X" tends to drop the finding along with the name.
76
60
  */
77
61
  export function composeEvidenceStoreInstruction(evidenceDirectoryAbsolutePath) {
78
62
  return [
@@ -80,7 +64,6 @@ export function composeEvidenceStoreInstruction(evidenceDirectoryAbsolutePath) {
80
64
  `The directory \`${evidenceDirectoryAbsolutePath}\` is your evidence store — the ONLY location you may write to (every other path is refused).`,
81
65
  'FIRST read what it already contains: earlier rounds consolidated their findings there. Extend that record; do not re-research or restate what a prior file already establishes with sources.',
82
66
  'AS YOU RESEARCH, persist your findings into markdown files in that directory — one file per coherent topic, named `<topic-slug>.md`, updated in place as your understanding sharpens. Each finding carries its source URL beside it. Write incrementally: evidence on disk survives an interrupted turn; evidence only in your final message does not.',
83
- 'SOURCE NEUTRALITY: name public law freely (statutes, regulations, regulator guidance — quote and cite them). Do NOT name a proprietary security certification or attestation standard, or any of its control identifiers, in a file or in your final message: their catalogues are licensed material this store is not a rights-classified boundary for. Refer to that whole class as "voluntary security-certification and attestation frameworks" and state your finding about it in full — the conclusion is wanted, the proprietary name is not.',
84
67
  'Your final message still reports the answer in full — the store is the durable record, not a substitute for answering.',
85
68
  ].join('\n');
86
69
  }
@@ -1 +1 @@
1
- {"version":3,"file":"research-evidence-store.companion.js","sourceRoot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kdirSync, writeFileSync, existsSync, readdirSync } from 'node:fs';\nimport { join } from 'node:path';\n\n/**\n * The research evidence store — where a research agent's findings become FILES.\n *\n * ## Why this exists (2026-09-04)\n *\n * Research evidence used to live in exactly one place: the run's in-memory step results, feeding\n * the next child's brief and dying with the run. Three consecutive compliance runs proved what that\n * costs — a 56-minute, 14-children evidence body lost to a quota cut, then two relaunches lost to\n * an expired login — and the run-level checkpoint only protects the SCHEDULING state, not the\n * knowledge. The store is the knowledge half: evidence lands on disk as it is gathered, survives\n * any death, and is READ BACK by later runs so they extend prior research instead of re-buying it.\n *\n * ## Where, and why it is COMMITTABLE\n *\n * `<application>/specifications/research-evidence/<scope>/` — inside the application repository,\n * outside `specifications/src/`, so it enters no TypeScript program and no family classification.\n * Committable on purpose: source-attributed research is knowledge the posture artifacts cite, and\n * \"delete it and re-run\" costs hours and a quota window — git is where things that must survive a\n * re-clone live (`one-source-of-truth.md`). Acceptance stays a human commit, like every other\n * working edit an agent lands.\n *\n * ## Who writes\n *\n * TWO writers, layered:\n * 1. The research AGENT, incrementally, during its turn — the profile's location predicate admits\n * exactly this directory (built by the same `buildApplicationCodingTaskLocationPredicate` the\n * coding lane trusts), so a mid-turn death still leaves everything already consolidated.\n * 2. The COMPANION, once per completed task — `writeFinalEvidenceRecord` persists the returned\n * brief with its provenance frontmatter, so a completed turn is on disk even if the agent wrote\n * nothing itself.\n */\n\n/** Application-relative root of the store. Also the ONLY path prefix the research predicate admits. */\nexport const RESEARCH_EVIDENCE_RELATIVE_ROOT = 'specifications/research-evidence';\n\n/**\n * A scope names the investigation a set of evidence files belongs to — normally the composite\n * playbook ref (`top_down.compliance-analysis`), so every child of one choreography, across every\n * run of it, consolidates into one directory.\n */\nexport function resolveResearchEvidenceDirectory(saasRoot: string, scope: string): string {\n return join(saasRoot, RESEARCH_EVIDENCE_RELATIVE_ROOT, slugifyEvidenceScope(scope));\n}\n\n/** Directory-safe scope: lowercase, dots and separators to hyphens, nothing traversal-shaped. */\nexport function slugifyEvidenceScope(scope: string): string {\n const slug = scope\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n .slice(0, 80);\n return slug.length > 0 ? slug : 'adhoc';\n}\n\n/**\n * The prompt block that turns \"you may write here\" into \"you consolidate here\".\n *\n * Appended to every research objective by the dispatch, never authored per playbook: the store is a\n * property of the LANE, and a convention restated per method drifts. The instruction is explicit\n * that the directory is the ONLY writable location — the predicate enforces it, but an agent told\n * the boundary spends its turn researching instead of discovering refusals.\n *\n * ## Why it also carries a SOURCE-NEUTRALITY clause (2026-09-05)\n *\n * A compliance researcher enumerating \"which regimes apply\" reaches for proprietary security\n * certification and attestation standards unprompted, alongside the public law that is the actual\n * subject. Public law is fine — statutes and regulations are quotable. The proprietary standards are\n * not: their control catalogues and identifiers are licensed material, and `CLAUDE.md` confines every\n * external framework name, identifier and mapping to a rights-classified boundary that this store is\n * not. `pnpm check:assurance-control-boundary` refuses them repository-wide against a baseline drained\n * to zero, so a dogfood application's committed store is a surface where they land in FRAMEWORK git.\n *\n * That is not hypothetical: Wonder CRM's first accepted evidence population carried six such names —\n * every one of them merely listing the standard as \"voluntary, not a legal obligation, never\n * researched\" — and reddened the gate on the shared branch. The finding survives its neutral phrasing\n * intact, which is why the instruction asks for the CATEGORY rather than forbidding the conclusion:\n * an agent told only \"do not name X\" tends to drop the finding along with the name.\n */\nexport function composeEvidenceStoreInstruction(evidenceDirectoryAbsolutePath: string): string {\n return [\n '# Evidence store (persist as you go)',\n `The directory \\`${evidenceDirectoryAbsolutePath}\\` is your evidence store — the ONLY location you may write to (every other path is refused).`,\n 'FIRST read what it already contains: earlier rounds consolidated their findings there. Extend that record; do not re-research or restate what a prior file already establishes with sources.',\n 'AS YOU RESEARCH, persist your findings into markdown files in that directory — one file per coherent topic, named `<topic-slug>.md`, updated in place as your understanding sharpens. Each finding carries its source URL beside it. Write incrementally: evidence on disk survives an interrupted turn; evidence only in your final message does not.',\n 'SOURCE NEUTRALITY: name public law freely (statutes, regulations, regulator guidance — quote and cite them). Do NOT name a proprietary security certification or attestation standard, or any of its control identifiers, in a file or in your final message: their catalogues are licensed material this store is not a rights-classified boundary for. Refer to that whole class as \"voluntary security-certification and attestation frameworks\" and state your finding about it in full — the conclusion is wanted, the proprietary name is not.',\n 'Your final message still reports the answer in full — the store is the durable record, not a substitute for answering.',\n ].join('\\n');\n}\n\n/** What the companion persists about one COMPLETED research task, beside whatever the agent wrote. */\nexport interface FinalEvidenceRecordInput {\n readonly evidenceDirectoryAbsolutePath: string;\n readonly objective: string;\n readonly evidence: string;\n readonly stopReason: string;\n readonly startedAtIso: string;\n readonly elapsedMs: number;\n /** The playbook that asked, when one did — an operator's ad-hoc `/research` has none. */\n readonly playbookRef?: string;\n}\n\n/**\n * Persist the final returned brief as a dated, provenance-stamped markdown record.\n *\n * Filename is `<yyyy-mm-dd>-round-<n>.md` where `n` disambiguates within a day — deliberately NOT\n * derived from the objective, whose first words are near-identical across rounds of one\n * investigation. Returns the absolute path written, so the caller can report it.\n */\nexport function writeFinalEvidenceRecord(input: FinalEvidenceRecordInput): string {\n mkdirSync(input.evidenceDirectoryAbsolutePath, { recursive: true });\n const day = input.startedAtIso.slice(0, 10);\n const existing = readdirSync(input.evidenceDirectoryAbsolutePath).filter((name) => name.startsWith(`${day}-round-`));\n let round = existing.length + 1;\n let filePath = join(input.evidenceDirectoryAbsolutePath, `${day}-round-${round}.md`);\n while (existsSync(filePath)) {\n round += 1;\n filePath = join(input.evidenceDirectoryAbsolutePath, `${day}-round-${round}.md`);\n }\n const frontmatter = [\n '---',\n `startedAt: ${input.startedAtIso}`,\n `elapsedMs: ${input.elapsedMs}`,\n `stopReason: ${input.stopReason}`,\n ...(input.playbookRef ? [`playbookRef: ${input.playbookRef}`] : []),\n '---',\n ].join('\\n');\n const body = [\n frontmatter,\n '',\n '## Objective',\n '',\n input.objective,\n '',\n '## Evidence',\n '',\n input.evidence,\n '',\n ].join('\\n');\n writeFileSync(filePath, body, 'utf8');\n return filePath;\n}\n"]}
1
+ {"version":3,"file":"research-evidence-store.companion.js","sourceRoot":"","sources":["../../../../../src/claude-cli/services/research-evidence-store.companion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,uGAAuG;AACvG,MAAM,CAAC,MAAM,+BAA+B,GAAG,kCAAkC,CAAC;AAElF;;;;GAIG;AACH,MAAM,UAAU,gCAAgC,CAAC,QAAgB,EAAE,KAAa;IAC9E,OAAO,IAAI,CAAC,QAAQ,EAAE,+BAA+B,EAAE,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC;AACtF,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,oBAAoB,CAAC,KAAa;IAChD,MAAM,IAAI,GAAG,KAAK;SACf,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;SACvB,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAChB,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;AAC1C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,+BAA+B,CAAC,6BAAqC;IACnF,OAAO;QACL,sCAAsC;QACtC,mBAAmB,6BAA6B,+FAA+F;QAC/I,8LAA8L;QAC9L,wVAAwV;QACxV,wHAAwH;KACzH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAcD;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAA+B;IACtE,SAAS,CAAC,KAAK,CAAC,6BAA6B,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC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AAC;AAClB,CAAC","sourcesContent":["import { mkdirSync, writeFileSync, existsSync, readdirSync } from 'node:fs';\nimport { join } from 'node:path';\n\n/**\n * The research evidence store — where a research agent's findings become FILES.\n *\n * ## Why this exists (2026-09-04)\n *\n * Research evidence used to live in exactly one place: the run's in-memory step results, feeding\n * the next child's brief and dying with the run. Three consecutive compliance runs proved what that\n * costs — a 56-minute, 14-children evidence body lost to a quota cut, then two relaunches lost to\n * an expired login — and the run-level checkpoint only protects the SCHEDULING state, not the\n * knowledge. The store is the knowledge half: evidence lands on disk as it is gathered, survives\n * any death, and is READ BACK by later runs so they extend prior research instead of re-buying it.\n *\n * ## Where, and why it is COMMITTABLE\n *\n * `<application>/specifications/research-evidence/<scope>/` — inside the application repository,\n * outside `specifications/src/`, so it enters no TypeScript program and no family classification.\n * Committable on purpose: source-attributed research is knowledge the posture artifacts cite, and\n * \"delete it and re-run\" costs hours and a quota window — git is where things that must survive a\n * re-clone live (`one-source-of-truth.md`). Acceptance stays a human commit, like every other\n * working edit an agent lands.\n *\n * ## Who writes\n *\n * TWO writers, layered:\n * 1. The research AGENT, incrementally, during its turn — the profile's location predicate admits\n * exactly this directory (built by the same `buildApplicationCodingTaskLocationPredicate` the\n * coding lane trusts), so a mid-turn death still leaves everything already consolidated.\n * 2. The COMPANION, once per completed task — `writeFinalEvidenceRecord` persists the returned\n * brief with its provenance frontmatter, so a completed turn is on disk even if the agent wrote\n * nothing itself.\n */\n\n/** Application-relative root of the store. Also the ONLY path prefix the research predicate admits. */\nexport const RESEARCH_EVIDENCE_RELATIVE_ROOT = 'specifications/research-evidence';\n\n/**\n * A scope names the investigation a set of evidence files belongs to — normally the composite\n * playbook ref (`top_down.compliance-analysis`), so every child of one choreography, across every\n * run of it, consolidates into one directory.\n */\nexport function resolveResearchEvidenceDirectory(saasRoot: string, scope: string): string {\n return join(saasRoot, RESEARCH_EVIDENCE_RELATIVE_ROOT, slugifyEvidenceScope(scope));\n}\n\n/** Directory-safe scope: lowercase, dots and separators to hyphens, nothing traversal-shaped. */\nexport function slugifyEvidenceScope(scope: string): string {\n const slug = scope\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n .slice(0, 80);\n return slug.length > 0 ? slug : 'adhoc';\n}\n\n/**\n * The prompt block that turns \"you may write here\" into \"you consolidate here\".\n *\n * Appended to every research objective by the dispatch, never authored per playbook: the store is a\n * property of the LANE, and a convention restated per method drifts. The instruction is explicit\n * that the directory is the ONLY writable location — the predicate enforces it, but an agent told\n * the boundary spends its turn researching instead of discovering refusals.\n */\nexport function composeEvidenceStoreInstruction(evidenceDirectoryAbsolutePath: string): string {\n return [\n '# Evidence store (persist as you go)',\n `The directory \\`${evidenceDirectoryAbsolutePath}\\` is your evidence store — the ONLY location you may write to (every other path is refused).`,\n 'FIRST read what it already contains: earlier rounds consolidated their findings there. Extend that record; do not re-research or restate what a prior file already establishes with sources.',\n 'AS YOU RESEARCH, persist your findings into markdown files in that directory — one file per coherent topic, named `<topic-slug>.md`, updated in place as your understanding sharpens. Each finding carries its source URL beside it. Write incrementally: evidence on disk survives an interrupted turn; evidence only in your final message does not.',\n 'Your final message still reports the answer in full — the store is the durable record, not a substitute for answering.',\n ].join('\\n');\n}\n\n/** What the companion persists about one COMPLETED research task, beside whatever the agent wrote. */\nexport interface FinalEvidenceRecordInput {\n readonly evidenceDirectoryAbsolutePath: string;\n readonly objective: string;\n readonly evidence: string;\n readonly stopReason: string;\n readonly startedAtIso: string;\n readonly elapsedMs: number;\n /** The playbook that asked, when one did — an operator's ad-hoc `/research` has none. */\n readonly playbookRef?: string;\n}\n\n/**\n * Persist the final returned brief as a dated, provenance-stamped markdown record.\n *\n * Filename is `<yyyy-mm-dd>-round-<n>.md` where `n` disambiguates within a day — deliberately NOT\n * derived from the objective, whose first words are near-identical across rounds of one\n * investigation. Returns the absolute path written, so the caller can report it.\n */\nexport function writeFinalEvidenceRecord(input: FinalEvidenceRecordInput): string {\n mkdirSync(input.evidenceDirectoryAbsolutePath, { recursive: true });\n const day = input.startedAtIso.slice(0, 10);\n const existing = readdirSync(input.evidenceDirectoryAbsolutePath).filter((name) => name.startsWith(`${day}-round-`));\n let round = existing.length + 1;\n let filePath = join(input.evidenceDirectoryAbsolutePath, `${day}-round-${round}.md`);\n while (existsSync(filePath)) {\n round += 1;\n filePath = join(input.evidenceDirectoryAbsolutePath, `${day}-round-${round}.md`);\n }\n const frontmatter = [\n '---',\n `startedAt: ${input.startedAtIso}`,\n `elapsedMs: ${input.elapsedMs}`,\n `stopReason: ${input.stopReason}`,\n ...(input.playbookRef ? [`playbookRef: ${input.playbookRef}`] : []),\n '---',\n ].join('\\n');\n const body = [\n frontmatter,\n '',\n '## Objective',\n '',\n input.objective,\n '',\n '## Evidence',\n '',\n input.evidence,\n '',\n ].join('\\n');\n writeFileSync(filePath, body, 'utf8');\n return filePath;\n}\n"]}
@@ -305,7 +305,6 @@ export declare class CompanionController extends AbstractControllerBackendServic
305
305
  * time, the change-set is captured around it, and the required checks gate the result — and none of that
306
306
  * is accepted until a human commits.
307
307
  */
308
- private readBuildDispatches;
309
308
  private dispatchNextBuildTask;
310
309
  /** `GET /runs/writes` — the write register, newest first. Pre-images stay in the records; the listing is a summary. */
311
310
  private judgePlaybookArtifacts;
@@ -1 +1 @@
1
- {"version":3,"file":"companion.controller.d.ts","sourceRoot":"","sources":["../../../../../src/companion-api/controllers/companion.controller.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gCAAgC,EAChC,aAAa,EACb,0BAA0B,EAC1B,mBAAmB,EAIpB,MAAM,4BAA4B,CAAC;AAuBpC,OAAO,EAAE,gCAAgC,EAAE,MAAM,mEAAmE,CAAC;AACrH,OAAO,EAAE,qCAAqC,EAAE,MAAM,wEAAwE,CAAC;AAC/H,OAAO,EAAE,qCAAqC,EAAE,MAAM,wEAAwE,CAAC;AAC/H,OAAO,EAAE,6BAA6B,EAAE,MAAM,uDAAuD,CAAC;AACtG,OAAO,EAA0D,2BAA2B,EA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,"file":"companion.controller.d.ts","sourceRoot":"","sources":["../../../../../src/companion-api/controllers/companion.controller.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gCAAgC,EAChC,aAAa,EACb,0BAA0B,EAC1B,mBAAmB,EAIpB,MAAM,4BAA4B,CAAC;AAuBpC,OAAO,EAAE,gCAAgC,EAAE,MAAM,mEAAmE,CAAC;AACrH,OAAO,EAAE,qCAAqC,EAAE,MAAM,wEAAwE,CAAC;AAC/H,OAAO,EAAE,qCAAqC,EAAE,MAAM,wEAAwE,CAAC;AAC/H,OAAO,EAAE,6BAA6B,EAAE,MAAM,uDAAuD,CAAC;AACtG,OAAO,EAA0D,2BAA2B,EAAwB,MAAM,8DAA8D,CAAC;AACzL,OAAO,EAAE,uCAAuC,EAAE,MAAM,gFAAgF,CAAC;AAIzI,OAAO,EAEL,kCAAkC,EACnC,MAAM,sEAAsE,CAAC;AAC9E,OAAO,EACL,wCAAwC,EAGzC,MAAM,4EAA4E,CAAC;AAGpF,OAAO,EAAE,wCAAwC,EAAuC,MAAM,6EAA6E,CAAC;AAS5K,OAAO,EAAE,gCAAgC,EAAE,MAAM,2DAA2D,CAAC;AAC7G,OAAO,EAAE,8BAA8B,EAAE,MAAM,wDAAwD,CAAC;AACxG,OAAO,EAAE,gCAAgC,EAAE,MAAM,0DAA0D,CAAC;AAC5G,OAAO,EAAE,2BAA2B,EAAE,MAAM,qDAAqD,CAAC;AAClG,OAAO,EAAE,6BAA6B,EAAE,MAAM,iEAAiE,CAAC;AAChH,OAAO,EAAE,4BAA4B,EAAE,MAAM,6DAA6D,CAAC;AAG3G,OAAO,EAAE,4BAA4B,EAAE,MAAM,8DAA8D,CAAC;AAC5G,OAAO,EAAE,6BAA6B,EAAE,MAAM,6EAA6E,CAAC;AAC5H,OAAO,EAAE,mCAAmC,EAAE,MAAM,kEAAkE,CAAC;AACvH,OAAO,EACL,qCAAqC,EAEtC,MAAM,qEAAqE,CAAC;AAC7E,OAAO,EAAE,mCAAmC,EAAE,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mB;IAuCjC;;;;;;OAMG;YACW,mBAAmB;IAsCjC;;;;;;OAMG;YACW,mBAAmB;IAiBjC;;;;;;;;;OASG;YACW,eAAe;IAiE7B;;;;;;;;;;;;OAYG;YACW,eAAe;IAiD7B;;;;;;;;;;;;OAYG;YACW,2BAA2B;YAS3B,0BAA0B;IAQxC;;;;;;;;;;;;;;;;;;OAkBG;YACW,yBAAyB;IAWvC;;;;;;;;;;;;;;;OAeG;YACW,0BAA0B;YAwB1B,6BAA6B;YAS7B,4BAA4B;YAQ5B,4BAA4B;YAQ5B,6BAA6B;CAO5C;AAED,eAAe,mBAAmB,CAAC"}
@@ -233,8 +233,6 @@ let CompanionController = class CompanionController extends AbstractControllerBa
233
233
  this.router.get('/build/next', this.asyncHandler(this.describeNextBuildTask.bind(this)));
234
234
  this.logRouteRegistration('get', '/build/next', 'What the next ready build-plan run would be (either executor) — read-only');
235
235
  this.router.post('/build/dispatch-next', this.asyncHandler(this.dispatchNextBuildTask.bind(this)));
236
- this.router.get('/build/dispatches', this.asyncHandler(this.readBuildDispatches.bind(this)));
237
- this.logRouteRegistration('get', '/build/dispatches', 'Outcomes of detached build dispatches (newest first) — the observation channel for runs that outlive an HTTP request');
238
236
  this.logRouteRegistration('post', '/build/dispatch-next', 'Run the next ready build-plan task (coding agent or companion generation step)');
239
237
  // ── Execution traces (what actually happened) ────────────────────
240
238
  this.router.get('/traces', this.asyncHandler(this.listExecutionTraces.bind(this)));
@@ -1620,28 +1618,10 @@ let CompanionController = class CompanionController extends AbstractControllerBa
1620
1618
  * time, the change-set is captured around it, and the required checks gate the result — and none of that
1621
1619
  * is accepted until a human commits.
1622
1620
  */
1623
- async readBuildDispatches(_req, res, next) {
1624
- try {
1625
- res.json({ dispatches: this.buildDispatchService.readDetachedDispatches() });
1626
- }
1627
- catch (error) {
1628
- next(error);
1629
- }
1630
- }
1631
1621
  async dispatchNextBuildTask(req, res, next) {
1632
1622
  try {
1633
1623
  const body = req.body || {};
1634
- const budget = Number.isSafeInteger(body.maximumTokenBudget) ? { maximumTokenBudget: body.maximumTokenBudget } : {};
1635
- // DETACHED mode: a generation step can outlive any reasonable HTTP ceiling (an i18n run
1636
- // measured 40+ minutes against the 30-minute server cap, 2026-09-04), and a response that
1637
- // dies with the socket leaves the operator blind. 202 + the selected plan now; the outcome
1638
- // is readable at GET /build/dispatches (and, for coding tasks, in the durable task row).
1639
- if (body.async === true) {
1640
- const plan = await this.buildDispatchService.submitBuildDispatchDetached(budget, this.getTraceSession(res));
1641
- res.status(202).json({ plan, dispatched: true, async: true, note: 'Running detached. Poll GET /build/dispatches for the outcome.' });
1642
- return;
1643
- }
1644
- const result = await this.buildDispatchService.dispatchNextBuildTask(budget, this.getTraceSession(res));
1624
+ const result = await this.buildDispatchService.dispatchNextBuildTask(Number.isSafeInteger(body.maximumTokenBudget) ? { maximumTokenBudget: body.maximumTokenBudget } : {}, this.getTraceSession(res));
1645
1625
  res.json({
1646
1626
  plan: result.plan,
1647
1627
  dispatched: true,
@@ -1832,13 +1812,8 @@ let CompanionController = class CompanionController extends AbstractControllerBa
1832
1812
  async listPlaybooks(_req, res, next) {
1833
1813
  try {
1834
1814
  const board = await this.playbookRunService.listPlaybookEligibility();
1835
- /*
1836
- * No board-level `phase`. It reported a derived APPLICATION phase that was deleted on
1837
- * 2026-09-04 — an application is not in a mode of reasoning, it holds artifacts produced by
1838
- * several. Each row still carries the PLAYBOOK's own phase label, which is the only one that
1839
- * was ever true.
1840
- */
1841
1815
  res.json({
1816
+ phase: board.phase,
1842
1817
  eligibleCount: board.playbooks.filter((entry) => entry.eligible).length,
1843
1818
  playbooks: board.playbooks,
1844
1819
  });