create-principles-disciple 1.134.8 → 1.135.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 (39) hide show
  1. package/console/dist/server/routes/update-history.d.ts +37 -0
  2. package/console/dist/server/routes/update-history.js +42 -0
  3. package/console/dist/server/routes/update.js +108 -1
  4. package/console/dist/server/update/mutation-controller.d.ts +41 -1
  5. package/console/dist/server/update/mutation-controller.js +34 -2
  6. package/core/dist/index.d.ts +1 -2
  7. package/core/dist/index.d.ts.map +1 -1
  8. package/core/dist/index.js +0 -2
  9. package/core/dist/index.js.map +1 -1
  10. package/core/dist/runtime-v2/index.d.ts +0 -3
  11. package/core/dist/runtime-v2/index.d.ts.map +1 -1
  12. package/core/dist/runtime-v2/index.js +0 -2
  13. package/core/dist/runtime-v2/index.js.map +1 -1
  14. package/core/package.json +1 -1
  15. package/dist/update/release-manager-authority.d.ts +13 -10
  16. package/dist/update/release-manager-authority.d.ts.map +1 -1
  17. package/dist/update/release-manager-authority.js +24 -14
  18. package/dist/update/release-manager-authority.js.map +1 -1
  19. package/dist/update/release-metadata-publisher.d.ts +142 -0
  20. package/dist/update/release-metadata-publisher.d.ts.map +1 -0
  21. package/dist/update/release-metadata-publisher.js +340 -0
  22. package/dist/update/release-metadata-publisher.js.map +1 -0
  23. package/package.json +1 -1
  24. package/plugin/dist/bundle.js +422 -422
  25. package/plugin/dist/governance-audit.js +157 -157
  26. package/plugin/dist/rulehost-evidence.js +166 -166
  27. package/release-manager/dist/update/release-manager-authority.d.ts +13 -10
  28. package/release-manager/dist/update/release-manager-authority.d.ts.map +1 -1
  29. package/release-manager/dist/update/release-manager-authority.js +24 -14
  30. package/release-manager/dist/update/release-manager-authority.js.map +1 -1
  31. package/release-manager/dist/update/release-metadata-publisher.d.ts +142 -0
  32. package/release-manager/dist/update/release-metadata-publisher.d.ts.map +1 -0
  33. package/release-manager/dist/update/release-metadata-publisher.js +340 -0
  34. package/release-manager/dist/update/release-metadata-publisher.js.map +1 -0
  35. package/release-manager/package.json +1 -1
  36. package/core/dist/runtime-v2/runtime-selector.d.ts +0 -77
  37. package/core/dist/runtime-v2/runtime-selector.d.ts.map +0 -1
  38. package/core/dist/runtime-v2/runtime-selector.js +0 -23
  39. package/core/dist/runtime-v2/runtime-selector.js.map +0 -1
@@ -1,4 +1,19 @@
1
1
  import type { IncomingMessage, ServerResponse } from 'node:http';
2
+ /**
3
+ * PRI-702 (ADR-0024 D-7): which authority actually performed the mutation.
4
+ *
5
+ * The vocabulary is REUSED from the MutationController — the one place that
6
+ * already names mutation authorities — so the history stream can never drift
7
+ * into a second authority vocabulary. `legacy-migration` is deliberately not
8
+ * listed: it writes the separate SPEC §12 stream (`<pdHome>/logs/history.jsonl`)
9
+ * and must not be conflated with this Owner-facing one.
10
+ *
11
+ * The field is additive and optional. Records written before PRI-702 have no
12
+ * `authority`; they are kept verbatim (no migration) and the reader never
13
+ * fabricates a value for them.
14
+ */
15
+ export declare const UPDATE_HISTORY_AUTHORITIES: readonly ["release-manager", "legacy-console-updater"];
16
+ export type UpdateHistoryAuthority = (typeof UPDATE_HISTORY_AUTHORITIES)[number];
2
17
  export declare const UPDATE_HISTORY_KINDS: readonly ['update', 'reinstall', 'legacy_migration', 'rollback', 'refusal', 'failure', 'recovery', 'unknown'];
3
18
  export type UpdateHistoryKind = (typeof UPDATE_HISTORY_KINDS)[number];
4
19
  interface UpdateHistoryEntry {
@@ -11,7 +26,29 @@ interface UpdateHistoryEntry {
11
26
  backupPath?: string;
12
27
  reason?: string;
13
28
  nextAction?: string;
29
+ /** PRI-702: authority that performed the mutation. Absent on pre-PRI-702 records. */
30
+ authority?: UpdateHistoryAuthority;
31
+ /**
32
+ * PRI-702: the transaction journal id of the update, when one exists.
33
+ * Correlates the Owner-facing event with the machine-recovery stream
34
+ * (`~/.pd/transactions/<transactionId>.jsonl`) — the two stay separate
35
+ * structures (ADR-0024 §2.5-2); this is a pointer, not a copy.
36
+ */
37
+ transactionId?: string;
14
38
  }
39
+ /**
40
+ * PRI-702 (ADR-0024 D-7): the ONE Owner-facing update-history writer.
41
+ *
42
+ * Both mutation authorities append through this function — the legacy console
43
+ * updater (every existing call site in `routes/update.ts`) and the
44
+ * ReleaseManager-served apply-full dispatch. There is no second writer and no
45
+ * authority-specific schema: callers differ only in the `authority` they pass.
46
+ *
47
+ * `authority` defaults to `legacy-console-updater` because that is the writer
48
+ * that has owned this stream since before PRI-702; a caller that omits it is
49
+ * by definition the legacy path. Every entry written from now on carries the
50
+ * field explicitly, so PRI-701's legacy-usage census can read it directly.
51
+ */
15
52
  export declare function appendUpdateHistory(workspaceDir: string, entry: Omit<UpdateHistoryEntry, 'id' | 'timestamp'>): void;
16
53
  export declare function handleUpdateHistoryRoute(req: IncomingMessage, res: ServerResponse, workspaceDir: string, _subPath: string): Promise<void>;
17
54
  export {};
@@ -1,6 +1,24 @@
1
1
  import * as fs from 'fs';
2
2
  import * as path from 'path';
3
3
  import { sendSuccess, sendMethodNotAllowed } from '../utils/response.js';
4
+ import { LEGACY_MUTATION_AUTHORITY, RELEASE_MANAGER_AUTHORITY, } from '../update/mutation-controller.js';
5
+ /**
6
+ * PRI-702 (ADR-0024 D-7): which authority actually performed the mutation.
7
+ *
8
+ * The vocabulary is REUSED from the MutationController — the one place that
9
+ * already names mutation authorities — so the history stream can never drift
10
+ * into a second authority vocabulary. `legacy-migration` is deliberately not
11
+ * listed: it writes the separate SPEC §12 stream (`<pdHome>/logs/history.jsonl`)
12
+ * and must not be conflated with this Owner-facing one.
13
+ *
14
+ * The field is additive and optional. Records written before PRI-702 have no
15
+ * `authority`; they are kept verbatim (no migration) and the reader never
16
+ * fabricates a value for them.
17
+ */
18
+ export const UPDATE_HISTORY_AUTHORITIES = [
19
+ RELEASE_MANAGER_AUTHORITY,
20
+ LEGACY_MUTATION_AUTHORITY,
21
+ ];
4
22
  export const UPDATE_HISTORY_KINDS = [
5
23
  'update',
6
24
  'reinstall',
@@ -14,6 +32,9 @@ export const UPDATE_HISTORY_KINDS = [
14
32
  function isHistoryKind(value) {
15
33
  return typeof value === 'string' && UPDATE_HISTORY_KINDS.includes(value);
16
34
  }
35
+ function isHistoryAuthority(value) {
36
+ return typeof value === 'string' && UPDATE_HISTORY_AUTHORITIES.includes(value);
37
+ }
17
38
  function parseHistoryEntry(value) {
18
39
  if (typeof value !== 'object' || value === null || Array.isArray(value))
19
40
  return undefined;
@@ -32,6 +53,8 @@ function parseHistoryEntry(value) {
32
53
  return undefined;
33
54
  if (raw.backupPath !== undefined && typeof raw.backupPath !== 'string')
34
55
  return undefined;
56
+ if (raw.transactionId !== undefined && typeof raw.transactionId !== 'string')
57
+ return undefined;
35
58
  return {
36
59
  id: raw.id,
37
60
  timestamp: raw.timestamp,
@@ -45,6 +68,11 @@ function parseHistoryEntry(value) {
45
68
  ...(typeof raw.backupPath === 'string' ? { backupPath: raw.backupPath } : {}),
46
69
  ...(typeof raw.reason === 'string' ? { reason: raw.reason } : {}),
47
70
  ...(typeof raw.nextAction === 'string' ? { nextAction: raw.nextAction } : {}),
71
+ // An authority outside the closed vocabulary is dropped rather than
72
+ // failing the whole entry: this stream is an Owner read model, and one
73
+ // unknown writer must not hide every other record (rc-3).
74
+ ...(isHistoryAuthority(raw.authority) ? { authority: raw.authority } : {}),
75
+ ...(typeof raw.transactionId === 'string' ? { transactionId: raw.transactionId } : {}),
48
76
  };
49
77
  }
50
78
  function getHistoryPath(workspaceDir) {
@@ -68,11 +96,25 @@ function loadHistory(historyPath) {
68
96
  }
69
97
  return [];
70
98
  }
99
+ /**
100
+ * PRI-702 (ADR-0024 D-7): the ONE Owner-facing update-history writer.
101
+ *
102
+ * Both mutation authorities append through this function — the legacy console
103
+ * updater (every existing call site in `routes/update.ts`) and the
104
+ * ReleaseManager-served apply-full dispatch. There is no second writer and no
105
+ * authority-specific schema: callers differ only in the `authority` they pass.
106
+ *
107
+ * `authority` defaults to `legacy-console-updater` because that is the writer
108
+ * that has owned this stream since before PRI-702; a caller that omits it is
109
+ * by definition the legacy path. Every entry written from now on carries the
110
+ * field explicitly, so PRI-701's legacy-usage census can read it directly.
111
+ */
71
112
  export function appendUpdateHistory(workspaceDir, entry) {
72
113
  const historyPath = getHistoryPath(workspaceDir);
73
114
  const history = loadHistory(historyPath);
74
115
  history.push({
75
116
  ...entry,
117
+ authority: entry.authority ?? LEGACY_MUTATION_AUTHORITY,
76
118
  id: `update-${Date.now()}`,
77
119
  timestamp: new Date().toISOString(),
78
120
  });
@@ -1827,7 +1827,9 @@ function releaseManagerFlagEnabled(workspaceDir) {
1827
1827
  }
1828
1828
  /**
1829
1829
  * PRI-698 Phase 1: gates routing /apply-full to the ReleaseManager write
1830
- * orchestration. Default off — the legacy updater serves with an explicit
1830
+ * orchestration. The registry default is ON (2026-09-07 graduation), so an
1831
+ * install with no explicit config value IS served by the ReleaseManager; only
1832
+ * an explicit `enabled: false` routes to the legacy updater, with the
1831
1833
  * `release_manager_write_disabled` fallback reason. Requires the shadow flag
1832
1834
  * too (the whole authority layer is gated on it first).
1833
1835
  */
@@ -1921,7 +1923,31 @@ async function runReleaseManagerCheckDispatch(mod, req, res, ctx) {
1921
1923
  * layer maps the outcome into the legacy doInlineFullUpdate response contract
1922
1924
  * ({success, message, reason?, nextAction?, newVersion?, requiresRestart}) —
1923
1925
  * wire contract unchanged. It performs NO runtime mutation itself.
1926
+ *
1927
+ * PRI-702 (ADR-0024 D-7): this boundary is also where the Owner-facing update
1928
+ * history is appended for an RM-served update, through the SAME
1929
+ * `appendUpdateHistory` writer the legacy updater uses. It is the only layer
1930
+ * that knows all three of the workspace (where the history lives), the
1931
+ * authority that served the mutation, and the final outcome — the installer
1932
+ * writes the transaction journal only, and a pre-transaction refusal writes
1933
+ * NO history event (the fallback's legacy event is the single record, see
1934
+ * `X-PD-Mutation-Fallback-Reason`).
1935
+ */
1936
+ /**
1937
+ * A history-write failure must never misreport a mutation that already
1938
+ * happened: the response still carries the true outcome (same policy as
1939
+ * `logLegacyJournalGap` above — blocking the Owner's update would be worse
1940
+ * than an unaudited one) but the audit gap is logged loud (rc-9).
1924
1941
  */
1942
+ function appendGovernedUpdateHistory(workspaceDir, entry) {
1943
+ try {
1944
+ appendUpdateHistory(workspaceDir, entry);
1945
+ }
1946
+ catch (error) {
1947
+ console.error(`[update] ReleaseManager-served mutation completed WITHOUT an update-history record (${error instanceof Error ? error.message : String(error)}). `
1948
+ + 'ADR-0024 D-7 requires every update to be auditable; the response still reports the real outcome.');
1949
+ }
1950
+ }
1925
1951
  async function runReleaseManagerApplyFullDispatch(mod, req, res, ctx) {
1926
1952
  if (req.method !== 'POST') {
1927
1953
  sendMethodNotAllowed(res);
@@ -1951,9 +1977,26 @@ async function runReleaseManagerApplyFullDispatch(mod, req, res, ctx) {
1951
1977
  await legacyApplyFullMutation(req, res, ctx);
1952
1978
  return;
1953
1979
  }
1980
+ // PRI-702 (ADR-0024 D-7): the pre-apply version, read from the SAME install
1981
+ // state the ReleaseManager used to decide the update (active.json) — never
1982
+ // from a second version source.
1983
+ const fromVersion = authority.installStatus?.productVersion ?? 'unknown';
1954
1984
  try {
1955
1985
  const outcome = await authority.manager.apply({ workspaceDir: ctx.workspaceDir });
1956
1986
  if (outcome.kind === 'applied') {
1987
+ // One update → one Owner-visible history event. The Console boundary is
1988
+ // the only layer that owns workspaceDir + authority + outcome together,
1989
+ // so the canonical writer is called here; the installer and the
1990
+ // ReleaseManager keep writing the transaction journal only (journal =
1991
+ // machine recovery, history = Owner audit, ADR-0024 §2.5-2).
1992
+ appendGovernedUpdateHistory(ctx.workspaceDir, {
1993
+ fromVersion,
1994
+ toVersion: outcome.productVersion,
1995
+ success: true,
1996
+ kind: 'update',
1997
+ authority: RELEASE_MANAGER_AUTHORITY,
1998
+ transactionId: outcome.transactionId,
1999
+ });
1957
2000
  sendSuccess(res, {
1958
2001
  success: true,
1959
2002
  message: `Updated to ${outcome.productVersion}. Transaction ${outcome.transactionId} confirmed in the journal.`,
@@ -1963,6 +2006,19 @@ async function runReleaseManagerApplyFullDispatch(mod, req, res, ctx) {
1963
2006
  });
1964
2007
  }
1965
2008
  else {
2009
+ // Legacy parity: the legacy updater records a `refusal` event when the
2010
+ // source does not advance the installation, so an RM-served "no update"
2011
+ // leaves the same trace instead of silence. No runtime byte changed —
2012
+ // toVersion stays at the installed version.
2013
+ appendGovernedUpdateHistory(ctx.workspaceDir, {
2014
+ fromVersion,
2015
+ toVersion: fromVersion,
2016
+ success: false,
2017
+ kind: 'refusal',
2018
+ reason: outcome.note,
2019
+ nextAction: 'No runtime change was made. Retry when a newer signed release is published.',
2020
+ authority: RELEASE_MANAGER_AUTHORITY,
2021
+ });
1966
2022
  sendSuccess(res, {
1967
2023
  success: true,
1968
2024
  message: `No update applied: ${outcome.note}`,
@@ -1986,6 +2042,19 @@ async function runReleaseManagerApplyFullDispatch(mod, req, res, ctx) {
1986
2042
  await legacyApplyFullMutation(req, res, ctx);
1987
2043
  return;
1988
2044
  }
2045
+ // PRI-702: a post-transaction failure is a real, terminal update attempt,
2046
+ // so it gets exactly one failure event under the ReleaseManager authority.
2047
+ // There is no legacy fallback on this path, hence no second event — the
2048
+ // runtime is left on the previous release (installer backup/restore).
2049
+ appendGovernedUpdateHistory(ctx.workspaceDir, {
2050
+ fromVersion,
2051
+ toVersion: 'failed',
2052
+ success: false,
2053
+ kind: 'failure',
2054
+ reason: mapped.reason,
2055
+ nextAction: mapped.nextAction ?? 'The runtime is unchanged. Retry the update after resolving the cause.',
2056
+ authority: RELEASE_MANAGER_AUTHORITY,
2057
+ });
1989
2058
  sendSuccess(res, {
1990
2059
  success: false,
1991
2060
  message: mapped.message,
@@ -2051,6 +2120,8 @@ async function syncReleaseManagerAuthority(workspaceDir) {
2051
2120
  updateMutationController.unregister(rmKind, RELEASE_MANAGER_AUTHORITY);
2052
2121
  // PRI-698 Phase 1: a structurally-ready apply-full with the write flag
2053
2122
  // off is a deliberate gate, not an unavailability — name it distinctly.
2123
+ // PRI-729: the reason is annotated with the declared vocabulary type, so
2124
+ // an undocumented fallback is a compile error — not a silent string.
2054
2125
  const reason = readiness.ready && rmKind === 'apply-full'
2055
2126
  ? 'release_manager_write_disabled'
2056
2127
  : `release_manager_unavailable:${readiness.reasons.join(',')}`;
@@ -2064,6 +2135,40 @@ const UPDATE_MUTATION_KINDS = new Map([
2064
2135
  ['/apply-full', 'apply-full'],
2065
2136
  ['/rollback', 'rollback'],
2066
2137
  ]);
2138
+ /** kind → wire path, for routing telemetry only. */
2139
+ const MUTATION_KIND_PATHS = new Map([...UPDATE_MUTATION_KINDS].map(([subPath, kind]) => [kind, `/api/update${subPath}`]));
2140
+ /**
2141
+ * PRI-729 — fail-loud routing telemetry (ADR-0024 D-1).
2142
+ *
2143
+ * The compatibility fallback is a designed migration state, and a migration
2144
+ * state nobody can see is indistinguishable from an accident. The
2145
+ * `X-PD-Mutation-Fallback-Reason` response header is per-request; this emits
2146
+ * ONE console line whenever a kind's resolved authority CHANGES, so an operator
2147
+ * can see exactly which kinds are still served by the legacy updater and why —
2148
+ * without the noise of the Companion's 6-hourly `/check` polling.
2149
+ *
2150
+ * Built from `describeGovernance()` rather than `resolveAuthority()`: the
2151
+ * former reports `active: 'none'` instead of throwing, so the telemetry needs
2152
+ * no alternate arm for the contract-impossible "no authority registered" state
2153
+ * (ERR-099 — a defensive alternate for an unreachable state ships uncovered).
2154
+ * The line is assembled branch-free from reachable-only parts.
2155
+ */
2156
+ const lastLoggedRouting = new Map();
2157
+ function logMutationRouting() {
2158
+ const governance = updateMutationController.describeGovernance();
2159
+ for (const kind of MUTATION_KINDS) {
2160
+ const info = governance[kind];
2161
+ const detail = [
2162
+ info.fallback ? 'compatibility fallback' : 'preferred authority',
2163
+ info.fallbackReason ?? '',
2164
+ ].filter((part) => part.length > 0).join(': ');
2165
+ const line = `${info.active} (${detail})`;
2166
+ if (lastLoggedRouting.get(kind) === line)
2167
+ continue;
2168
+ lastLoggedRouting.set(kind, line);
2169
+ console.log(`[update] ${MUTATION_KIND_PATHS.get(kind) ?? kind} → ${line}`);
2170
+ }
2171
+ }
2067
2172
  export async function handleUpdateRoute(req, res, workspaceDir, subPath) {
2068
2173
  const kind = UPDATE_MUTATION_KINDS.get(subPath);
2069
2174
  if (kind === undefined) {
@@ -2074,5 +2179,7 @@ export async function handleUpdateRoute(req, res, workspaceDir, subPath) {
2074
2179
  // readiness state before the controller resolves the authority. Pure
2075
2180
  // routing/decision work — no runtime mutation happens here.
2076
2181
  await syncReleaseManagerAuthority(workspaceDir);
2182
+ // PRI-729: make the routing decision observable (log on change only).
2183
+ logMutationRouting();
2077
2184
  await updateMutationController.dispatch(req, res, { workspaceDir }, kind);
2078
2185
  }
@@ -44,6 +44,40 @@ export declare const RELEASE_MANAGER_AUTHORITY: 'release-manager';
44
44
  export declare const PREFERRED_MUTATION_AUTHORITY: "release-manager";
45
45
  export type MutationKind = 'check' | 'apply' | 'apply-full' | 'rollback';
46
46
  export declare const MUTATION_KINDS: readonly MutationKind[];
47
+ /**
48
+ * PRI-729 — the closed vocabulary of compatibility-fallback reasons (ADR-0024 D-1).
49
+ *
50
+ * The ReleaseManager is the PREFERRED authority for every mutation kind and is
51
+ * consulted for all of them on every request (`createReleaseManagerAuthority`
52
+ * reports per-kind readiness before the controller resolves anything). A
53
+ * mutation therefore reaches the legacy console updater ONLY through one of the
54
+ * reasons below: the compatibility fallback is a DESIGNED migration decision,
55
+ * not an accident of which authority happened to register.
56
+ *
57
+ * Keeping the vocabulary closed is what makes "only an explicitly designed
58
+ * compatibility fallback may exist" checkable rather than aspirational — an
59
+ * undeclared reason is a type error at every call site and is reported loud at
60
+ * runtime (see `setFallbackReason`), never served silently.
61
+ *
62
+ * The parameterised forms carry a machine-readable sub-code after `:`:
63
+ * - `release_manager_unavailable:<readiness reasons>` — the authority module
64
+ * reports the kind not-ready (metadata source, layout, journal, or a
65
+ * capability the ReleaseManager does not implement).
66
+ * - `release_manager_refused_pre_transaction:<reason>` — the authority was
67
+ * ready but refused BEFORE opening a transaction (zero side effects), so
68
+ * the compatibility fallback may serve the request.
69
+ */
70
+ export type CompatFallbackReason = 'release_manager_shadow_disabled' | 'release_manager_write_disabled' | 'installer_missing' | 'authority_module_unavailable' | `release_manager_unavailable:${string}` | `release_manager_refused_pre_transaction:${string}`;
71
+ /** Literal (non-parameterised) compatibility-fallback reasons. */
72
+ export declare const COMPAT_FALLBACK_REASON_LITERALS: readonly ['release_manager_shadow_disabled', 'release_manager_write_disabled', 'installer_missing', 'authority_module_unavailable'];
73
+ /** Parameterised compatibility-fallback reason prefixes (sub-code follows `:`). */
74
+ export declare const COMPAT_FALLBACK_REASON_PREFIXES: readonly ['release_manager_unavailable:', 'release_manager_refused_pre_transaction:'];
75
+ /**
76
+ * True when `reason` belongs to the declared compatibility-fallback vocabulary.
77
+ * The wiring's runtime guard uses this so an undeclared reason is reported loud
78
+ * instead of being served as an undocumented degradation.
79
+ */
80
+ export declare function isDeclaredCompatFallbackReason(reason: string): boolean;
47
81
  export interface MutationContext {
48
82
  readonly workspaceDir: string;
49
83
  }
@@ -79,8 +113,14 @@ export declare class MutationController {
79
113
  * Emitted as the `X-PD-Mutation-Fallback-Reason` header whenever a dispatch
80
114
  * actually resolves to the fallback, and surfaced by describeGovernance().
81
115
  * Pass null to clear.
116
+ *
117
+ * PRI-729: the reason must be a member of the closed compatibility-fallback
118
+ * vocabulary. An undeclared reason is a programming error — a fallback was
119
+ * introduced without being designed — so it is reported loud (rc-9) while
120
+ * still being recorded, because refusing the Owner's mutation over a
121
+ * diagnostic string would be the worse failure.
82
122
  */
83
- setFallbackReason(kind: MutationKind, reason: string | null): void;
123
+ setFallbackReason(kind: MutationKind, reason: CompatFallbackReason | null): void;
84
124
  getFallbackReason(kind: MutationKind): string | undefined;
85
125
  register(kind: MutationKind, authority: MutationAuthority): void;
86
126
  unregister(kind: MutationKind, name: string): boolean;
@@ -11,6 +11,28 @@ export const RELEASE_MANAGER_AUTHORITY = 'release-manager';
11
11
  */
12
12
  export const PREFERRED_MUTATION_AUTHORITY = RELEASE_MANAGER_AUTHORITY;
13
13
  export const MUTATION_KINDS = ['check', 'apply', 'apply-full', 'rollback'];
14
+ /** Literal (non-parameterised) compatibility-fallback reasons. */
15
+ export const COMPAT_FALLBACK_REASON_LITERALS = [
16
+ 'release_manager_shadow_disabled',
17
+ 'release_manager_write_disabled',
18
+ 'installer_missing',
19
+ 'authority_module_unavailable',
20
+ ];
21
+ /** Parameterised compatibility-fallback reason prefixes (sub-code follows `:`). */
22
+ export const COMPAT_FALLBACK_REASON_PREFIXES = [
23
+ 'release_manager_unavailable:',
24
+ 'release_manager_refused_pre_transaction:',
25
+ ];
26
+ /**
27
+ * True when `reason` belongs to the declared compatibility-fallback vocabulary.
28
+ * The wiring's runtime guard uses this so an undeclared reason is reported loud
29
+ * instead of being served as an undocumented degradation.
30
+ */
31
+ export function isDeclaredCompatFallbackReason(reason) {
32
+ if (COMPAT_FALLBACK_REASON_LITERALS.includes(reason))
33
+ return true;
34
+ return COMPAT_FALLBACK_REASON_PREFIXES.some((prefix) => reason.startsWith(prefix) && reason.length > prefix.length);
35
+ }
14
36
  export class MutationController {
15
37
  authorities = new Map();
16
38
  /** PRI-672: per-kind reason the fallback is serving (machine-readable, rc-9). */
@@ -21,14 +43,24 @@ export class MutationController {
21
43
  * Emitted as the `X-PD-Mutation-Fallback-Reason` header whenever a dispatch
22
44
  * actually resolves to the fallback, and surfaced by describeGovernance().
23
45
  * Pass null to clear.
46
+ *
47
+ * PRI-729: the reason must be a member of the closed compatibility-fallback
48
+ * vocabulary. An undeclared reason is a programming error — a fallback was
49
+ * introduced without being designed — so it is reported loud (rc-9) while
50
+ * still being recorded, because refusing the Owner's mutation over a
51
+ * diagnostic string would be the worse failure.
24
52
  */
25
53
  setFallbackReason(kind, reason) {
26
54
  if (reason === null) {
27
55
  this.fallbackReasons.delete(kind);
56
+ return;
28
57
  }
29
- else {
30
- this.fallbackReasons.set(kind, reason);
58
+ if (!isDeclaredCompatFallbackReason(reason)) {
59
+ console.error(`[mutation-controller] undeclared compatibility-fallback reason for kind "${kind}": ${JSON.stringify(reason)}. `
60
+ + 'Every compatibility fallback must be declared in mutation-controller.ts '
61
+ + '(COMPAT_FALLBACK_REASON_LITERALS / COMPAT_FALLBACK_REASON_PREFIXES).');
31
62
  }
63
+ this.fallbackReasons.set(kind, reason);
32
64
  }
33
65
  getFallbackReason(kind) {
34
66
  return this.fallbackReasons.get(kind);
@@ -23,10 +23,9 @@ export { RUNTIME_V2_SCHEMA_VERSION, schemaRef, SchemaVersionRefSchema, RuntimeV2
23
23
  export { AGENT_IDS, AgentCapabilityRequirementsSchema, AgentTimeoutPolicySchema, AgentRetryPolicySchema, AgentSpecSchema, } from './runtime-v2/index.js';
24
24
  export { RuntimeKindSchema, RuntimeCapabilitiesSchema, RuntimeHealthSchema, RunHandleSchema, RunExecutionStatusSchema, RunStatusSchema, ContextItemSchema, AgentSpecRefSchema, WorkflowRefSchema, TaskRefSchema, StartRunInputSchema, StructuredRunOutputSchema, RuntimeArtifactRefSchema, } from './runtime-v2/index.js';
25
25
  export { PDTaskStatusSchema, TaskRecordSchema, DiagnosticianTaskRecordSchema, } from './runtime-v2/index.js';
26
- export { RuntimeSelectionCriteriaSchema, } from './runtime-v2/index.js';
27
26
  export { HistoryQueryEntrySchema, TrajectoryLocateQuerySchema, TrajectoryCandidateSchema, TrajectoryLocateResultSchema, HistoryQueryResultSchema, DiagnosisTargetSchema, ContextPayloadSchema, DiagnosticianContextPayloadSchema, } from './runtime-v2/index.js';
28
27
  export { DiagnosticianViolatedPrincipleSchema, DiagnosticianEvidenceSchema, RecommendationKindSchema, DiagnosticianRecommendationSchema, DiagnosticianOutputV1Schema, DiagnosticianInvocationInputSchema, } from './runtime-v2/index.js';
29
- export type { PDErrorCategory, AgentSpec, AgentCapabilityRequirements, AgentTimeoutPolicy, AgentRetryPolicy, WellKnownAgentId, RuntimeKind, RuntimeCapabilities, RuntimeHealth, RunHandle, RunExecutionStatus, RunStatus, ContextItem, AgentSpecRef, WorkflowRef, TaskRef, StartRunInput, StructuredRunOutput, RuntimeArtifactRef, PDRuntimeAdapter, RuntimeSelector, RuntimeSelectionCriteria, RuntimeSelectionResult, PDTaskStatus, TaskRecord, DiagnosticianTaskRecord, HistoryQueryEntry, TrajectoryLocateQuery, TrajectoryCandidate, TrajectoryLocateResult, HistoryQueryResult, DiagnosisTarget, ContextPayload, DiagnosticianContextPayload, DiagnosticianOutputV1, DiagnosticianViolatedPrinciple, DiagnosticianEvidence, RecommendationKind, DiagnosticianRecommendation, DiagnosticianInvocationInput, } from './runtime-v2/index.js';
28
+ export type { PDErrorCategory, AgentSpec, AgentCapabilityRequirements, AgentTimeoutPolicy, AgentRetryPolicy, WellKnownAgentId, RuntimeKind, RuntimeCapabilities, RuntimeHealth, RunHandle, RunExecutionStatus, RunStatus, ContextItem, AgentSpecRef, WorkflowRef, TaskRef, StartRunInput, StructuredRunOutput, RuntimeArtifactRef, PDRuntimeAdapter, PDTaskStatus, TaskRecord, DiagnosticianTaskRecord, HistoryQueryEntry, TrajectoryLocateQuery, TrajectoryCandidate, TrajectoryLocateResult, HistoryQueryResult, DiagnosisTarget, ContextPayload, DiagnosticianContextPayload, DiagnosticianOutputV1, DiagnosticianViolatedPrinciple, DiagnosticianEvidence, RecommendationKind, DiagnosticianRecommendation, DiagnosticianInvocationInput, } from './runtime-v2/index.js';
30
29
  export { RuntimeStateManager } from './runtime-v2/index.js';
31
30
  export type { RuntimeStateManagerOptions } from './runtime-v2/index.js';
32
31
  export { SqliteTaskStore, SqliteRunStore, MalformedRunError, SqliteConnection, SqliteTrajectoryLocator, SqliteSourceTraceLocator, SqliteHistoryQuery, SqliteContextAssembler, ResilientContextAssembler, ResilientHistoryQuery, DEFAULT_HISTORY_PAGE_SIZE, MAX_HISTORY_PAGE_SIZE, DEFAULT_TIME_WINDOW_MS, } from './runtime-v2/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;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EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrH,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAMzE,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,SAAS,EACT,qBAAqB,EACrB,gBAAgB,EAChB,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAGtH,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,8BAA8B,EAC9B,eAAe,EACf,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,EACzB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,cAAc,EACd,WAAW,EACX,cAAc,EACd,yBAAyB,EACzB,wBAAwB,EACxB,iB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EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG3E,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,YAAY,EACV,aAAa,EACb,cAAc,EACd,YAAY,EACZ,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AAGrC,YAAY,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrH,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAMzE,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC"}
@@ -30,8 +30,6 @@ export { AGENT_IDS, AgentCapabilityRequirementsSchema, AgentTimeoutPolicySchema,
30
30
  export { RuntimeKindSchema, RuntimeCapabilitiesSchema, RuntimeHealthSchema, RunHandleSchema, RunExecutionStatusSchema, RunStatusSchema, ContextItemSchema, AgentSpecRefSchema, WorkflowRefSchema, TaskRefSchema, StartRunInputSchema, StructuredRunOutputSchema, RuntimeArtifactRefSchema, } from './runtime-v2/index.js';
31
31
  // Task status schemas
32
32
  export { PDTaskStatusSchema, TaskRecordSchema, DiagnosticianTaskRecordSchema, } from './runtime-v2/index.js';
33
- // Runtime selector schemas
34
- export { RuntimeSelectionCriteriaSchema, } from './runtime-v2/index.js';
35
33
  // Context payload schemas (Phase 2)
36
34
  export { HistoryQueryEntrySchema, TrajectoryLocateQuerySchema, TrajectoryCandidateSchema, TrajectoryLocateResultSchema, HistoryQueryResultSchema, DiagnosisTargetSchema, ContextPayloadSchema, DiagnosticianContextPayloadSchema, } from './runtime-v2/index.js';
37
35
  // Diagnostician output schemas (Phase 2)
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,iGAAiG;AACjG,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,SAAS,EACT,qBAAqB,EACrB,gBAAgB,EAChB,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,2BAA2B,CAAC;AAGnC,6DAA6D;AAC7D,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,8BAA8B,EAC9B,eAAe,EACf,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AAYnC,sDAAsD;AACtD,OAAO,EACL,cAAc,EACd,WAAW,EACX,cAAc,EACd,yBAAyB,EACzB,wBAAwB,EACxB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,iCAAiC,GAClC,MAAM,2BAA2B,CAAC;AAQnC,0EAA0E;AAC1E,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAGtF,uCAAuC;AACvC,sEAAsE;AACtE,kEAAkE;AAElE,gCAAgC;AAChC,OAAO,EACL,yBAAyB,EACzB,SAAS,EACT,sBAAsB,EACtB,4BAA4B,EAC5B,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AAqB,EACrB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAkB/B,mBAAmB;AACnB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAG7D,gBAAgB;AAChB,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAExE,yBAAyB;AACzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAUnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAuBzE,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC"}
@@ -9,7 +9,6 @@
9
9
  * error-categories → PDErrorCategory, PDRuntimeError
10
10
  * agent-spec → AgentSpec, well-known agent IDs
11
11
  * runtime-protocol → PDRuntimeAdapter, RuntimeKind, run lifecycle types
12
- * runtime-selector → RuntimeSelector interface
13
12
  * task-status → PDTaskStatus, TaskRecord, DiagnosticianTaskRecord
14
13
  * context-payload → ContextPayload, history/trajectory types
15
14
  * diagnostician-output → DiagnosticianOutputV1
@@ -34,7 +33,6 @@ export { AgentCapabilityRequirementsSchema, AgentTimeoutPolicySchema, AgentRetry
34
33
  export { SchemaVersionRefSchema, RuntimeV2SchemaVersionSchema } from './schema-version.js';
35
34
  export { RuntimeKindSchema, RuntimeCapabilitiesSchema, RuntimeHealthSchema, RunHandleSchema, RunExecutionStatusSchema, RunStatusSchema, ContextItemSchema, AgentSpecRefSchema, WorkflowRefSchema, TaskRefSchema, StartRunInputSchema, StructuredRunOutputSchema, RuntimeArtifactRefSchema } from './runtime-protocol.js';
36
35
  export { PDTaskStatusSchema, TaskRecordSchema, DiagnosticianTaskRecordSchema, PD_TASK_STATUSES, isPDTaskStatus } from './task-status.js';
37
- export { RuntimeSelectionCriteriaSchema } from './runtime-selector.js';
38
36
  export { HistoryQueryEntrySchema, TrajectoryLocateQuerySchema, TrajectoryCandidateSchema, TrajectoryLocateResultSchema, HistoryQueryResultSchema, DiagnosisTargetSchema, ContextPayloadSchema, DiagnosticianContextPayloadSchema, ToolCallEntrySchema, PainContextSchema, FullTracePayloadSchema, FullTracePayloadV2Schema, TraceSourceRefSchema, TraceTimelineEntrySchema, TraceEventKindSchema, SourceRefKindSchema, validateFullTracePayload, sanitizeFullTracePayload, buildFullTraceTimeline, buildSourceRefs, checkFullTracePayloadSchema, TRACE_EVENT_KINDS, SOURCE_REF_KINDS } from './context-payload.js';
39
37
  export { refineFullTrace, REFINED_EVENT_KINDS, SEVERITY_LEVELS } from './trace-refiner.js';
40
38
  export type { RefinedTraceEvent, RefinedEventKind, RefinedTracePayload, SeverityLevel, TraceRefinerOptions } from './trace-refiner.js';
@@ -56,7 +54,6 @@ export { isPDErrorCategory } from './error-categories.js';
56
54
  export { AGENT_IDS } from './agent-spec.js';
57
55
  export type { AgentSpec, AgentCapabilityRequirements, AgentTimeoutPolicy, AgentRetryPolicy, WellKnownAgentId, } from './agent-spec.js';
58
56
  export type { RuntimeKind, RuntimeCapabilities, RuntimeHealth, RunHandle, RunExecutionStatus, RunStatus, ContextItem, AgentSpecRef, WorkflowRef, TaskRef, StartRunInput, StructuredRunOutput, RuntimeArtifactRef, PDRuntimeAdapter, } from './runtime-protocol.js';
59
- export type { RuntimeSelector, RuntimeSelectionCriteria, RuntimeSelectionResult, } from './runtime-selector.js';
60
57
  export type { PDTaskStatus, TaskRecord, DiagnosticianTaskRecord, } from './task-status.js';
61
58
  export type { HistoryQueryEntry, TrajectoryLocateQuery, TrajectoryCandidate, TrajectoryLocateResult, HistoryQueryResult, DiagnosisTarget, TraceAvailability, TraceUnavailableDetail, ContextPayload, DiagnosticianContextPayload, ToolCallEntry, PainContext, FullTracePayload, FullTracePayloadV2, TraceSourceRef, TraceTimelineEntry, TraceEventKind, SourceRefKind, FullTraceValidationResult, SanitizeFullTraceResult, RunRecordLike, } from './context-payload.js';
62
59
  export type { DiagnosticianOutputV1, DiagnosticianViolatedPrinciple, DiagnosticianEvidence, RecommendationKind, DiagnosticianRecommendation, DiagnosticianInvocationInput, } from './diagnostician-output.js';