@groundnuty/macf-core 0.2.36 → 0.2.38

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.
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAmB9C,wBAAgB,UAAU,IAAI,WAAW,CA+DxC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAmB9C,wBAAgB,UAAU,IAAI,WAAW,CAuExC"}
package/dist/config.js CHANGED
@@ -17,6 +17,13 @@ function requireFilePath(name) {
17
17
  }
18
18
  export function loadConfig() {
19
19
  const agentName = requireEnv('MACF_AGENT_NAME');
20
+ // macf#538: the routing IDENTITY (registry key + cert CN) is distinct from the
21
+ // OTEL bot-name. `MACF_AGENT_NAME` is the bot-name (e.g. `macf-devops-agent`,
22
+ // used for OTEL `gen_ai.agent.name`); `MACF_ROUTING_LABEL` is the registry-key
23
+ // / CN (e.g. `devops-agent`). They differ on the substrate; they coincide on
24
+ // greenfield agents (auditor) where name == label. Defaults to agentName so
25
+ // every existing agent is unchanged (back-compat: inert until set).
26
+ const routingLabel = process.env['MACF_ROUTING_LABEL'] || agentName;
20
27
  const caCertPath = requireFilePath('MACF_CA_CERT');
21
28
  const caKeyPath = resolveCaKeyPath(caCertPath);
22
29
  const agentCertPath = requireFilePath('MACF_AGENT_CERT');
@@ -51,6 +58,7 @@ export function loadConfig() {
51
58
  const tmuxWindow = process.env['MACF_TMUX_WINDOW'] || undefined;
52
59
  return {
53
60
  agentName,
61
+ routingLabel,
54
62
  agentType,
55
63
  agentRole,
56
64
  host,
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA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,CAAC;YACrE,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC/B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;gBACjD,MAAM,IAAI,WAAW,CAAC,iDAAiD,KAAK,GAAG,CAAC,CAAC;YACnF,CAAC;YACD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,CAAC;QACD,KAAK,OAAO,CAAC,CAAC,CAAC;YACb,4DAA4D;YAC5D,wEAAwE;YACxE,+DAA+D;YAC/D,kEAAkE;YAClE,8DAA8D;YAC9D,0DAA0D;YAC1D,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;YACnD,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,MAAM,IAAI,WAAW,CACnB,gEAAgE;oBAC9D,sEAAsE,CACzE,CAAC;YACJ,CAAC;YACD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QAC3C,CAAC;QACD;YACE,MAAM,IAAI,WAAW,CACnB,yEAAyE,YAAY,GAAG,CACzF,CAAC;IACN,CAAC;AACH,CAAC"}
package/dist/index.d.ts CHANGED
@@ -17,6 +17,9 @@ export * from './config.js';
17
17
  export * from './token.js';
18
18
  export * from './types.js';
19
19
  export * from './semver.js';
20
+ export * from './reflection.js';
21
+ export * from './norm.js';
22
+ export * from './protected-invariant-norms.js';
20
23
  export * from './mtls-health-ping.js';
21
24
  export * from './certs/index.js';
22
25
  export * from './registry/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AAIpC,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC5F,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AAIpC,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC5F,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC"}
package/dist/index.js CHANGED
@@ -17,6 +17,9 @@ export * from './config.js';
17
17
  export * from './token.js';
18
18
  export * from './types.js';
19
19
  export * from './semver.js';
20
+ export * from './reflection.js';
21
+ export * from './norm.js';
22
+ export * from './protected-invariant-norms.js';
20
23
  export * from './mtls-health-ping.js';
21
24
  export * from './certs/index.js';
22
25
  export * from './registry/index.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AAEpC,kEAAkE;AAClE,oEAAoE;AACpE,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AAEpC,kEAAkE;AAClE,oEAAoE;AACpE,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC"}
package/dist/norm.d.ts ADDED
@@ -0,0 +1,256 @@
1
+ /**
2
+ * Versioned structured-norm (Moise-style) representation + deontic
3
+ * conflict-checker (groundnuty/macf#504, DR-026 G2 — PR-1).
4
+ *
5
+ * This module gives the coordination protocol a *machine-checkable* form for
6
+ * its norms. A "norm" is a deontic statement — an obligation, permission, or
7
+ * prohibition — bound to a `(role, action, condition)` triple. G3's SECP
8
+ * invariant-validator (macf#505) consumes this representation to mechanically
9
+ * check that a proposed rule change never contradicts a protected invariant.
10
+ *
11
+ * --------------------------------------------------------------------------
12
+ * G2 MODELS, IT DOES NOT ENFORCE.
13
+ * --------------------------------------------------------------------------
14
+ * This is a *data model* only. The runtime governor is the existing set of
15
+ * `check-*.sh` PreToolUse/PostToolUse hooks plus the DR-026 auditor — they
16
+ * are what actually block/warn at tool-call time. `SceneSchema` below models
17
+ * the issue-lifecycle scene as data (states + transitions); it carries NO
18
+ * enforcement code. Nothing here runs at coordination time.
19
+ *
20
+ * --------------------------------------------------------------------------
21
+ * CONTROLLED VOCABULARIES — the load-bearing guardrail.
22
+ * --------------------------------------------------------------------------
23
+ * The conflict-checker matches norms on three keys: `role`, `action`,
24
+ * `condition`. If two genuinely-conflicting norms are spelled differently
25
+ * (`after_merge` vs `after-merge`), a naive checker silently fails to match
26
+ * them — producing FALSE CONFIDENCE, which is worse than no checker at all.
27
+ *
28
+ * To close that silent-miss, every match-key is a CLOSED Zod enum over a
29
+ * canonical token set, and `normalizeToken` is applied to inputs first
30
+ * (lowercase, collapse runs of `_`/whitespace/`-` to a single `-`). An
31
+ * unknown token after normalization is REJECTED by the schema, forcing a
32
+ * deliberate vocabulary extension rather than an accidental synonym.
33
+ *
34
+ * --------------------------------------------------------------------------
35
+ * POSITIVE-ACTION CONVENTION.
36
+ * --------------------------------------------------------------------------
37
+ * The `Action` enum carries ONLY positive actions (`self-merge`,
38
+ * `close-issue`, …) — NEVER negated forms (`not-self-merge`). Negation lives
39
+ * exclusively in the `deontic` field. This is deliberate: if negated actions
40
+ * were allowed, a `prohibition(merge-pr)` could be silently dodged by
41
+ * re-expressing it as `obligation(not-merge-pr)` — the same constraint under
42
+ * a key the conflict-checker would never group together. Keeping actions
43
+ * positive means a clash on a constraint is always visible on one shared key.
44
+ *
45
+ * --------------------------------------------------------------------------
46
+ * DEONTIC-CONFLICT MATRIX (within one (role, action, condition) group).
47
+ * --------------------------------------------------------------------------
48
+ * obligation ∧ prohibition → CONFLICT ("must" vs "must not")
49
+ * permission ∧ prohibition → CONFLICT ("may" vs "must not")
50
+ * obligation ∧ permission → consistent (obligation ⊨ permission)
51
+ * Same deontic on the same key is not a logical conflict; duplicate
52
+ * obligations get a NON-BLOCKING warning (likely a redundant rule).
53
+ *
54
+ * v1 SCOPE: matching is exact-token on the canonical triple. Condition
55
+ * subsumption (one condition implies another), temporal/deadline logic, and
56
+ * role-hierarchy inheritance are DEFERRED to the G3 increment (macf#505).
57
+ */
58
+ import { z } from 'zod';
59
+ /** Current norm schema version. Bump on a breaking shape change. */
60
+ export declare const NORM_SCHEMA_VERSION: "1.0";
61
+ /** Stable type-tag distinguishing norm records on a multi-kind ledger. */
62
+ export declare const NORM_KIND: "macf.norm";
63
+ /**
64
+ * Canonicalize a vocabulary token: lowercase, then collapse any run of
65
+ * underscores / whitespace / hyphens into a single hyphen, and trim leading
66
+ * and trailing hyphens. This is what makes `after_merge`, `after merge`,
67
+ * `After-Merge`, and `after--merge` all map to the ONE canonical token
68
+ * `after-merge`. Applied to every match-key before enum validation so the
69
+ * enum only ever sees canonical forms.
70
+ */
71
+ export declare function normalizeToken(s: string): string;
72
+ /**
73
+ * Canonical ROLE vocabulary — the coordination actors a norm can bind to.
74
+ * Closed set: an unknown role is rejected (extend deliberately).
75
+ */
76
+ export declare const ROLE_TOKENS: readonly ["reporter", "implementer", "reviewer", "auditor", "operator", "deployment", "agent"];
77
+ export declare const RoleSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodEnum<{
78
+ agent: "agent";
79
+ reporter: "reporter";
80
+ implementer: "implementer";
81
+ reviewer: "reviewer";
82
+ auditor: "auditor";
83
+ operator: "operator";
84
+ deployment: "deployment";
85
+ }>>;
86
+ export type Role = (typeof ROLE_TOKENS)[number];
87
+ /**
88
+ * Canonical ACTION vocabulary — POSITIVE actions only (see file header). Each
89
+ * is a thing an actor *does*; prohibition/obligation/permission is expressed
90
+ * via `deontic`, never by negating the action name.
91
+ */
92
+ export declare const ACTION_TOKENS: readonly ["close-issue", "merge-pr", "self-merge", "auto-close-keyword", "implement", "mutate-universal-rule", "ratify-rule-change"];
93
+ export declare const ActionSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodEnum<{
94
+ "close-issue": "close-issue";
95
+ "merge-pr": "merge-pr";
96
+ "self-merge": "self-merge";
97
+ "auto-close-keyword": "auto-close-keyword";
98
+ implement: "implement";
99
+ "mutate-universal-rule": "mutate-universal-rule";
100
+ "ratify-rule-change": "ratify-rule-change";
101
+ }>>;
102
+ export type Action = (typeof ACTION_TOKENS)[number];
103
+ /**
104
+ * Canonical CONDITION vocabulary — the circumstance under which the norm
105
+ * applies. `always` is the unconditioned default. Conditions are exact-match
106
+ * keys in v1 (no subsumption — deferred to G3).
107
+ */
108
+ export declare const CONDITION_TOKENS: readonly ["always", "after-merge", "without-non-author-approval", "on-foreign-reporter-issue"];
109
+ export declare const ConditionSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodEnum<{
110
+ always: "always";
111
+ "after-merge": "after-merge";
112
+ "without-non-author-approval": "without-non-author-approval";
113
+ "on-foreign-reporter-issue": "on-foreign-reporter-issue";
114
+ }>>;
115
+ export type Condition = (typeof CONDITION_TOKENS)[number];
116
+ /** The three deontic modalities. */
117
+ export declare const DeonticSchema: z.ZodEnum<{
118
+ obligation: "obligation";
119
+ permission: "permission";
120
+ prohibition: "prohibition";
121
+ }>;
122
+ export type Deontic = z.infer<typeof DeonticSchema>;
123
+ /** Which tier a norm belongs to (constitutional vs deployment-local). */
124
+ export declare const NormTierSchema: z.ZodEnum<{
125
+ project: "project";
126
+ universal: "universal";
127
+ }>;
128
+ export type NormTier = z.infer<typeof NormTierSchema>;
129
+ /**
130
+ * A single structured norm.
131
+ *
132
+ * `role` / `action` / `condition` are the three CANONICAL match-keys the
133
+ * conflict-checker groups on. `deontic` is the modality. `deadline` and
134
+ * `sanction` are optional descriptive fields (not used by the v1 checker —
135
+ * room for G3's temporal logic). `tier` + `provenance` record where the norm
136
+ * came from (the source rule / invariant), so a flagged conflict is traceable
137
+ * back to a human-readable rule.
138
+ */
139
+ export declare const NormSchema: z.ZodObject<{
140
+ id: z.ZodString;
141
+ schema_version: z.ZodLiteral<"1.0">;
142
+ kind: z.ZodLiteral<"macf.norm">;
143
+ role: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodEnum<{
144
+ agent: "agent";
145
+ reporter: "reporter";
146
+ implementer: "implementer";
147
+ reviewer: "reviewer";
148
+ auditor: "auditor";
149
+ operator: "operator";
150
+ deployment: "deployment";
151
+ }>>;
152
+ deontic: z.ZodEnum<{
153
+ obligation: "obligation";
154
+ permission: "permission";
155
+ prohibition: "prohibition";
156
+ }>;
157
+ action: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodEnum<{
158
+ "close-issue": "close-issue";
159
+ "merge-pr": "merge-pr";
160
+ "self-merge": "self-merge";
161
+ "auto-close-keyword": "auto-close-keyword";
162
+ implement: "implement";
163
+ "mutate-universal-rule": "mutate-universal-rule";
164
+ "ratify-rule-change": "ratify-rule-change";
165
+ }>>;
166
+ condition: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodEnum<{
167
+ always: "always";
168
+ "after-merge": "after-merge";
169
+ "without-non-author-approval": "without-non-author-approval";
170
+ "on-foreign-reporter-issue": "on-foreign-reporter-issue";
171
+ }>>;
172
+ deadline: z.ZodOptional<z.ZodString>;
173
+ sanction: z.ZodOptional<z.ZodString>;
174
+ tier: z.ZodEnum<{
175
+ project: "project";
176
+ universal: "universal";
177
+ }>;
178
+ provenance: z.ZodString;
179
+ }, z.core.$strip>;
180
+ export type Norm = z.infer<typeof NormSchema>;
181
+ /**
182
+ * A transition in the issue-lifecycle scene. `from`/`to` are state names;
183
+ * `roleGate` (optional) names the role permitted to drive the transition;
184
+ * `normRef` (optional) points at a `Norm.id` that governs it. Data-model
185
+ * only — no transition is *executed* anywhere; the runtime governor is the
186
+ * hooks + auditor.
187
+ */
188
+ export declare const TransitionSchema: z.ZodObject<{
189
+ from: z.ZodString;
190
+ to: z.ZodString;
191
+ roleGate: z.ZodOptional<z.ZodString>;
192
+ normRef: z.ZodOptional<z.ZodString>;
193
+ }, z.core.$strip>;
194
+ export type Transition = z.infer<typeof TransitionSchema>;
195
+ /**
196
+ * The issue-lifecycle scene: the set of states an issue moves through and the
197
+ * legal transitions between them, mirroring `coordination.md` §Issue
198
+ * Lifecycle + the agent-identity label table (open → in-progress → in-review
199
+ * → closed, with a blocked side-state). DATA ONLY — see file header.
200
+ */
201
+ export declare const SceneSchema: z.ZodObject<{
202
+ id: z.ZodString;
203
+ schema_version: z.ZodLiteral<"1.0">;
204
+ kind: z.ZodLiteral<"macf.scene">;
205
+ states: z.ZodArray<z.ZodString>;
206
+ transitions: z.ZodArray<z.ZodObject<{
207
+ from: z.ZodString;
208
+ to: z.ZodString;
209
+ roleGate: z.ZodOptional<z.ZodString>;
210
+ normRef: z.ZodOptional<z.ZodString>;
211
+ }, z.core.$strip>>;
212
+ }, z.core.$strip>;
213
+ export type Scene = z.infer<typeof SceneSchema>;
214
+ /** The kind of deontic clash the checker found. */
215
+ export declare const ConflictTypeSchema: z.ZodEnum<{
216
+ "obligation-vs-prohibition": "obligation-vs-prohibition";
217
+ "permission-vs-prohibition": "permission-vs-prohibition";
218
+ }>;
219
+ export type ConflictType = z.infer<typeof ConflictTypeSchema>;
220
+ /** A detected conflict: the two clashing norms + the clash type. */
221
+ export interface NormConflict {
222
+ readonly a: Norm;
223
+ readonly b: Norm;
224
+ readonly type: ConflictType;
225
+ }
226
+ /** A non-blocking advisory: same-key duplicate obligations (redundant rule). */
227
+ export interface NormWarning {
228
+ readonly a: Norm;
229
+ readonly b: Norm;
230
+ readonly kind: 'duplicate-obligation';
231
+ }
232
+ /** The result of a conflict-check pass. */
233
+ export interface ConflictCheckResult {
234
+ readonly conflicts: readonly NormConflict[];
235
+ readonly warnings: readonly NormWarning[];
236
+ }
237
+ /**
238
+ * Detect deontic conflicts among a set of norms.
239
+ *
240
+ * Groups norms by their already-canonical `(role, action, condition)` triple,
241
+ * then within each group compares every pair:
242
+ * - opposite-modality clashes (obligation/prohibition, permission/prohibition)
243
+ * are returned as CONFLICTS;
244
+ * - duplicate obligations on the same key are returned as non-blocking
245
+ * WARNINGS (a likely-redundant rule, not a contradiction).
246
+ *
247
+ * Because the keys are canonical (the schema normalized them), two norms that
248
+ * conflict but were spelled differently on input (`after_merge` vs
249
+ * `after-merge`) land in the SAME group and are correctly flagged — that is
250
+ * the whole point of the controlled vocabulary.
251
+ *
252
+ * v1 is exact-token grouping only. Condition subsumption, temporal/deadline
253
+ * reasoning, and role-hierarchy inheritance are DEFERRED to G3 (macf#505).
254
+ */
255
+ export declare function detectNormConflicts(norms: readonly Norm[]): ConflictCheckResult;
256
+ //# sourceMappingURL=norm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"norm.d.ts","sourceRoot":"","sources":["../src/norm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,oEAAoE;AACpE,eAAO,MAAM,mBAAmB,EAAG,KAAc,CAAC;AAElD,0EAA0E;AAC1E,eAAO,MAAM,SAAS,EAAG,WAAoB,CAAC;AAE9C;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAKhD;AAUD;;;GAGG;AACH,eAAO,MAAM,WAAW,gGAQd,CAAC;AACX,eAAO,MAAM,UAAU;;;;;;;;GAAiC,CAAC;AACzD,MAAM,MAAM,IAAI,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,aAAa,sIAQhB,CAAC;AACX,eAAO,MAAM,YAAY;;;;;;;;GAAmC,CAAC;AAC7D,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,gGAKnB,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Q,CAAC,CAAC,EAAE,IAAI,CAAC;IACjB,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC;IACjB,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC;CACvC;AAED,2CAA2C;AAC3C,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,SAAS,EAAE,SAAS,YAAY,EAAE,CAAC;IAC5C,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAC;CAC3C;AAyBD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,mBAAmB,CA4B/E"}
package/dist/norm.js ADDED
@@ -0,0 +1,252 @@
1
+ /**
2
+ * Versioned structured-norm (Moise-style) representation + deontic
3
+ * conflict-checker (groundnuty/macf#504, DR-026 G2 — PR-1).
4
+ *
5
+ * This module gives the coordination protocol a *machine-checkable* form for
6
+ * its norms. A "norm" is a deontic statement — an obligation, permission, or
7
+ * prohibition — bound to a `(role, action, condition)` triple. G3's SECP
8
+ * invariant-validator (macf#505) consumes this representation to mechanically
9
+ * check that a proposed rule change never contradicts a protected invariant.
10
+ *
11
+ * --------------------------------------------------------------------------
12
+ * G2 MODELS, IT DOES NOT ENFORCE.
13
+ * --------------------------------------------------------------------------
14
+ * This is a *data model* only. The runtime governor is the existing set of
15
+ * `check-*.sh` PreToolUse/PostToolUse hooks plus the DR-026 auditor — they
16
+ * are what actually block/warn at tool-call time. `SceneSchema` below models
17
+ * the issue-lifecycle scene as data (states + transitions); it carries NO
18
+ * enforcement code. Nothing here runs at coordination time.
19
+ *
20
+ * --------------------------------------------------------------------------
21
+ * CONTROLLED VOCABULARIES — the load-bearing guardrail.
22
+ * --------------------------------------------------------------------------
23
+ * The conflict-checker matches norms on three keys: `role`, `action`,
24
+ * `condition`. If two genuinely-conflicting norms are spelled differently
25
+ * (`after_merge` vs `after-merge`), a naive checker silently fails to match
26
+ * them — producing FALSE CONFIDENCE, which is worse than no checker at all.
27
+ *
28
+ * To close that silent-miss, every match-key is a CLOSED Zod enum over a
29
+ * canonical token set, and `normalizeToken` is applied to inputs first
30
+ * (lowercase, collapse runs of `_`/whitespace/`-` to a single `-`). An
31
+ * unknown token after normalization is REJECTED by the schema, forcing a
32
+ * deliberate vocabulary extension rather than an accidental synonym.
33
+ *
34
+ * --------------------------------------------------------------------------
35
+ * POSITIVE-ACTION CONVENTION.
36
+ * --------------------------------------------------------------------------
37
+ * The `Action` enum carries ONLY positive actions (`self-merge`,
38
+ * `close-issue`, …) — NEVER negated forms (`not-self-merge`). Negation lives
39
+ * exclusively in the `deontic` field. This is deliberate: if negated actions
40
+ * were allowed, a `prohibition(merge-pr)` could be silently dodged by
41
+ * re-expressing it as `obligation(not-merge-pr)` — the same constraint under
42
+ * a key the conflict-checker would never group together. Keeping actions
43
+ * positive means a clash on a constraint is always visible on one shared key.
44
+ *
45
+ * --------------------------------------------------------------------------
46
+ * DEONTIC-CONFLICT MATRIX (within one (role, action, condition) group).
47
+ * --------------------------------------------------------------------------
48
+ * obligation ∧ prohibition → CONFLICT ("must" vs "must not")
49
+ * permission ∧ prohibition → CONFLICT ("may" vs "must not")
50
+ * obligation ∧ permission → consistent (obligation ⊨ permission)
51
+ * Same deontic on the same key is not a logical conflict; duplicate
52
+ * obligations get a NON-BLOCKING warning (likely a redundant rule).
53
+ *
54
+ * v1 SCOPE: matching is exact-token on the canonical triple. Condition
55
+ * subsumption (one condition implies another), temporal/deadline logic, and
56
+ * role-hierarchy inheritance are DEFERRED to the G3 increment (macf#505).
57
+ */
58
+ import { z } from 'zod';
59
+ /** Current norm schema version. Bump on a breaking shape change. */
60
+ export const NORM_SCHEMA_VERSION = '1.0';
61
+ /** Stable type-tag distinguishing norm records on a multi-kind ledger. */
62
+ export const NORM_KIND = 'macf.norm';
63
+ /**
64
+ * Canonicalize a vocabulary token: lowercase, then collapse any run of
65
+ * underscores / whitespace / hyphens into a single hyphen, and trim leading
66
+ * and trailing hyphens. This is what makes `after_merge`, `after merge`,
67
+ * `After-Merge`, and `after--merge` all map to the ONE canonical token
68
+ * `after-merge`. Applied to every match-key before enum validation so the
69
+ * enum only ever sees canonical forms.
70
+ */
71
+ export function normalizeToken(s) {
72
+ return s
73
+ .toLowerCase()
74
+ .replace(/[\s_-]+/g, '-')
75
+ .replace(/^-+|-+$/g, '');
76
+ }
77
+ /**
78
+ * A Zod preprocessor that normalizes the input token before the wrapped enum
79
+ * validates it. Non-string inputs pass through untouched so the enum produces
80
+ * its normal type error.
81
+ */
82
+ const canonical = (schema) => z.preprocess((v) => (typeof v === 'string' ? normalizeToken(v) : v), schema);
83
+ /**
84
+ * Canonical ROLE vocabulary — the coordination actors a norm can bind to.
85
+ * Closed set: an unknown role is rejected (extend deliberately).
86
+ */
87
+ export const ROLE_TOKENS = [
88
+ 'reporter',
89
+ 'implementer',
90
+ 'reviewer',
91
+ 'auditor',
92
+ 'operator',
93
+ 'deployment',
94
+ 'agent',
95
+ ];
96
+ export const RoleSchema = canonical(z.enum(ROLE_TOKENS));
97
+ /**
98
+ * Canonical ACTION vocabulary — POSITIVE actions only (see file header). Each
99
+ * is a thing an actor *does*; prohibition/obligation/permission is expressed
100
+ * via `deontic`, never by negating the action name.
101
+ */
102
+ export const ACTION_TOKENS = [
103
+ 'close-issue',
104
+ 'merge-pr',
105
+ 'self-merge',
106
+ 'auto-close-keyword',
107
+ 'implement',
108
+ 'mutate-universal-rule',
109
+ 'ratify-rule-change',
110
+ ];
111
+ export const ActionSchema = canonical(z.enum(ACTION_TOKENS));
112
+ /**
113
+ * Canonical CONDITION vocabulary — the circumstance under which the norm
114
+ * applies. `always` is the unconditioned default. Conditions are exact-match
115
+ * keys in v1 (no subsumption — deferred to G3).
116
+ */
117
+ export const CONDITION_TOKENS = [
118
+ 'always',
119
+ 'after-merge',
120
+ 'without-non-author-approval',
121
+ 'on-foreign-reporter-issue',
122
+ ];
123
+ export const ConditionSchema = canonical(z.enum(CONDITION_TOKENS));
124
+ /** The three deontic modalities. */
125
+ export const DeonticSchema = z.enum(['obligation', 'permission', 'prohibition']);
126
+ /** Which tier a norm belongs to (constitutional vs deployment-local). */
127
+ export const NormTierSchema = z.enum(['universal', 'project']);
128
+ /**
129
+ * A single structured norm.
130
+ *
131
+ * `role` / `action` / `condition` are the three CANONICAL match-keys the
132
+ * conflict-checker groups on. `deontic` is the modality. `deadline` and
133
+ * `sanction` are optional descriptive fields (not used by the v1 checker —
134
+ * room for G3's temporal logic). `tier` + `provenance` record where the norm
135
+ * came from (the source rule / invariant), so a flagged conflict is traceable
136
+ * back to a human-readable rule.
137
+ */
138
+ export const NormSchema = z.object({
139
+ id: z.string(),
140
+ schema_version: z.literal(NORM_SCHEMA_VERSION),
141
+ kind: z.literal(NORM_KIND),
142
+ role: RoleSchema,
143
+ deontic: DeonticSchema,
144
+ action: ActionSchema,
145
+ condition: ConditionSchema,
146
+ deadline: z.string().optional(),
147
+ sanction: z.string().optional(),
148
+ tier: NormTierSchema,
149
+ provenance: z.string(),
150
+ });
151
+ /**
152
+ * A transition in the issue-lifecycle scene. `from`/`to` are state names;
153
+ * `roleGate` (optional) names the role permitted to drive the transition;
154
+ * `normRef` (optional) points at a `Norm.id` that governs it. Data-model
155
+ * only — no transition is *executed* anywhere; the runtime governor is the
156
+ * hooks + auditor.
157
+ */
158
+ export const TransitionSchema = z.object({
159
+ from: z.string(),
160
+ to: z.string(),
161
+ roleGate: z.string().optional(),
162
+ normRef: z.string().optional(),
163
+ });
164
+ /**
165
+ * The issue-lifecycle scene: the set of states an issue moves through and the
166
+ * legal transitions between them, mirroring `coordination.md` §Issue
167
+ * Lifecycle + the agent-identity label table (open → in-progress → in-review
168
+ * → closed, with a blocked side-state). DATA ONLY — see file header.
169
+ */
170
+ export const SceneSchema = z.object({
171
+ id: z.string(),
172
+ schema_version: z.literal(NORM_SCHEMA_VERSION),
173
+ kind: z.literal('macf.scene'),
174
+ states: z.array(z.string()),
175
+ transitions: z.array(TransitionSchema),
176
+ });
177
+ /** The kind of deontic clash the checker found. */
178
+ export const ConflictTypeSchema = z.enum([
179
+ 'obligation-vs-prohibition',
180
+ 'permission-vs-prohibition',
181
+ ]);
182
+ /** The canonical group key for a norm: its (role, action, condition) triple. */
183
+ function groupKey(n) {
184
+ // Values are already canonical (validated by the enums), so JSON-joining is
185
+ // a stable, collision-free key for grouping.
186
+ return JSON.stringify([n.role, n.action, n.condition]);
187
+ }
188
+ /**
189
+ * Is this an actual deontic conflict per the matrix? Returns the conflict
190
+ * type, or `null` if the pair is consistent.
191
+ *
192
+ * obligation ∧ prohibition → conflict
193
+ * permission ∧ prohibition → conflict
194
+ * obligation ∧ permission → consistent (obligation entails permission)
195
+ * same modality → consistent (handled as a warning elsewhere)
196
+ */
197
+ function clashType(d1, d2) {
198
+ const pair = new Set([d1, d2]);
199
+ if (pair.has('prohibition') && pair.has('obligation'))
200
+ return 'obligation-vs-prohibition';
201
+ if (pair.has('prohibition') && pair.has('permission'))
202
+ return 'permission-vs-prohibition';
203
+ return null;
204
+ }
205
+ /**
206
+ * Detect deontic conflicts among a set of norms.
207
+ *
208
+ * Groups norms by their already-canonical `(role, action, condition)` triple,
209
+ * then within each group compares every pair:
210
+ * - opposite-modality clashes (obligation/prohibition, permission/prohibition)
211
+ * are returned as CONFLICTS;
212
+ * - duplicate obligations on the same key are returned as non-blocking
213
+ * WARNINGS (a likely-redundant rule, not a contradiction).
214
+ *
215
+ * Because the keys are canonical (the schema normalized them), two norms that
216
+ * conflict but were spelled differently on input (`after_merge` vs
217
+ * `after-merge`) land in the SAME group and are correctly flagged — that is
218
+ * the whole point of the controlled vocabulary.
219
+ *
220
+ * v1 is exact-token grouping only. Condition subsumption, temporal/deadline
221
+ * reasoning, and role-hierarchy inheritance are DEFERRED to G3 (macf#505).
222
+ */
223
+ export function detectNormConflicts(norms) {
224
+ const groups = new Map();
225
+ for (const n of norms) {
226
+ const key = groupKey(n);
227
+ const bucket = groups.get(key);
228
+ if (bucket)
229
+ bucket.push(n);
230
+ else
231
+ groups.set(key, [n]);
232
+ }
233
+ const conflicts = [];
234
+ const warnings = [];
235
+ for (const bucket of groups.values()) {
236
+ for (let i = 0; i < bucket.length; i++) {
237
+ for (let j = i + 1; j < bucket.length; j++) {
238
+ const a = bucket[i];
239
+ const b = bucket[j];
240
+ const type = clashType(a.deontic, b.deontic);
241
+ if (type) {
242
+ conflicts.push({ a, b, type });
243
+ }
244
+ else if (a.deontic === 'obligation' && b.deontic === 'obligation') {
245
+ warnings.push({ a, b, kind: 'duplicate-obligation' });
246
+ }
247
+ }
248
+ }
249
+ }
250
+ return { conflicts, warnings };
251
+ }
252
+ //# sourceMappingURL=norm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"norm.js","sourceRoot":"","sources":["../src/norm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,oEAAoE;AACpE,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAc,CAAC;AAElD,0EAA0E;AAC1E,MAAM,CAAC,MAAM,SAAS,GAAG,WAAoB,CAAC;AAE9C;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,CAAS;IACtC,OAAO,CAAC;SACL,WAAW,EAAE;SACb,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC;SACxB,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC;AAED;;;;GAIG;AACH,MAAM,SAAS,GAAG,CAAsB,MAAS,EAAE,EAAE,CACnD,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAE/E;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,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C3C,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAE,CAAC;gBACrB,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAE,CAAC;gBACrB,MAAM,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;gBAC7C,IAAI,IAAI,EAAE,CAAC;oBACT,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;gBACjC,CAAC;qBAAM,IAAI,CAAC,CAAC,OAAO,KAAK,YAAY,IAAI,CAAC,CAAC,OAAO,KAAK,YAAY,EAAE,CAAC;oBACpE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,sBAAsB,EAAE,CAAC,CAAC;gBACxD,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;AACjC,CAAC"}
@@ -0,0 +1,37 @@
1
+ import type { Norm } from './norm.js';
2
+ import { z } from 'zod';
3
+ /**
4
+ * A protected invariant that is a structural PROPERTY rather than a deontic
5
+ * norm. `statement` restates the guarantee; `whyNotANorm` records why it
6
+ * resists the `(role, action, condition)` shape; `enforcement` names the
7
+ * mechanism that actually guarantees it at runtime.
8
+ */
9
+ export declare const StructuralInvariantSchema: z.ZodObject<{
10
+ id: z.ZodString;
11
+ statement: z.ZodString;
12
+ whyNotANorm: z.ZodString;
13
+ enforcement: z.ZodString;
14
+ }, z.core.$strip>;
15
+ export type StructuralInvariant = z.infer<typeof StructuralInvariantSchema>;
16
+ /**
17
+ * The norm-expressible protected invariants. Each `provenance` points back at
18
+ * the numbered entry in `design/protected-invariants.md`.
19
+ */
20
+ export declare const PROTECTED_INVARIANT_NORMS: readonly Norm[];
21
+ /**
22
+ * The structural-property protected invariants. These are guarantees the
23
+ * conflict-checker does NOT reason over — they are enforced by mechanisms, not
24
+ * by deontic logic. Tagged here so the full set of 10 is accounted for and G3
25
+ * knows to route them to the structural-enforcement check, not the norm
26
+ * conflict-check.
27
+ */
28
+ export declare const PROTECTED_STRUCTURAL_INVARIANTS: readonly StructuralInvariant[];
29
+ /**
30
+ * Short machine-readable taxonomy note: which of the 10 invariants became a
31
+ * norm vs a structural property. Mirrors `design/structured-norms.md`.
32
+ */
33
+ export declare const PROTECTED_INVARIANT_TAXONOMY: {
34
+ readonly normExpressible: readonly [1, 3, 5, 8, 9, 10];
35
+ readonly structural: readonly [2, 4, 6, 7];
36
+ };
37
+ //# sourceMappingURL=protected-invariant-norms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protected-invariant-norms.d.ts","sourceRoot":"","sources":["../src/protected-invariant-norms.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB;;;;;iBAKpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAW5E;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,IAAI,EAuFpD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B,EAAE,SAAS,mBAAmB,EAqCzE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B;;;CAG/B,CAAC"}
@@ -0,0 +1,196 @@
1
+ /**
2
+ * The 10 protected invariants, expressed in the structured-norm representation
3
+ * (groundnuty/macf#504, DR-026 G2 — PR-1).
4
+ *
5
+ * Source of truth for the prose: `design/protected-invariants.md` (ratified
6
+ * 2026-06-16). This module is the *machine-readable* projection of that set,
7
+ * the foundation G3's SECP invariant-validator (macf#505) consumes to check a
8
+ * proposed rule change against the constitutional core.
9
+ *
10
+ * --------------------------------------------------------------------------
11
+ * NORM-vs-STRUCTURAL TAXONOMY.
12
+ * --------------------------------------------------------------------------
13
+ * Not every invariant is a deontic norm. Forcing a property-invariant into a
14
+ * `(role, action, condition)` shape it doesn't fit produces a norm that lies
15
+ * about what it constrains — and the conflict-checker would then reason over a
16
+ * fiction. So each invariant is classified:
17
+ *
18
+ * - NORM-EXPRESSIBLE → a `Norm` (obligation/permission/prohibition bound to
19
+ * a role + a positive action + a condition).
20
+ * - STRUCTURAL PROPERTY → a `StructuralInvariant` (a property/meta-principle
21
+ * enforced by a mechanism — a hook, the
22
+ * result-invariant pattern — NOT by a deontic norm).
23
+ *
24
+ * The split (and the #4/#7 judgement calls) is documented in
25
+ * `design/structured-norms.md` and asserted by the tests.
26
+ *
27
+ * #1 reporter-owns-closure → NORM obligation
28
+ * #2 identity ↔ attribution → STRUCTURAL (a property of every action)
29
+ * #3 LGTM gate / no-self-merge → NORM prohibition
30
+ * #4 routing integrity → STRUCTURAL (a property of comments; the
31
+ * @mention is a transport precondition,
32
+ * not a role's deontic action — science
33
+ * leaned structural; concurred)
34
+ * #5 auto-close discipline → NORM prohibition
35
+ * #6 fail-loud over silent-fallback → STRUCTURAL (a meta-principle over ops)
36
+ * #7 PR-for-every-artifact → STRUCTURAL (no clean positive action
37
+ * token without contortion; "land via PR"
38
+ * is a property of the artifact-landing
39
+ * path, enforced by hooks/CI/review —
40
+ * science leaned structural; concurred)
41
+ * #8 auditor never-acts → NORM prohibition (×3 actions)
42
+ * #9 operator-as-ratifier → NORM obligation
43
+ * #10 universal rules not locally → NORM prohibition
44
+ * mutable
45
+ */
46
+ import { NormSchema, NORM_SCHEMA_VERSION, NORM_KIND } from './norm.js';
47
+ import { z } from 'zod';
48
+ /**
49
+ * A protected invariant that is a structural PROPERTY rather than a deontic
50
+ * norm. `statement` restates the guarantee; `whyNotANorm` records why it
51
+ * resists the `(role, action, condition)` shape; `enforcement` names the
52
+ * mechanism that actually guarantees it at runtime.
53
+ */
54
+ export const StructuralInvariantSchema = z.object({
55
+ id: z.string(),
56
+ statement: z.string(),
57
+ whyNotANorm: z.string(),
58
+ enforcement: z.string(),
59
+ });
60
+ /** Shorthand to build a validated `Norm` with the fixed envelope fields. */
61
+ function norm(spec) {
62
+ return NormSchema.parse({
63
+ ...spec,
64
+ schema_version: NORM_SCHEMA_VERSION,
65
+ kind: NORM_KIND,
66
+ });
67
+ }
68
+ /**
69
+ * The norm-expressible protected invariants. Each `provenance` points back at
70
+ * the numbered entry in `design/protected-invariants.md`.
71
+ */
72
+ export const PROTECTED_INVARIANT_NORMS = [
73
+ // #1 — the agent who opened an issue owns its closure (after the fix merges).
74
+ norm({
75
+ id: 'pi-1-reporter-owns-closure',
76
+ role: 'reporter',
77
+ deontic: 'obligation',
78
+ action: 'close-issue',
79
+ condition: 'after-merge',
80
+ tier: 'universal',
81
+ provenance: 'protected-invariants.md #1',
82
+ }),
83
+ // #3 — no PR merges without a non-author APPROVED review.
84
+ norm({
85
+ id: 'pi-3-lgtm-gate',
86
+ role: 'implementer',
87
+ deontic: 'prohibition',
88
+ action: 'merge-pr',
89
+ condition: 'without-non-author-approval',
90
+ tier: 'universal',
91
+ provenance: 'protected-invariants.md #3',
92
+ }),
93
+ // #5 — never use a GitHub auto-close keyword on a foreign-reporter issue.
94
+ norm({
95
+ id: 'pi-5-auto-close-discipline',
96
+ role: 'implementer',
97
+ deontic: 'prohibition',
98
+ action: 'auto-close-keyword',
99
+ condition: 'on-foreign-reporter-issue',
100
+ tier: 'universal',
101
+ provenance: 'protected-invariants.md #5',
102
+ }),
103
+ // #8 — the auditor proposes only; it can neither merge, close others' work,
104
+ // nor implement. Modelled as three positive-action prohibitions (the
105
+ // positive-action convention forbids a single negated "act" token).
106
+ norm({
107
+ id: 'pi-8-auditor-never-merge',
108
+ role: 'auditor',
109
+ deontic: 'prohibition',
110
+ action: 'merge-pr',
111
+ condition: 'always',
112
+ tier: 'universal',
113
+ provenance: 'protected-invariants.md #8',
114
+ }),
115
+ norm({
116
+ id: 'pi-8-auditor-never-close',
117
+ role: 'auditor',
118
+ deontic: 'prohibition',
119
+ action: 'close-issue',
120
+ condition: 'always',
121
+ tier: 'universal',
122
+ provenance: 'protected-invariants.md #8',
123
+ }),
124
+ norm({
125
+ id: 'pi-8-auditor-never-implement',
126
+ role: 'auditor',
127
+ deontic: 'prohibition',
128
+ action: 'implement',
129
+ condition: 'always',
130
+ tier: 'universal',
131
+ provenance: 'protected-invariants.md #8',
132
+ }),
133
+ // #9 — no rule change is auto-applied; the operator ratifies.
134
+ norm({
135
+ id: 'pi-9-operator-ratifier',
136
+ role: 'operator',
137
+ deontic: 'obligation',
138
+ action: 'ratify-rule-change',
139
+ condition: 'always',
140
+ tier: 'universal',
141
+ provenance: 'protected-invariants.md #9',
142
+ }),
143
+ // #10 — a deployment may only PR universal rules upstream; never patch them
144
+ // locally.
145
+ norm({
146
+ id: 'pi-10-no-local-universal-mutation',
147
+ role: 'deployment',
148
+ deontic: 'prohibition',
149
+ action: 'mutate-universal-rule',
150
+ condition: 'always',
151
+ tier: 'universal',
152
+ provenance: 'protected-invariants.md #10',
153
+ }),
154
+ ];
155
+ /**
156
+ * The structural-property protected invariants. These are guarantees the
157
+ * conflict-checker does NOT reason over — they are enforced by mechanisms, not
158
+ * by deontic logic. Tagged here so the full set of 10 is accounted for and G3
159
+ * knows to route them to the structural-enforcement check, not the norm
160
+ * conflict-check.
161
+ */
162
+ export const PROTECTED_STRUCTURAL_INVARIANTS = [
163
+ {
164
+ id: 'pi-2-identity-attribution',
165
+ statement: 'Every agent action is attributed to that agent’s distinct external identity (its bot App), never silently to the operator or another agent.',
166
+ whyNotANorm: 'A cross-cutting PROPERTY of every action, not a single role’s deontic act on a (role, action, condition) key. There is no one "attribute" action to obligate/prohibit; the guarantee holds over all actions at once.',
167
+ enforcement: 'check-gh-token.sh (PreToolUse, ghs_ prefix) + check-gh-attribution.sh (PostToolUse result-invariant, macf#489/#491). silent-fallback Instances 1, 12.',
168
+ },
169
+ {
170
+ id: 'pi-4-routing-integrity',
171
+ statement: 'A cross-agent comment must carry a routing-active @mention to reach its recipient; describing-context mentions must not false-route.',
172
+ whyNotANorm: 'A property of the message-transport surface (a comment’s @mention is a delivery precondition), not a deontic action a role does. Modelling it as obligation(agent, mention, …) would contort a transport invariant into a role-action norm; science leaned structural and we concur.',
173
+ enforcement: 'check-mention-routing.sh Check A (must-have-mention) + Check B (must-not-leak describing-context). mention-routing-hygiene; macf#244/#272.',
174
+ },
175
+ {
176
+ id: 'pi-6-fail-loud',
177
+ statement: 'Operations that can silently fall back to a wrong identity/scope/target must assert a result-invariant, not merely an exit code.',
178
+ whyNotANorm: 'A meta-principle about HOW operations are written (assert the result, not just the exit code), spanning many actions — not a single (role, action, condition) deontic statement.',
179
+ enforcement: 'The result-invariant pattern (e.g. check-gh-attribution.sh checks who actually authored the resource). silent-fallback-hazards.',
180
+ },
181
+ {
182
+ id: 'pi-7-pr-for-every-artifact',
183
+ statement: 'Persistent artifacts land via PR (review + CI + audit + rollback checkpoint); only narrow operator-terminal recoveries excepted.',
184
+ whyNotANorm: 'No clean positive ACTION token captures "land via PR" without contortion — it is a property of the artifact-landing PATH (PR + review + CI), enforced by hooks/CI/review discipline, with an operator-terminal exception that a flat deontic norm cannot express. science leaned structural and we concur.',
185
+ enforcement: 'pr-discipline rules + the LGTM-gate hook (check-lgtm-gate.sh, macf#270) + CI required checks. pr-discipline; protected-invariants.md #7.',
186
+ },
187
+ ];
188
+ /**
189
+ * Short machine-readable taxonomy note: which of the 10 invariants became a
190
+ * norm vs a structural property. Mirrors `design/structured-norms.md`.
191
+ */
192
+ export const PROTECTED_INVARIANT_TAXONOMY = {
193
+ normExpressible: [1, 3, 5, 8, 9, 10],
194
+ structural: [2, 4, 6, 7],
195
+ };
196
+ //# sourceMappingURL=protected-invariant-norms.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protected-invariant-norms.js","sourceRoot":"","sources":["../src/protected-invariant-norms.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;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,MAAM,CAAC,MAAM,+BAA+B,GAAmC;IAC7E;QACE,EAAE,EAAE,2BAA2B;QAC/B,SAAS,EACP,6IAA6I;QAC/I,WAAW,EACT,sNAAsN;QACxN,WAAW,EACT,uJAAuJ;KAC1J;IACD;QACE,EAAE,EAAE,wBAAwB;QAC5B,SAAS,EACP,sIAAsI;QACxI,WAAW,EACT,sRAAsR;QACxR,WAAW,EACT,4IAA4I;KAC/I;IACD;QACE,EAAE,EAAE,gBAAgB;QACpB,SAAS,EACP,kIAAkI;QACpI,WAAW,EACT,kLAAkL;QACpL,WAAW,EACT,iIAAiI;KACpI;IACD;QACE,EAAE,EAAE,4BAA4B;QAChC,SAAS,EACP,kIAAkI;QACpI,WAAW,EACT,4SAA4S;QAC9S,WAAW,EACT,0IAA0I;KAC7I;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,eAAe,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;CAChB,CAAC"}
@@ -0,0 +1,152 @@
1
+ /**
2
+ * Versioned reflection-record schema (groundnuty/macf#500, DR-026 F2).
3
+ *
4
+ * A "reflection" is a single JSON object an agent emits at compaction time:
5
+ * the `harvest-reflection.sh` PreCompact hook (Deliverable 2) reads a *staged*
6
+ * reflection the agent maintains incrementally in
7
+ * `.claude/.macf/reflections/pending.json` (see `reflection-staging.md`), wraps
8
+ * it in this schema envelope, and appends it as one line to a local JSONL
9
+ * ledger. F4's Monitor imports this schema to read the ledger back.
10
+ *
11
+ * Forward-compat is carried by two envelope fields:
12
+ * - `schema_version` ("1.0") — F4's reader can branch on the version when the
13
+ * shape evolves.
14
+ * - `kind` ("macf.reflection") — a stable type-tag so a multi-kind ledger (or
15
+ * a shared bus) can discriminate reflection records from other record types.
16
+ *
17
+ * Defaults make a *mechanical-only* record valid: every array defaults to `[]`
18
+ * and `synthesis` to `""`. The hook ALWAYS emits a record at PreCompact (even
19
+ * with no staged content) so the Monitor sees that a compaction happened.
20
+ *
21
+ * The optional `key` fields on `observed_patterns` / `rule_evolution_signals`
22
+ * are reserved for deterministic cross-agent dedup later (G1's membrane) —
23
+ * additive and unused now.
24
+ */
25
+ import { z } from 'zod';
26
+ /** Current reflection schema version. Bump on a breaking shape change. */
27
+ export declare const REFLECTION_SCHEMA_VERSION: "1.0";
28
+ /** Stable type-tag distinguishing reflection records on a multi-kind ledger. */
29
+ export declare const REFLECTION_KIND: "macf.reflection";
30
+ /**
31
+ * A pattern the agent observed during the session — a recurring behaviour,
32
+ * coordination dynamic, or workflow shape worth surfacing. `tier_hint` is the
33
+ * agent's loose guess at where this belongs (e.g. a rule tier / promotion
34
+ * path); kept as a free-form string so the schema doesn't pin a taxonomy the
35
+ * governance layer hasn't frozen yet. `key` (optional) is the future
36
+ * cross-agent dedup handle — additive, unused now.
37
+ */
38
+ export declare const ObservedPatternSchema: z.ZodObject<{
39
+ pattern: z.ZodString;
40
+ evidence: z.ZodString;
41
+ tier_hint: z.ZodString;
42
+ key: z.ZodOptional<z.ZodString>;
43
+ }, z.core.$strip>;
44
+ export type ObservedPattern = z.infer<typeof ObservedPatternSchema>;
45
+ /**
46
+ * A canonical-rule breach the agent committed or witnessed. `rule` names the
47
+ * rule, `what` describes the breach, `ref` points at the supporting evidence
48
+ * (an issue/PR/commit ref, a file:line, a rule-doc anchor).
49
+ */
50
+ export declare const ReflectionBreachSchema: z.ZodObject<{
51
+ rule: z.ZodString;
52
+ what: z.ZodString;
53
+ ref: z.ZodString;
54
+ }, z.core.$strip>;
55
+ export type ReflectionBreach = z.infer<typeof ReflectionBreachSchema>;
56
+ /**
57
+ * A signal that a coordination rule should evolve — a proposal the governance
58
+ * layer (DR-026 auditor) can later weigh. `proposed_tier` is the tier the agent
59
+ * suggests the signal be promoted into (free-form for the same reason as
60
+ * `tier_hint` above). `key` (optional) is the future cross-agent dedup handle.
61
+ */
62
+ export declare const RuleEvolutionSignalSchema: z.ZodObject<{
63
+ signal: z.ZodString;
64
+ proposed_tier: z.ZodString;
65
+ rationale: z.ZodString;
66
+ key: z.ZodOptional<z.ZodString>;
67
+ }, z.core.$strip>;
68
+ export type RuleEvolutionSignal = z.infer<typeof RuleEvolutionSignalSchema>;
69
+ /** The agent's identity at emission time. */
70
+ export declare const ReflectionAgentSchema: z.ZodObject<{
71
+ name: z.ZodString;
72
+ role: z.ZodString;
73
+ login: z.ZodString;
74
+ }, z.core.$strip>;
75
+ export type ReflectionAgent = z.infer<typeof ReflectionAgentSchema>;
76
+ /**
77
+ * The full reflection record — one JSON object per JSONL line.
78
+ *
79
+ * `compaction_type` mirrors the PreCompact payload's `trigger` field
80
+ * ("auto" | "manual"); `null` when the hook couldn't read it. `trigger` is the
81
+ * fixed literal `"pre-compact"` recording WHICH hook produced the record (room
82
+ * for future non-compaction reflection emitters).
83
+ */
84
+ export declare const ReflectionRecordSchema: z.ZodObject<{
85
+ schema_version: z.ZodLiteral<"1.0">;
86
+ kind: z.ZodLiteral<"macf.reflection">;
87
+ agent: z.ZodObject<{
88
+ name: z.ZodString;
89
+ role: z.ZodString;
90
+ login: z.ZodString;
91
+ }, z.core.$strip>;
92
+ project: z.ZodString;
93
+ session_id: z.ZodString;
94
+ timestamp: z.ZodString;
95
+ trigger: z.ZodLiteral<"pre-compact">;
96
+ compaction_type: z.ZodNullable<z.ZodEnum<{
97
+ auto: "auto";
98
+ manual: "manual";
99
+ }>>;
100
+ observed_patterns: z.ZodDefault<z.ZodArray<z.ZodObject<{
101
+ pattern: z.ZodString;
102
+ evidence: z.ZodString;
103
+ tier_hint: z.ZodString;
104
+ key: z.ZodOptional<z.ZodString>;
105
+ }, z.core.$strip>>>;
106
+ breaches: z.ZodDefault<z.ZodArray<z.ZodObject<{
107
+ rule: z.ZodString;
108
+ what: z.ZodString;
109
+ ref: z.ZodString;
110
+ }, z.core.$strip>>>;
111
+ rule_evolution_signals: z.ZodDefault<z.ZodArray<z.ZodObject<{
112
+ signal: z.ZodString;
113
+ proposed_tier: z.ZodString;
114
+ rationale: z.ZodString;
115
+ key: z.ZodOptional<z.ZodString>;
116
+ }, z.core.$strip>>>;
117
+ unresolved: z.ZodDefault<z.ZodArray<z.ZodString>>;
118
+ synthesis: z.ZodDefault<z.ZodString>;
119
+ }, z.core.$strip>;
120
+ export type ReflectionRecord = z.infer<typeof ReflectionRecordSchema>;
121
+ /**
122
+ * The staged-reflection shape the agent maintains in
123
+ * `.claude/.macf/reflections/pending.json` (see `reflection-staging.md`). Only
124
+ * the protocol-signal fields live here — the envelope (`schema_version`,
125
+ * `kind`, `agent`, `project`, `session_id`, `timestamp`, `trigger`,
126
+ * `compaction_type`) is added by the hook at harvest time. Every field is
127
+ * optional/defaulted so an empty `{}` stage is valid (and is what the hook
128
+ * writes back to clear the stage).
129
+ */
130
+ export declare const ReflectionStageSchema: z.ZodObject<{
131
+ observed_patterns: z.ZodDefault<z.ZodArray<z.ZodObject<{
132
+ pattern: z.ZodString;
133
+ evidence: z.ZodString;
134
+ tier_hint: z.ZodString;
135
+ key: z.ZodOptional<z.ZodString>;
136
+ }, z.core.$strip>>>;
137
+ breaches: z.ZodDefault<z.ZodArray<z.ZodObject<{
138
+ rule: z.ZodString;
139
+ what: z.ZodString;
140
+ ref: z.ZodString;
141
+ }, z.core.$strip>>>;
142
+ rule_evolution_signals: z.ZodDefault<z.ZodArray<z.ZodObject<{
143
+ signal: z.ZodString;
144
+ proposed_tier: z.ZodString;
145
+ rationale: z.ZodString;
146
+ key: z.ZodOptional<z.ZodString>;
147
+ }, z.core.$strip>>>;
148
+ unresolved: z.ZodDefault<z.ZodArray<z.ZodString>>;
149
+ synthesis: z.ZodDefault<z.ZodString>;
150
+ }, z.core.$strip>;
151
+ export type ReflectionStage = z.infer<typeof ReflectionStageSchema>;
152
+ //# sourceMappingURL=reflection.d.ts.map
@@ -0,0 +1 @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* Versioned reflection-record schema (groundnuty/macf#500, DR-026 F2).
3
+ *
4
+ * A "reflection" is a single JSON object an agent emits at compaction time:
5
+ * the `harvest-reflection.sh` PreCompact hook (Deliverable 2) reads a *staged*
6
+ * reflection the agent maintains incrementally in
7
+ * `.claude/.macf/reflections/pending.json` (see `reflection-staging.md`), wraps
8
+ * it in this schema envelope, and appends it as one line to a local JSONL
9
+ * ledger. F4's Monitor imports this schema to read the ledger back.
10
+ *
11
+ * Forward-compat is carried by two envelope fields:
12
+ * - `schema_version` ("1.0") — F4's reader can branch on the version when the
13
+ * shape evolves.
14
+ * - `kind` ("macf.reflection") — a stable type-tag so a multi-kind ledger (or
15
+ * a shared bus) can discriminate reflection records from other record types.
16
+ *
17
+ * Defaults make a *mechanical-only* record valid: every array defaults to `[]`
18
+ * and `synthesis` to `""`. The hook ALWAYS emits a record at PreCompact (even
19
+ * with no staged content) so the Monitor sees that a compaction happened.
20
+ *
21
+ * The optional `key` fields on `observed_patterns` / `rule_evolution_signals`
22
+ * are reserved for deterministic cross-agent dedup later (G1's membrane) —
23
+ * additive and unused now.
24
+ */
25
+ import { z } from 'zod';
26
+ /** Current reflection schema version. Bump on a breaking shape change. */
27
+ export const REFLECTION_SCHEMA_VERSION = '1.0';
28
+ /** Stable type-tag distinguishing reflection records on a multi-kind ledger. */
29
+ export const REFLECTION_KIND = 'macf.reflection';
30
+ /**
31
+ * A pattern the agent observed during the session — a recurring behaviour,
32
+ * coordination dynamic, or workflow shape worth surfacing. `tier_hint` is the
33
+ * agent's loose guess at where this belongs (e.g. a rule tier / promotion
34
+ * path); kept as a free-form string so the schema doesn't pin a taxonomy the
35
+ * governance layer hasn't frozen yet. `key` (optional) is the future
36
+ * cross-agent dedup handle — additive, unused now.
37
+ */
38
+ export const ObservedPatternSchema = z.object({
39
+ pattern: z.string(),
40
+ evidence: z.string(),
41
+ tier_hint: z.string(),
42
+ key: z.string().optional(),
43
+ });
44
+ /**
45
+ * A canonical-rule breach the agent committed or witnessed. `rule` names the
46
+ * rule, `what` describes the breach, `ref` points at the supporting evidence
47
+ * (an issue/PR/commit ref, a file:line, a rule-doc anchor).
48
+ */
49
+ export const ReflectionBreachSchema = z.object({
50
+ rule: z.string(),
51
+ what: z.string(),
52
+ ref: z.string(),
53
+ });
54
+ /**
55
+ * A signal that a coordination rule should evolve — a proposal the governance
56
+ * layer (DR-026 auditor) can later weigh. `proposed_tier` is the tier the agent
57
+ * suggests the signal be promoted into (free-form for the same reason as
58
+ * `tier_hint` above). `key` (optional) is the future cross-agent dedup handle.
59
+ */
60
+ export const RuleEvolutionSignalSchema = z.object({
61
+ signal: z.string(),
62
+ proposed_tier: z.string(),
63
+ rationale: z.string(),
64
+ key: z.string().optional(),
65
+ });
66
+ /** The agent's identity at emission time. */
67
+ export const ReflectionAgentSchema = z.object({
68
+ name: z.string(),
69
+ role: z.string(),
70
+ login: z.string(),
71
+ });
72
+ /**
73
+ * The full reflection record — one JSON object per JSONL line.
74
+ *
75
+ * `compaction_type` mirrors the PreCompact payload's `trigger` field
76
+ * ("auto" | "manual"); `null` when the hook couldn't read it. `trigger` is the
77
+ * fixed literal `"pre-compact"` recording WHICH hook produced the record (room
78
+ * for future non-compaction reflection emitters).
79
+ */
80
+ export const ReflectionRecordSchema = z.object({
81
+ schema_version: z.literal(REFLECTION_SCHEMA_VERSION),
82
+ kind: z.literal(REFLECTION_KIND),
83
+ agent: ReflectionAgentSchema,
84
+ project: z.string(),
85
+ session_id: z.string(),
86
+ // ISO8601 UTC, e.g. 2026-06-16T04:40:39Z.
87
+ timestamp: z.string(),
88
+ trigger: z.literal('pre-compact'),
89
+ compaction_type: z.enum(['auto', 'manual']).nullable(),
90
+ // Arrays default [] and synthesis defaults "" → a mechanical-only record
91
+ // (no staged content) is valid. `.default()` keeps the field optional on the
92
+ // wire while inferring a non-optional type for consumers.
93
+ observed_patterns: z.array(ObservedPatternSchema).default([]),
94
+ breaches: z.array(ReflectionBreachSchema).default([]),
95
+ rule_evolution_signals: z.array(RuleEvolutionSignalSchema).default([]),
96
+ unresolved: z.array(z.string()).default([]),
97
+ synthesis: z.string().default(''),
98
+ });
99
+ /**
100
+ * The staged-reflection shape the agent maintains in
101
+ * `.claude/.macf/reflections/pending.json` (see `reflection-staging.md`). Only
102
+ * the protocol-signal fields live here — the envelope (`schema_version`,
103
+ * `kind`, `agent`, `project`, `session_id`, `timestamp`, `trigger`,
104
+ * `compaction_type`) is added by the hook at harvest time. Every field is
105
+ * optional/defaulted so an empty `{}` stage is valid (and is what the hook
106
+ * writes back to clear the stage).
107
+ */
108
+ export const ReflectionStageSchema = z.object({
109
+ observed_patterns: z.array(ObservedPatternSchema).default([]),
110
+ breaches: z.array(ReflectionBreachSchema).default([]),
111
+ rule_evolution_signals: z.array(RuleEvolutionSignalSchema).default([]),
112
+ unresolved: z.array(z.string()).default([]),
113
+ synthesis: z.string().default(''),
114
+ });
115
+ //# sourceMappingURL=reflection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reflection.js","sourceRoot":"","sources":["../src/reflection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,0EAA0E;AAC1E,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAc,CAAC;AAExD,gFAAgF;AAChF,MAAM,CAAC,MAAM,eAAe,GAAG,iBAA0B,CAAC;AAE1D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC3B,CAAC,CAAC;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,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,iBAAiB,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7D,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACrD,sBAAsB,EAAE,CAAC,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACtE,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC3C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;CAClC,CAAC,CAAC;AAGH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,iBAAiB,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7D,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACrD,sBAAsB,EAAE,CAAC,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACtE,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC3C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;CAClC,CAAC,CAAC"}
package/dist/types.d.ts CHANGED
@@ -45,6 +45,7 @@ export declare const NotifyPayloadSchema: z.ZodObject<{
45
45
  "session-end": "session-end";
46
46
  "turn-complete": "turn-complete";
47
47
  }>>;
48
+ github_anchor: z.ZodOptional<z.ZodString>;
48
49
  review_state: z.ZodOptional<z.ZodEnum<{
49
50
  approved: "approved";
50
51
  changes_requested: "changes_requested";
@@ -152,6 +153,15 @@ export declare const HealthResponseSchema: z.ZodObject<{
152
153
  export type HealthResponse = z.infer<typeof HealthResponseSchema>;
153
154
  export interface AgentConfig {
154
155
  readonly agentName: string;
156
+ /**
157
+ * The routing identity — registry key + cert CN (macf#538). Distinct from
158
+ * `agentName` (the OTEL bot-name): on the substrate `agentName` is
159
+ * `macf-devops-agent` while `routingLabel` is `devops-agent`; on greenfield
160
+ * agents they coincide. Sourced from `MACF_ROUTING_LABEL`, defaulting to
161
+ * `agentName` (back-compat). Use this — not `agentName` — for registry
162
+ * register/remove/collision lookups.
163
+ */
164
+ readonly routingLabel: string;
155
165
  readonly agentType: string;
156
166
  readonly agentRole: string;
157
167
  readonly host: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,gBAAgB;;;;;;;EA4B3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAK1D,eAAO,MAAM,0BAA0B;;;;;EAErC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiD9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;iBASpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;iBAUxC,CA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,WAAW,WAAW;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,cAAc,CAAC;IACzC,QAAQ,CAAC,eAAe,EAAE,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/D,QAAQ,CAAC,kBAAkB,EAAE,MAAM,IAAI,CAAC;CACzC"}
package/dist/types.js CHANGED
@@ -74,6 +74,8 @@ export const NotifyPayloadSchema = z.object({
74
74
  // design discriminates at the receiver from a property already there
75
75
  // for other reasons.
76
76
  event: z.enum(['session-end', 'turn-complete', 'error', 'custom']).optional(),
77
+ // macf#473: optional owner/repo#N anchor a peer_notification nudge is tied to, for the comms-ledger graph join.
78
+ github_anchor: z.string().optional(),
77
79
  // pr_review_state variant fields (macf-actions#39, v3.3.0). Optional
78
80
  // at the top level to preserve backward-compat. Producers (the
79
81
  // route-by-pr-review-state job) construct + validate against the
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,6CAA6C;AAE7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC;IACrC,cAAc;IACd,SAAS;IACT,eAAe;IACf,kEAAkE;IAClE,oEAAoE;IACpE,oEAAoE;IACpE,0DAA0D;IAC1D,gDAAgD;IAChD,eAAe;IACf,iEAAiE;IACjE,kEAAkE;IAClE,qEAAqE;IACrE,gEAAgE;IAChE,iEAAiE;IACjE,gEAAgE;IAChE,mEAAmE;IACnE,oDAAoD;IACpD,mBAAmB;IACnB,qEAAqE;IACrE,iEAAiE;IACjE,kEAAkE;IAClE,oEAAoE;IACpE,qEAAqE;IACrE,sEAAsE;IACtE,6DAA6D;IAC7D,+CAA+C;IAC/C,iBAAiB;CAClB,CAAC,CAAC;AAIH,iEAAiE;AACjE,qEAAqE;AACrE,6CAA6C;AAC7C,MAAM,CAAC,MAAM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,OAAO,CAAC,UAAU,CAAC;CAC9B,CAAC,CAAC;AAEH,yBAAyB;AAEzB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@groundnuty/macf-core",
3
- "version": "0.2.36",
3
+ "version": "0.2.38",
4
4
  "description": "Shared internals consumed by the MACF CLI and channel-server packages. Not intended for direct external use — will be marked deprecated-internal on first npm publish per DR-022 Amendment A.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",