openplanr 1.24.1 → 1.25.0

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 (55) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/cli/commands/operate.d.ts +2 -0
  3. package/dist/cli/commands/operate.d.ts.map +1 -1
  4. package/dist/cli/commands/operate.js +187 -23
  5. package/dist/cli/commands/operate.js.map +1 -1
  6. package/dist/services/operate/advisors.d.ts +128 -0
  7. package/dist/services/operate/advisors.d.ts.map +1 -1
  8. package/dist/services/operate/advisors.js +269 -24
  9. package/dist/services/operate/advisors.js.map +1 -1
  10. package/dist/services/operate/artifacts.d.ts +8 -0
  11. package/dist/services/operate/artifacts.d.ts.map +1 -1
  12. package/dist/services/operate/artifacts.js +22 -2
  13. package/dist/services/operate/artifacts.js.map +1 -1
  14. package/dist/services/operate/citation-resolution.d.ts +49 -3
  15. package/dist/services/operate/citation-resolution.d.ts.map +1 -1
  16. package/dist/services/operate/citation-resolution.js +295 -68
  17. package/dist/services/operate/citation-resolution.js.map +1 -1
  18. package/dist/services/operate/config.d.ts +25 -5
  19. package/dist/services/operate/config.d.ts.map +1 -1
  20. package/dist/services/operate/config.js +38 -7
  21. package/dist/services/operate/config.js.map +1 -1
  22. package/dist/services/operate/engine.d.ts +1 -1
  23. package/dist/services/operate/engine.d.ts.map +1 -1
  24. package/dist/services/operate/engine.js +8 -1
  25. package/dist/services/operate/engine.js.map +1 -1
  26. package/dist/services/operate/index.d.ts.map +1 -1
  27. package/dist/services/operate/index.js +33 -1
  28. package/dist/services/operate/index.js.map +1 -1
  29. package/dist/services/operate/maintenance.d.ts +1 -1
  30. package/dist/services/operate/maintenance.d.ts.map +1 -1
  31. package/dist/services/operate/maintenance.js +121 -16
  32. package/dist/services/operate/maintenance.js.map +1 -1
  33. package/dist/services/operate/migration.d.ts.map +1 -1
  34. package/dist/services/operate/migration.js +10 -2
  35. package/dist/services/operate/migration.js.map +1 -1
  36. package/dist/services/operate/projection-persistence.d.ts +33 -0
  37. package/dist/services/operate/projection-persistence.d.ts.map +1 -1
  38. package/dist/services/operate/projection-persistence.js +99 -2
  39. package/dist/services/operate/projection-persistence.js.map +1 -1
  40. package/dist/services/operate/protocol.d.ts +2 -0
  41. package/dist/services/operate/protocol.d.ts.map +1 -1
  42. package/dist/services/operate/protocol.js.map +1 -1
  43. package/dist/services/operate/read-only-providers.d.ts +1 -0
  44. package/dist/services/operate/read-only-providers.d.ts.map +1 -1
  45. package/dist/services/operate/read-only-providers.js +10 -5
  46. package/dist/services/operate/read-only-providers.js.map +1 -1
  47. package/dist/services/operate/report-html.d.ts +32 -0
  48. package/dist/services/operate/report-html.d.ts.map +1 -0
  49. package/dist/services/operate/report-html.js +289 -0
  50. package/dist/services/operate/report-html.js.map +1 -0
  51. package/dist/services/operate/workspace.d.ts +10 -1
  52. package/dist/services/operate/workspace.d.ts.map +1 -1
  53. package/dist/services/operate/workspace.js +23 -0
  54. package/dist/services/operate/workspace.js.map +1 -1
  55. package/package.json +1 -1
@@ -66,6 +66,7 @@ declare const missionAdvisorOutputSchema: z.ZodObject<{
66
66
  }>;
67
67
  citations: z.ZodArray<z.ZodObject<{
68
68
  citationKey: z.ZodOptional<z.ZodString>;
69
+ componentId: z.ZodOptional<z.ZodString>;
69
70
  repositoryPath: z.ZodOptional<z.ZodString>;
70
71
  lineRange: z.ZodOptional<z.ZodObject<{
71
72
  start: z.ZodNumber;
@@ -116,13 +117,110 @@ export interface AgentNativeAdvisorResponse {
116
117
  id: string;
117
118
  summary: string;
118
119
  actionKeys: string[];
120
+ /**
121
+ * Present when the conflict is action-versus-commitment rather than
122
+ * action-versus-action (operating-advisor-response v1.4, additive): the
123
+ * published commitment the action collides with. Threaded into the rendered
124
+ * conflict line — a commitment conflict that records but renders without its
125
+ * commitment is recorded-but-not-surfaced, the failure class this batch removes.
126
+ */
127
+ commitmentRef?: {
128
+ path: string;
129
+ statement: string;
130
+ };
119
131
  }>;
120
132
  }
133
+ /**
134
+ * SINGLE source of truth for the action `routeKind` → committed proposal `type`
135
+ * mapping. A Protocol v1.4 native ACTION carries a `routeKind`; the committed
136
+ * proposal it becomes carries a `type` from the frozen proposal-type vocabulary.
137
+ * Only a `decision` routeKind becomes a `decision` proposal; every other route
138
+ * kind (`quick-task`, `spec`, `epic`, `agent-artifact`, `experiment`, `metric`)
139
+ * becomes a `finding`. The registry-derived brief bounds
140
+ * (`deriveRegistryProposalImage`), the native-response normalizer, and the
141
+ * raw-response type projection all route through here so the three can never
142
+ * disagree on what an action becomes — the exact divergence that let the Chair's
143
+ * brief exclude `finding`/`decision` while every one of its actions mapped to
144
+ * them, so the Chair could record ZERO actions and failed on any action at all.
145
+ */
146
+ export declare function routeKindToProposalType(routeKind: string): 'finding' | 'decision';
147
+ interface AdvisorBriefRegistrySource {
148
+ createOperatingAdvisorBrief(roleId: string): OperatingAdvisorBrief;
149
+ listOperatingRoles(): Array<Record<string, unknown> & {
150
+ id: string;
151
+ }>;
152
+ }
153
+ /**
154
+ * Build a role's advisor brief with its proposal BOUNDS reconciled against the
155
+ * live role registry — the single source of truth — so the registry and the
156
+ * enforced runtime contract can never disagree again. The pipeline's pack-style
157
+ * brief is a frozen Protocol v1.2 compatibility projection whose
158
+ * `output.allowedProposalTypes` predate the v1.4 action model: for the Chair it is
159
+ * `['merge','sequence']`, DISJOINT from the set every one of the Chair's actions
160
+ * maps to (`finding`/`decision`). So the Chair could commit a quiet result but was
161
+ * rejected the instant it proposed a single bounded route — the exact defect this
162
+ * closes.
163
+ *
164
+ * Reconciliation:
165
+ * - `maximumProposals` is taken from the registry's `budgets.maxActions` (today
166
+ * already identical to the pipeline value for every role, but now set
167
+ * explicitly so a future registry cap edit cannot silently disagree with the
168
+ * runtime).
169
+ * - `allowedProposalTypes` is the UNION of the registry image and the frozen
170
+ * brief's existing types. The union ADDS the registry-reachable action types
171
+ * (`finding`/`decision`) — which is what unblocks the Chair — while LEAVING the
172
+ * frozen structural consolidation vocabulary (`merge`/`sequence` for the Chair;
173
+ * `data-gap` for the lenses) untouched: those have no action pre-image, so they
174
+ * are neither invented as action-reachable nor removed as capabilities. For
175
+ * every non-Chair role the image is already a subset of the frozen set, so the
176
+ * reconciliation is a byte-identical no-op there.
177
+ *
178
+ * The brief digest is recomputed over the reconciled content so the artifact stays
179
+ * internally consistent; `canonicalize` here is the same RFC 8785 JCS the pipeline
180
+ * signs briefs with, so a no-op reconciliation reproduces the pipeline digest
181
+ * exactly.
182
+ */
183
+ export declare function createRegistryReconciledAdvisorBrief(protocol: AdvisorBriefRegistrySource, roleId: string): OperatingAdvisorBrief;
184
+ export declare function normalizeAgentNativeResponse(response: AgentNativeAdvisorResponse, pinnedRevision: string): MissionAdvisorOutput;
121
185
  export declare function advisorResponseContractDetails(brief: OperatingAdvisorBrief): {
122
186
  expectedSchema: 'operating-advisor-response@1.2.0';
123
187
  example: unknown;
124
188
  };
189
+ /**
190
+ * One advisor-response contract violation, in the canonical `{path, rule, detail}`
191
+ * shape shared across every validation category so a runtime receives a single
192
+ * uniform list to act on.
193
+ */
194
+ export interface AdvisorContractIssue {
195
+ path: string;
196
+ rule: string;
197
+ detail: string;
198
+ }
199
+ /**
200
+ * Collect EVERY brief-level violation of a NORMALIZED advisor output — the
201
+ * proposal cap, disallowed proposal types, outcome/proposal consistency, and the
202
+ * output-byte ceiling — as `{path, rule, detail}` issues instead of throwing on
203
+ * the first. `assertAdvisorOutputMatchesBrief` wraps this to keep its throwing
204
+ * contract at the committed-output guards.
205
+ */
206
+ export declare function collectBriefContractViolations(brief: OperatingAdvisorBrief, output: Pick<OperatingRoleResult, 'outcome' | 'proposals'>): AdvisorContractIssue[];
125
207
  export declare function assertAdvisorOutputMatchesBrief(brief: OperatingAdvisorBrief, output: Pick<OperatingRoleResult, 'outcome' | 'proposals'>): void;
208
+ /**
209
+ * US-T1 batch validation: collect ALL advisor-response contract violations in one
210
+ * pass — the response-schema issues (a bad enum, a wrong-typed `gaps[].impact`, a
211
+ * malformed citation shape, …), the per-role proposal cap, and disallowed proposal
212
+ * types — as a single `{path, rule, detail}` list. Shared verbatim by the `record`
213
+ * path and the `harness validate` dry-run so the two can never diverge; the caller
214
+ * decides whether a non-empty list is a rejection (record) or a dry-run report
215
+ * (validate). Reads the RAW submitted response so a schema-invalid payload still
216
+ * discloses its cap/type violations in the same response instead of forcing a
217
+ * category-at-a-time resubmission cycle.
218
+ */
219
+ export declare function collectAdvisorResponseContractIssues(input: {
220
+ brief: OperatingAdvisorBrief;
221
+ response: unknown;
222
+ protocolVersion: '1.3.0' | '1.4.0';
223
+ }): Promise<AdvisorContractIssue[]>;
126
224
  export interface OperatingProviderManifestInput {
127
225
  id: string;
128
226
  providerId: string;
@@ -204,6 +302,24 @@ export interface OperatingMandate {
204
302
  };
205
303
  procedure?: string;
206
304
  responseSchema: 'operating-advisor-response@1.3.0' | 'operating-advisor-response@1.4.0';
305
+ /**
306
+ * US-T1: the DISCLOSED response contract the runtime must satisfy — the same
307
+ * bounds `record` enforces, shipped so an advisor can dereference them instead
308
+ * of only a `responseSchema` name it cannot resolve. Serialized verbatim from
309
+ * the role's brief output facet (`attachMandateResponseContract`); it introduces
310
+ * no new computation. Layered on by OpenPlanr AFTER the pipeline signs
311
+ * `mandateDigest` — exactly like `researchGuidance` — so it never alters the
312
+ * signed digest or the immutable mandate the digest pins. Absent only on the
313
+ * compatibility/pre-disclosure path.
314
+ */
315
+ output?: {
316
+ schema: OperatingAdvisorBrief['output']['schema'];
317
+ jsonSchema: Record<string, unknown>;
318
+ allowedProposalTypes: OperatingAdvisorBrief['output']['allowedProposalTypes'];
319
+ maximumProposals: number;
320
+ maximumOutputBytes: number;
321
+ requiredBehavior: string[];
322
+ };
207
323
  citationRequirement: {
208
324
  everyClaimCited: true;
209
325
  citationShape: 'operating-citation@1.3.0';
@@ -284,6 +400,18 @@ export declare function buildOperatingMandate(input: {
284
400
  /** FR12: the graceful per-role research time budget stated in the mandate prose. */
285
401
  researchBudgetMs?: number;
286
402
  }): Promise<OperatingMandate>;
403
+ /**
404
+ * US-T1: ship the disclosed response contract INSIDE the dispatched mandate.
405
+ * Serializes the role brief's ALREADY-COMPUTED output facet (schema pointer, the
406
+ * dereferenceable JSON Schema, allowed proposal types, the per-role proposal cap,
407
+ * the output-byte ceiling, and required behaviors) onto the mandate as its
408
+ * `output` block — no new computation, just disclosure of what `record` already
409
+ * enforces. Layered on AFTER the pipeline signs `mandateDigest` (the returned
410
+ * object keeps the pipeline's signed digest untouched), exactly like
411
+ * `researchGuidance`, so no digest recomputation is required and writer/verifier
412
+ * stay in agreement over the immutable, signed mandate the digest pins.
413
+ */
414
+ export declare function attachMandateResponseContract(mandate: OperatingMandate, brief: OperatingAdvisorBrief): OperatingMandate;
287
415
  /**
288
416
  * FR1/FR2: derive a mandate's declared read roots directly from the project
289
417
  * working tree — every top-level directory the agent may traverse — for the
@@ -1 +1 @@
1
- {"version":3,"file":"advisors.d.ts","sourceRoot":"","sources":["../../../src/services/operate/advisors.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAK7D,OAAO,EAA8B,KAAK,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC/F,OAAO,EAIL,KAAK,0BAA0B,EAIhC,MAAM,uBAAuB,CAAC;AAO/B,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AAsBpB,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAOd,CAAC;AACZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,C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ENPLANR_VERSION } from '../../utils/package-version.js';
9
9
  import { getAIProvider, isAIConfigured } from '../ai-service.js';
10
10
  import { loadConfig } from '../config-service.js';
11
+ import { isPlanrArtifactId } from './artifacts.js';
11
12
  import { canonicalDigest, canonicalize } from './canonical.js';
12
13
  import { buildOperatingBootstrapMap } from './context-research.js';
13
14
  import { createMissionToolset, MISSION_READ_ONLY_TOOLS, narrowMissionRootsToCeiling, operatingRuntimeEnforcesBoundedReadOnly, resolveOperatingDispatchIsolation, runMissionDispatchFanOut, } from './mission-dispatch.js';
@@ -42,13 +43,13 @@ const advisorOutputSchema = z
42
43
  conflicts: z.array(z.string()),
43
44
  })
44
45
  .strict();
45
- // The Protocol v1.3 mission (`operating-advisor-response@1.3.0`) proposal shape:
46
- // each proposal carries `citations` (repository path / git revision / planr
47
- // artifact, each bound to the cycle's frozen `pinnedRevision`) INSTEAD of the
48
- // v1.2 `evidenceRefs`. The pipeline snapshots each citation after the lens
49
- // returns; OpenPlanr never widens the set. Kept in lockstep with the installed
50
- // `schemas/v1.3.0/operating-citation.schema.json` so a locally parsed response
51
- // and the pipeline-validated one cannot drift.
46
+ // The mission proposal's citation shape, kept in lockstep with the anchor the
47
+ // record-time resolver validates (`operating-citation@1.4.0`): a repository path
48
+ // (relative, dot-prefixed roots allowed, no `..` traversal) / git revision /
49
+ // planr artifact (any real artifact class), optionally scoped to a workspace
50
+ // `componentId`, and bound to the cycle's frozen `pinnedRevision`. Each proposal
51
+ // carries `citations` INSTEAD of the v1.2 `evidenceRefs`; the resolver snapshots
52
+ // each citation after the lens returns and OpenPlanr never widens the set.
52
53
  const missionCitationSchema = z
53
54
  .object({
54
55
  citationKey: z
@@ -56,10 +57,15 @@ const missionCitationSchema = z
56
57
  .regex(/^[A-Za-z0-9._-]+$/)
57
58
  .max(128)
58
59
  .optional(),
60
+ componentId: z
61
+ .string()
62
+ .regex(/^[a-z][a-z0-9-]{0,63}$/)
63
+ .optional(),
59
64
  repositoryPath: z
60
65
  .string()
66
+ .min(1)
61
67
  .max(1024)
62
- .regex(/^(?!.*\.\.)[A-Za-z0-9][A-Za-z0-9._/-]*$/)
68
+ .regex(/^(?!\/)(?!.*(?:^|\/)\.\.(?:\/|$)).+$/)
63
69
  .optional(),
64
70
  lineRange: z
65
71
  .object({ start: z.number().int().min(1), end: z.number().int().min(1) })
@@ -67,13 +73,13 @@ const missionCitationSchema = z
67
73
  .optional(),
68
74
  gitRevision: z
69
75
  .string()
70
- .regex(/^[a-f0-9]{7,64}$/)
76
+ .regex(/^[A-Fa-f0-9]{7,64}$/)
71
77
  .optional(),
72
78
  planrArtifactId: z
73
79
  .string()
74
- .regex(/^(?:EPIC|FEAT|US|SPEC|TASK|ADR|DEC|FND|GAP|OUT)-[A-Za-z0-9._-]+$/)
80
+ .refine(isPlanrArtifactId, 'must name a known planr artifact class')
75
81
  .optional(),
76
- pinnedRevision: z.string().regex(/^[a-f0-9]{7,64}$/),
82
+ pinnedRevision: z.string().regex(/^[A-Fa-f0-9]{7,64}$/),
77
83
  })
78
84
  .strict();
79
85
  const missionProposalSchema = z
@@ -105,8 +111,13 @@ const missionAdvisorOutputSchema = z
105
111
  })
106
112
  .strict();
107
113
  function v14CitationToMission(value, pinnedRevision) {
114
+ // A `componentId` scopes a repository/git locator to a sibling workspace
115
+ // component so it is resolved against that component's checkout, not the
116
+ // control repository. Preserve it through the conversion.
117
+ const componentId = typeof value.componentId === 'string' ? { componentId: value.componentId } : {};
108
118
  if (value.kind === 'repository') {
109
119
  return {
120
+ ...componentId,
110
121
  repositoryPath: String(value.path),
111
122
  lineRange: { start: Number(value.startLine), end: Number(value.endLine) },
112
123
  pinnedRevision: String(value.revision),
@@ -114,6 +125,7 @@ function v14CitationToMission(value, pinnedRevision) {
114
125
  }
115
126
  if (value.kind === 'git') {
116
127
  return {
128
+ ...componentId,
117
129
  gitRevision: String(value.revision),
118
130
  pinnedRevision: String(value.revision),
119
131
  };
@@ -128,12 +140,108 @@ function v14CitationToMission(value, pinnedRevision) {
128
140
  // cannot be silently converted into a local repository citation.
129
141
  return null;
130
142
  }
131
- function normalizeAgentNativeResponse(response, pinnedRevision) {
143
+ /**
144
+ * SINGLE source of truth for the action `routeKind` → committed proposal `type`
145
+ * mapping. A Protocol v1.4 native ACTION carries a `routeKind`; the committed
146
+ * proposal it becomes carries a `type` from the frozen proposal-type vocabulary.
147
+ * Only a `decision` routeKind becomes a `decision` proposal; every other route
148
+ * kind (`quick-task`, `spec`, `epic`, `agent-artifact`, `experiment`, `metric`)
149
+ * becomes a `finding`. The registry-derived brief bounds
150
+ * (`deriveRegistryProposalImage`), the native-response normalizer, and the
151
+ * raw-response type projection all route through here so the three can never
152
+ * disagree on what an action becomes — the exact divergence that let the Chair's
153
+ * brief exclude `finding`/`decision` while every one of its actions mapped to
154
+ * them, so the Chair could record ZERO actions and failed on any action at all.
155
+ */
156
+ export function routeKindToProposalType(routeKind) {
157
+ return routeKind === 'decision' ? 'decision' : 'finding';
158
+ }
159
+ /** The two registry facets that drive a role's proposal bounds. */
160
+ const registryProposalBoundsSchema = z
161
+ .object({
162
+ allowedRouteKinds: z.array(z.string().min(1)).min(1),
163
+ budgets: z.object({ maxActions: z.number().int().positive() }),
164
+ })
165
+ .passthrough();
166
+ /**
167
+ * The IMAGE of a role's registry `allowedRouteKinds` under `routeKindToProposalType`
168
+ * — exactly the proposal types an action of one of those route kinds becomes, i.e.
169
+ * the set an advisor's actions can ACTUALLY produce — plus the registry's action
170
+ * cap (`budgets.maxActions`). `merge`/`sequence`/`data-gap` have no routeKind
171
+ * pre-image and are intentionally absent here (no action can reach them; making
172
+ * them action-expressible is a protocol question, not this derivation's job).
173
+ */
174
+ function deriveRegistryProposalImage(role) {
175
+ const parsed = registryProposalBoundsSchema.safeParse(role);
176
+ if (!parsed.success) {
177
+ throw new OperateError('E_OPERATE_STATE_INVALID', `Operating role registry entry ${role.id} is missing the allowedRouteKinds / budgets.maxActions needed to derive its proposal bounds.`);
178
+ }
179
+ return {
180
+ allowedProposalTypes: [
181
+ ...new Set(parsed.data.allowedRouteKinds.map(routeKindToProposalType)),
182
+ ].sort(),
183
+ maximumProposals: parsed.data.budgets.maxActions,
184
+ };
185
+ }
186
+ /**
187
+ * Build a role's advisor brief with its proposal BOUNDS reconciled against the
188
+ * live role registry — the single source of truth — so the registry and the
189
+ * enforced runtime contract can never disagree again. The pipeline's pack-style
190
+ * brief is a frozen Protocol v1.2 compatibility projection whose
191
+ * `output.allowedProposalTypes` predate the v1.4 action model: for the Chair it is
192
+ * `['merge','sequence']`, DISJOINT from the set every one of the Chair's actions
193
+ * maps to (`finding`/`decision`). So the Chair could commit a quiet result but was
194
+ * rejected the instant it proposed a single bounded route — the exact defect this
195
+ * closes.
196
+ *
197
+ * Reconciliation:
198
+ * - `maximumProposals` is taken from the registry's `budgets.maxActions` (today
199
+ * already identical to the pipeline value for every role, but now set
200
+ * explicitly so a future registry cap edit cannot silently disagree with the
201
+ * runtime).
202
+ * - `allowedProposalTypes` is the UNION of the registry image and the frozen
203
+ * brief's existing types. The union ADDS the registry-reachable action types
204
+ * (`finding`/`decision`) — which is what unblocks the Chair — while LEAVING the
205
+ * frozen structural consolidation vocabulary (`merge`/`sequence` for the Chair;
206
+ * `data-gap` for the lenses) untouched: those have no action pre-image, so they
207
+ * are neither invented as action-reachable nor removed as capabilities. For
208
+ * every non-Chair role the image is already a subset of the frozen set, so the
209
+ * reconciliation is a byte-identical no-op there.
210
+ *
211
+ * The brief digest is recomputed over the reconciled content so the artifact stays
212
+ * internally consistent; `canonicalize` here is the same RFC 8785 JCS the pipeline
213
+ * signs briefs with, so a no-op reconciliation reproduces the pipeline digest
214
+ * exactly.
215
+ */
216
+ export function createRegistryReconciledAdvisorBrief(protocol, roleId) {
217
+ const brief = protocol.createOperatingAdvisorBrief(roleId);
218
+ const role = protocol.listOperatingRoles().find((entry) => entry.id === roleId);
219
+ if (!role) {
220
+ throw new OperateError('E_OPERATE_STATE_INVALID', `Operating role ${roleId} is absent from the registry; its proposal bounds cannot be reconciled.`);
221
+ }
222
+ const image = deriveRegistryProposalImage(role);
223
+ const allowedProposalTypes = [
224
+ ...new Set([
225
+ ...brief.output.allowedProposalTypes,
226
+ ...image.allowedProposalTypes,
227
+ ]),
228
+ ].sort();
229
+ const { briefDigest: _priorDigest, ...unsigned } = {
230
+ ...brief,
231
+ output: {
232
+ ...brief.output,
233
+ allowedProposalTypes,
234
+ maximumProposals: image.maximumProposals,
235
+ },
236
+ };
237
+ return { ...unsigned, briefDigest: canonicalDigest(unsigned) };
238
+ }
239
+ export function normalizeAgentNativeResponse(response, pinnedRevision) {
132
240
  return {
133
241
  outcome: response.actions.length > 0 ? 'proposals' : 'quiet',
134
242
  proposals: response.actions.map((action) => ({
135
243
  proposalKey: action.actionKey,
136
- type: action.routeKind === 'decision' ? 'decision' : 'finding',
244
+ type: routeKindToProposalType(action.routeKind),
137
245
  title: action.title,
138
246
  problem: action.summary,
139
247
  proposal: action.summary,
@@ -152,7 +260,9 @@ function normalizeAgentNativeResponse(response, pinnedRevision) {
152
260
  .filter((citation) => citation !== null),
153
261
  })),
154
262
  gaps: response.gaps.map((gap) => `${gap.question} Impact: ${gap.impact}`),
155
- conflicts: response.conflicts.map((conflict) => conflict.summary),
263
+ conflicts: response.conflicts.map((conflict) => conflict.commitmentRef
264
+ ? `${conflict.summary} — conflicts with the published commitment "${conflict.commitmentRef.statement}" (${conflict.commitmentRef.path})`
265
+ : conflict.summary),
156
266
  };
157
267
  }
158
268
  export function advisorResponseContractDetails(brief) {
@@ -164,28 +274,139 @@ export function advisorResponseContractDetails(brief) {
164
274
  : [{ outcome: 'quiet', proposals: [], gaps: [], conflicts: [] }],
165
275
  };
166
276
  }
167
- export function assertAdvisorOutputMatchesBrief(brief, output) {
168
- if (output.proposals.length > brief.output.maximumProposals) {
169
- throw new OperateError('E_OPERATE_ADVISOR_FAILED', `Advisor ${brief.role.id} returned ${output.proposals.length} proposals; its canonical limit is ${brief.output.maximumProposals}.`);
277
+ /**
278
+ * SINGLE source of truth for the per-role proposal bounds — the proposal cap and
279
+ * the allowed proposal types — over an already-projected `{type}` list. Both the
280
+ * committed-output guard (`collectBriefContractViolations`) and the raw-response
281
+ * batch validator (`collectAdvisorResponseContractIssues`) route through here so
282
+ * the record path and the `harness validate` dry-run can never disagree on them.
283
+ */
284
+ function collectProposalBoundViolations(brief, proposals) {
285
+ const issues = [];
286
+ if (proposals.length > brief.output.maximumProposals) {
287
+ issues.push({
288
+ path: 'proposals',
289
+ rule: 'maximumProposals',
290
+ detail: `Advisor ${brief.role.id} returned ${proposals.length} proposals; its canonical limit is ${brief.output.maximumProposals}.`,
291
+ });
170
292
  }
171
293
  const allowed = new Set(brief.output.allowedProposalTypes);
172
294
  const disallowed = [
173
- ...new Set(output.proposals.map((proposal) => proposal.type).filter((type) => !allowed.has(type))),
295
+ ...new Set(proposals
296
+ .map((proposal) => proposal.type)
297
+ .filter((type) => typeof type === 'string' && !allowed.has(type))),
174
298
  ].sort();
175
299
  if (disallowed.length > 0) {
176
- throw new OperateError('E_OPERATE_ADVISOR_FAILED', `Advisor ${brief.role.id} returned proposal types outside its canonical brief: ${disallowed.join(', ')}.`);
300
+ issues.push({
301
+ path: 'proposals',
302
+ rule: 'allowedProposalTypes',
303
+ detail: `Advisor ${brief.role.id} returned proposal types outside its canonical brief: ${disallowed.join(', ')}.`,
304
+ });
177
305
  }
306
+ return issues;
307
+ }
308
+ /**
309
+ * Collect EVERY brief-level violation of a NORMALIZED advisor output — the
310
+ * proposal cap, disallowed proposal types, outcome/proposal consistency, and the
311
+ * output-byte ceiling — as `{path, rule, detail}` issues instead of throwing on
312
+ * the first. `assertAdvisorOutputMatchesBrief` wraps this to keep its throwing
313
+ * contract at the committed-output guards.
314
+ */
315
+ export function collectBriefContractViolations(brief, output) {
316
+ const issues = collectProposalBoundViolations(brief, output.proposals);
178
317
  if (output.outcome === 'quiet' && output.proposals.length > 0) {
179
- throw new OperateError('E_OPERATE_ADVISOR_FAILED', `Advisor ${brief.role.id} declared a quiet result with proposals.`);
318
+ issues.push({
319
+ path: 'outcome',
320
+ rule: 'outcome-consistency',
321
+ detail: `Advisor ${brief.role.id} declared a quiet result with proposals.`,
322
+ });
180
323
  }
181
324
  if (output.outcome === 'proposals' && output.proposals.length === 0) {
182
- throw new OperateError('E_OPERATE_ADVISOR_FAILED', `Advisor ${brief.role.id} declared proposals without a proposal.`);
325
+ issues.push({
326
+ path: 'outcome',
327
+ rule: 'outcome-consistency',
328
+ detail: `Advisor ${brief.role.id} declared proposals without a proposal.`,
329
+ });
183
330
  }
184
331
  const outputBytes = Buffer.byteLength(canonicalize(output), 'utf8');
185
332
  if (outputBytes > brief.output.maximumOutputBytes) {
186
- throw new OperateError('E_OPERATE_ADVISOR_FAILED', `Advisor ${brief.role.id} exceeded its canonical output budget.`);
333
+ issues.push({
334
+ path: 'output',
335
+ rule: 'maximumOutputBytes',
336
+ detail: `Advisor ${brief.role.id} exceeded its canonical output budget.`,
337
+ });
338
+ }
339
+ return issues;
340
+ }
341
+ export function assertAdvisorOutputMatchesBrief(brief, output) {
342
+ const violations = collectBriefContractViolations(brief, output);
343
+ if (violations.length > 0) {
344
+ throw new OperateError('E_OPERATE_ADVISOR_FAILED', violations.length === 1
345
+ ? violations[0].detail
346
+ : `Advisor ${brief.role.id} output violates its canonical brief in ${violations.length} ways: ${violations
347
+ .map((violation) => violation.detail)
348
+ .join(' ')}`, { issues: violations });
187
349
  }
188
350
  }
351
+ /**
352
+ * Project the proposal `{type}` list from a RAW submitted advisor response so the
353
+ * per-role cap and allowed-type checks can run even on a schema-invalid payload —
354
+ * a schema failure must never short-circuit the cap/type categories. v1.4 native
355
+ * responses carry `actions` whose `routeKind` maps to a proposal type exactly as
356
+ * `normalizeAgentNativeResponse` does (only `decision` is a decision proposal);
357
+ * v1.3 responses carry `proposals` with an explicit `type`.
358
+ */
359
+ function projectSubmittedProposalTypes(response, responseProtocol) {
360
+ const record = response && typeof response === 'object' && !Array.isArray(response)
361
+ ? response
362
+ : {};
363
+ if (responseProtocol === '1.4.0') {
364
+ const actions = Array.isArray(record.actions) ? record.actions : [];
365
+ return actions.map((action) => {
366
+ const routeKind = action && typeof action === 'object' && !Array.isArray(action)
367
+ ? action.routeKind
368
+ : undefined;
369
+ return { type: routeKindToProposalType(typeof routeKind === 'string' ? routeKind : '') };
370
+ });
371
+ }
372
+ const proposals = Array.isArray(record.proposals) ? record.proposals : [];
373
+ return proposals.map((proposal) => {
374
+ const type = proposal && typeof proposal === 'object' && !Array.isArray(proposal)
375
+ ? proposal.type
376
+ : undefined;
377
+ return { type: typeof type === 'string' ? type : undefined };
378
+ });
379
+ }
380
+ /**
381
+ * US-T1 batch validation: collect ALL advisor-response contract violations in one
382
+ * pass — the response-schema issues (a bad enum, a wrong-typed `gaps[].impact`, a
383
+ * malformed citation shape, …), the per-role proposal cap, and disallowed proposal
384
+ * types — as a single `{path, rule, detail}` list. Shared verbatim by the `record`
385
+ * path and the `harness validate` dry-run so the two can never diverge; the caller
386
+ * decides whether a non-empty list is a rejection (record) or a dry-run report
387
+ * (validate). Reads the RAW submitted response so a schema-invalid payload still
388
+ * discloses its cap/type violations in the same response instead of forcing a
389
+ * category-at-a-time resubmission cycle.
390
+ */
391
+ export async function collectAdvisorResponseContractIssues(input) {
392
+ const protocol = await loadOperatingProtocol();
393
+ const responseProtocol = input.protocolVersion === '1.4.0' ? '1.4.0' : '1.3.0';
394
+ const issues = [];
395
+ // Category 1 — response schema (bad enum, wrong-typed gap impact, malformed
396
+ // citation shape, missing required fields). The protocol validator already
397
+ // returns EVERY schema issue at once; we only stop it from being the sole
398
+ // category by continuing to the brief-level bounds below.
399
+ for (const issue of protocol.validateProtocolArtifact('operating-advisor-response', input.response, { protocolVersion: responseProtocol })) {
400
+ // Preserve the pipeline's specific failing rule (`enum`, `oneOf`, `type`, …)
401
+ // rather than flattening every schema failure to one label, so a runtime sees
402
+ // exactly which constraint each path violated.
403
+ issues.push({ path: issue.path, rule: issue.rule, detail: issue.detail });
404
+ }
405
+ // Categories 2 & 3 — per-role proposal cap + disallowed proposal types, read
406
+ // from the raw response so they surface alongside any schema issues.
407
+ issues.push(...collectProposalBoundViolations(input.brief, projectSubmittedProposalTypes(input.response, responseProtocol)));
408
+ return issues;
409
+ }
189
410
  const CHARTER_FIELDS_BY_ROLE = {
190
411
  'strategy-finance': [
191
412
  'purpose',
@@ -433,6 +654,30 @@ export async function buildOperatingMandate(input) {
433
654
  researchGuidance: buildMandateResearchGuidance(mandate, input.bootstrapMap ?? null, input.researchBudgetMs ?? null),
434
655
  };
435
656
  }
657
+ /**
658
+ * US-T1: ship the disclosed response contract INSIDE the dispatched mandate.
659
+ * Serializes the role brief's ALREADY-COMPUTED output facet (schema pointer, the
660
+ * dereferenceable JSON Schema, allowed proposal types, the per-role proposal cap,
661
+ * the output-byte ceiling, and required behaviors) onto the mandate as its
662
+ * `output` block — no new computation, just disclosure of what `record` already
663
+ * enforces. Layered on AFTER the pipeline signs `mandateDigest` (the returned
664
+ * object keeps the pipeline's signed digest untouched), exactly like
665
+ * `researchGuidance`, so no digest recomputation is required and writer/verifier
666
+ * stay in agreement over the immutable, signed mandate the digest pins.
667
+ */
668
+ export function attachMandateResponseContract(mandate, brief) {
669
+ return {
670
+ ...mandate,
671
+ output: {
672
+ schema: brief.output.schema,
673
+ jsonSchema: brief.output.jsonSchema,
674
+ allowedProposalTypes: [...brief.output.allowedProposalTypes],
675
+ maximumProposals: brief.output.maximumProposals,
676
+ maximumOutputBytes: brief.output.maximumOutputBytes,
677
+ requiredBehavior: [...brief.output.requiredBehavior],
678
+ },
679
+ };
680
+ }
436
681
  // A mandate's `boundaries.roots` items must satisfy this pattern (leading dot
437
682
  // permitted, no `..` traversal), so `.planr` is a valid declared root.
438
683
  const INLINE_MANDATE_ROOT_PATTERN = /^(?!.*\.\.)[A-Za-z0-9._][A-Za-z0-9._/-]*$/;
@@ -536,7 +781,7 @@ export async function createNativeMissionOperatingRoleResult(input) {
536
781
  }
537
782
  output = sanitizeMissionOutput(parsed.data);
538
783
  }
539
- const brief = protocol.createOperatingAdvisorBrief(input.mandate.roleId);
784
+ const brief = createRegistryReconciledAdvisorBrief(protocol, input.mandate.roleId);
540
785
  assertAdvisorOutputMatchesBrief(brief, output);
541
786
  const capability = brief.role.capabilityTier;
542
787
  // The intermediate result: proposals carry their v1.3 citations and an empty
@@ -834,7 +1079,7 @@ export async function dispatchOperatingAdvisors(input) {
834
1079
  dispatch,
835
1080
  };
836
1081
  }
837
- const roleBrief = protocol.createOperatingAdvisorBrief(role.roleId);
1082
+ const roleBrief = createRegistryReconciledAdvisorBrief(protocol, role.roleId);
838
1083
  const context = roleContext(input.context, role.roleId, new Set());
839
1084
  if (resolution.native) {
840
1085
  // Confine the native lens to the bounded read-only toolset over the