instar 1.2.22 → 1.2.23

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.
@@ -4,6 +4,16 @@
4
4
  * Checks responses against agent values (AGENT.md), user values (USER.md),
5
5
  * and org values (ORG-INTENT.md). Uses separate boundaries for each value
6
6
  * section. Defaults to 'sonnet' model for higher accuracy.
7
+ *
8
+ * Org-intent surfacing:
9
+ * - When `context.orgIntent` is present, the reviewer receives the three-rule
10
+ * contract as separate buckets — constraints (mandatory), goals (defaults),
11
+ * values (representation), tradeoff hierarchy (tie-breaker). The prompt
12
+ * explicitly directs the reviewer to block on any constraint violation and
13
+ * warn on goal or value drift.
14
+ * - When `orgIntent` is null, the reviewer falls back to the legacy
15
+ * `orgValues` flat-blob field for backwards compatibility with custom
16
+ * callsites and any state where ORG-INTENT.md is absent/template-only.
7
17
  */
8
18
  import { CoherenceReviewer } from '../CoherenceReviewer.js';
9
19
  export class ValueAlignmentReviewer extends CoherenceReviewer {
@@ -21,7 +31,7 @@ export class ValueAlignmentReviewer extends CoherenceReviewer {
21
31
  const preamble = this.buildAntiInjectionPreamble();
22
32
  const agentValues = context.agentValues ?? 'No agent values provided.';
23
33
  const userValues = context.userValues ?? 'No user values provided.';
24
- const orgValues = context.orgValues ?? 'No organizational values provided.';
34
+ const orgBlock = this.buildOrgBlock(context);
25
35
  return `${preamble}
26
36
 
27
37
  You are a value alignment reviewer. Your job: ensure the agent's response is consistent with its declared values, the user's preferences, and any organizational constraints.
@@ -29,15 +39,23 @@ You are a value alignment reviewer. Your job: ensure the agent's response is con
29
39
  You will be given three context blocks:
30
40
  - AGENT VALUES: The agent's mission, principles, boundaries, and tradeoff rules (from AGENT.md)
31
41
  - USER VALUES: The user's communication preferences and working agreements (from USER.md)
32
- - ORG VALUES: Organizational constraints and goals (from ORG-INTENT.md), if present
42
+ - ORG INTENT: Organizational constraints, goals, values, and tradeoff hierarchy (from ORG-INTENT.md), if present
43
+
44
+ The ORG INTENT block uses a three-rule contract:
45
+ 1. CONSTRAINTS are mandatory. Any response that contradicts a constraint MUST be flagged with severity "block".
46
+ 2. GOALS are organizational defaults. The agent may specialize them but never contradict them — contradictions warn; clear violations block.
47
+ 3. VALUES shape how the organization represents itself. Drift from values warns.
48
+ 4. TRADEOFF HIERARCHY resolves ties when two values pull in opposite directions. The earlier entry wins.
33
49
 
34
50
  Flag when the response:
35
51
  - Contradicts the agent's stated mission or principles
36
52
  - Violates a declared boundary ("I never do X" but the response does X)
37
53
  - Ignores a tradeoff rule (agent says "thoroughness over speed" but gave a shallow answer)
38
54
  - Conflicts with user communication preferences (user wants conversational, agent is technical)
39
- - Violates an organizational constraint (mandatory rules that cannot be overridden)
40
- - Makes a decision that contradicts organizational goals without acknowledging the deviation
55
+ - Violates an ORG CONSTRAINT — these are mandatory; severity MUST be "block"
56
+ - Contradicts an ORG GOAL without acknowledging the deviation
57
+ - Drifts from an ORG VALUE
58
+ - Resolves a values tradeoff opposite to the org's stated TRADEOFF HIERARCHY
41
59
  - Fails to exercise delegation authority (asks permission for something marked "authorized")
42
60
  - Exercises authority beyond delegation scope (acts autonomously on something requiring approval)
43
61
 
@@ -59,13 +77,60 @@ User Values:
59
77
  ${JSON.stringify(userValues)}
60
78
  <<<${userBoundary}>>>
61
79
 
62
- Org Values:
80
+ Org Intent:
63
81
  <<<${orgBoundary}>>>
64
- ${JSON.stringify(orgValues)}
82
+ ${JSON.stringify(orgBlock)}
65
83
  <<<${orgBoundary}>>>
66
84
 
67
85
  Message:
68
86
  ${this.wrapMessage(context.message, messageBoundary)}`;
69
87
  }
88
+ /**
89
+ * Build the org-intent block surfaced to the LLM.
90
+ * Prefers structured orgIntent (three-rule contract) when present. Falls
91
+ * back to the legacy flat orgValues blob, then to a sentinel string.
92
+ */
93
+ buildOrgBlock(context) {
94
+ if (context.orgIntent) {
95
+ return formatOrgIntent(context.orgIntent);
96
+ }
97
+ if (context.orgValues) {
98
+ return context.orgValues;
99
+ }
100
+ return 'No organizational intent provided.';
101
+ }
102
+ }
103
+ /**
104
+ * Render structured org intent into a labeled text block. Constraints first
105
+ * (most load-bearing), then goals, values, and tradeoff hierarchy. Each bucket
106
+ * is omitted entirely when empty so the LLM does not see noise.
107
+ */
108
+ function formatOrgIntent(intent) {
109
+ const lines = [];
110
+ lines.push(`Organization: ${intent.name}`);
111
+ if (intent.constraints.length > 0) {
112
+ lines.push('');
113
+ lines.push('CONSTRAINTS (mandatory — violations MUST block):');
114
+ for (const c of intent.constraints)
115
+ lines.push(` - ${c}`);
116
+ }
117
+ if (intent.goals.length > 0) {
118
+ lines.push('');
119
+ lines.push('GOALS (organizational defaults — contradictions warn or block):');
120
+ for (const g of intent.goals)
121
+ lines.push(` - ${g}`);
122
+ }
123
+ if (intent.values.length > 0) {
124
+ lines.push('');
125
+ lines.push('VALUES (representation — drift warns):');
126
+ for (const v of intent.values)
127
+ lines.push(` - ${v}`);
128
+ }
129
+ if (intent.tradeoffHierarchy.length > 0) {
130
+ lines.push('');
131
+ lines.push('TRADEOFF HIERARCHY (earlier wins when two values collide):');
132
+ intent.tradeoffHierarchy.forEach((t, i) => lines.push(` ${i + 1}. ${t}`));
133
+ }
134
+ return lines.join('\n');
70
135
  }
71
136
  //# sourceMappingURL=value-alignment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"value-alignment.js","sourceRoot":"","sources":["../../../src/core/reviewers/value-alignment.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG5D,MAAM,OAAO,sBAAuB,SAAQ,iBAAiB;IAC3D,YAAY,OAAyB;QACnC,KAAK,CAAC,iBAAiB,EAAE;YACvB,GAAG,OAAO;YACV,KAAK,EAAE,OAAO,EAAE,KAAK,IAAI,QAAQ;SAClC,CAAC,CAAC;IACL,CAAC;IAES,WAAW,CAAC,OAAsB;QAC1C,MAAM,eAAe,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACh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CAAC,CAAC;AAC1B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/scaffold/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,CAgG/D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CA2E/F;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAiBvD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CA2B1D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,OAAO,EACpB,WAAW,GAAE,OAAe,EAC5B,WAAW,GAAE,OAAe,GAC3B,MAAM,CAmkCR;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,OAAO,EACpB,WAAW,GAAE,OAAe,GAC3B,MAAM,CAsQR"}
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/scaffold/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,CAgG/D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CA2E/F;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAiBvD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CA2B1D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,OAAO,EACpB,WAAW,GAAE,OAAe,EAC5B,WAAW,GAAE,OAAe,GAC3B,MAAM,CAmkCR;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,OAAO,EACpB,WAAW,GAAE,OAAe,GAC3B,MAAM,CAsRR"}
@@ -1447,6 +1447,22 @@ Before answering ANY question about my capabilities or architecture from memory
1447
1447
  2. **If result says "block"** — STOP. You may be working on the wrong project for this topic.
1448
1448
  3. **If result says "warn"** — Pause and verify before proceeding.
1449
1449
 
1450
+ ### ORG-INTENT.md (Organizational Intent at Runtime)
1451
+
1452
+ If \`.instar/ORG-INTENT.md\` exists on disk, the Coherence Gate now reads it on every outbound message review and surfaces the three-rule contract to the value-alignment reviewer:
1453
+
1454
+ - **Constraints** are mandatory — violations are flagged with severity \`block\` and the message is blocked.
1455
+ - **Goals** are organizational defaults — contradictions warn or block (depending on severity).
1456
+ - **Values** shape representation — drift warns.
1457
+ - **Tradeoff hierarchy** resolves ties when two values pull in opposite directions; the earlier entry wins.
1458
+
1459
+ This means: writing an ORG-INTENT.md file actually changes how the agent's outbound messages are evaluated. Before this wiring, the file existed only as input to offline analyzers (\`instar intent validate\`, \`instar intent reflect\`).
1460
+
1461
+ Manage it:
1462
+ - Scaffold a starter: \`instar intent org-init "Your Org Name"\`
1463
+ - Validate agent intent against org intent (static analysis): \`instar intent validate\`
1464
+ - Inspect the parsed structure: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/intent/org\`
1465
+
1450
1466
  ## Agent Infrastructure
1451
1467
 
1452
1468
  This project uses instar for persistent agent capabilities.
@@ -1 +1 @@
1
- {"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/scaffold/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AASH;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,QAAuB;IACrD,OAAO,KAAK,QAAQ,CAAC,IAAI;;;;OAIpB,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI;;;;EAIpC,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;6BAsBO,QAAQ,CAAC,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+D7C,CAAC;AAEF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,SAAiB,EAAE,WAAmB,EAAE,QAAgB;IACrF,OAAO;;;;;;;;;;;;;;;;;;EAkBP,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAkDH,QAAQ;;;;;CAKjB,CAAC;AACF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC7C,OAAO,KAAK,QAAQ;;;;;;;;;;;;;;4CAcsB,QAAQ;CACnD,CAAC;AACF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAiB;IAChD,OAAO,KAAK,SAAS;;;;;;;;;;;;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;;;;;;;sEAY+C,IAAI;;CAEzE,CAAC;IAEA,OAAO,OAAO,CAAC;AACjB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "1.2.22",
3
+ "version": "1.2.23",
4
4
  "description": "Persistent autonomy infrastructure for AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "./builtin-manifest.schema.json",
3
3
  "schemaVersion": 1,
4
- "generatedAt": "2026-05-22T04:08:18.326Z",
5
- "instarVersion": "1.2.22",
4
+ "generatedAt": "2026-05-22T05:51:10.506Z",
5
+ "instarVersion": "1.2.23",
6
6
  "entryCount": 191,
7
7
  "entries": {
8
8
  "hook:session-start": {
@@ -11,7 +11,7 @@
11
11
  "domain": "identity",
12
12
  "sourcePath": "src/core/PostUpdateMigrator.ts",
13
13
  "installedPath": ".instar/hooks/instar/session-start.sh",
14
- "contentHash": "c05e308a956d13c08a2aecdbec64591b4a94ef3c083e4b4ce95202b03ebce284",
14
+ "contentHash": "2f5fd2f22e14901a68a56add8044e3a85347ad3647630bbd0936b678fe79f1f0",
15
15
  "since": "2025-01-01"
16
16
  },
17
17
  "hook:dangerous-command-guard": {
@@ -20,7 +20,7 @@
20
20
  "domain": "safety",
21
21
  "sourcePath": "src/core/PostUpdateMigrator.ts",
22
22
  "installedPath": ".instar/hooks/instar/dangerous-command-guard.sh",
23
- "contentHash": "c05e308a956d13c08a2aecdbec64591b4a94ef3c083e4b4ce95202b03ebce284",
23
+ "contentHash": "2f5fd2f22e14901a68a56add8044e3a85347ad3647630bbd0936b678fe79f1f0",
24
24
  "since": "2025-01-01"
25
25
  },
26
26
  "hook:grounding-before-messaging": {
@@ -29,7 +29,7 @@
29
29
  "domain": "safety",
30
30
  "sourcePath": "src/core/PostUpdateMigrator.ts",
31
31
  "installedPath": ".instar/hooks/instar/grounding-before-messaging.sh",
32
- "contentHash": "c05e308a956d13c08a2aecdbec64591b4a94ef3c083e4b4ce95202b03ebce284",
32
+ "contentHash": "2f5fd2f22e14901a68a56add8044e3a85347ad3647630bbd0936b678fe79f1f0",
33
33
  "since": "2025-01-01"
34
34
  },
35
35
  "hook:compaction-recovery": {
@@ -38,7 +38,7 @@
38
38
  "domain": "identity",
39
39
  "sourcePath": "src/core/PostUpdateMigrator.ts",
40
40
  "installedPath": ".instar/hooks/instar/compaction-recovery.sh",
41
- "contentHash": "c05e308a956d13c08a2aecdbec64591b4a94ef3c083e4b4ce95202b03ebce284",
41
+ "contentHash": "2f5fd2f22e14901a68a56add8044e3a85347ad3647630bbd0936b678fe79f1f0",
42
42
  "since": "2025-01-01"
43
43
  },
44
44
  "hook:external-operation-gate": {
@@ -47,7 +47,7 @@
47
47
  "domain": "safety",
48
48
  "sourcePath": "src/core/PostUpdateMigrator.ts",
49
49
  "installedPath": ".instar/hooks/instar/external-operation-gate.js",
50
- "contentHash": "c05e308a956d13c08a2aecdbec64591b4a94ef3c083e4b4ce95202b03ebce284",
50
+ "contentHash": "2f5fd2f22e14901a68a56add8044e3a85347ad3647630bbd0936b678fe79f1f0",
51
51
  "since": "2025-01-01"
52
52
  },
53
53
  "hook:deferral-detector": {
@@ -56,7 +56,7 @@
56
56
  "domain": "safety",
57
57
  "sourcePath": "src/core/PostUpdateMigrator.ts",
58
58
  "installedPath": ".instar/hooks/instar/deferral-detector.js",
59
- "contentHash": "c05e308a956d13c08a2aecdbec64591b4a94ef3c083e4b4ce95202b03ebce284",
59
+ "contentHash": "2f5fd2f22e14901a68a56add8044e3a85347ad3647630bbd0936b678fe79f1f0",
60
60
  "since": "2025-01-01"
61
61
  },
62
62
  "hook:post-action-reflection": {
@@ -65,7 +65,7 @@
65
65
  "domain": "evolution",
66
66
  "sourcePath": "src/core/PostUpdateMigrator.ts",
67
67
  "installedPath": ".instar/hooks/instar/post-action-reflection.js",
68
- "contentHash": "c05e308a956d13c08a2aecdbec64591b4a94ef3c083e4b4ce95202b03ebce284",
68
+ "contentHash": "2f5fd2f22e14901a68a56add8044e3a85347ad3647630bbd0936b678fe79f1f0",
69
69
  "since": "2025-01-01"
70
70
  },
71
71
  "hook:external-communication-guard": {
@@ -74,7 +74,7 @@
74
74
  "domain": "safety",
75
75
  "sourcePath": "src/core/PostUpdateMigrator.ts",
76
76
  "installedPath": ".instar/hooks/instar/external-communication-guard.js",
77
- "contentHash": "c05e308a956d13c08a2aecdbec64591b4a94ef3c083e4b4ce95202b03ebce284",
77
+ "contentHash": "2f5fd2f22e14901a68a56add8044e3a85347ad3647630bbd0936b678fe79f1f0",
78
78
  "since": "2025-01-01"
79
79
  },
80
80
  "hook:scope-coherence-collector": {
@@ -83,7 +83,7 @@
83
83
  "domain": "coherence",
84
84
  "sourcePath": "src/core/PostUpdateMigrator.ts",
85
85
  "installedPath": ".instar/hooks/instar/scope-coherence-collector.js",
86
- "contentHash": "c05e308a956d13c08a2aecdbec64591b4a94ef3c083e4b4ce95202b03ebce284",
86
+ "contentHash": "2f5fd2f22e14901a68a56add8044e3a85347ad3647630bbd0936b678fe79f1f0",
87
87
  "since": "2025-01-01"
88
88
  },
89
89
  "hook:scope-coherence-checkpoint": {
@@ -92,7 +92,7 @@
92
92
  "domain": "coherence",
93
93
  "sourcePath": "src/core/PostUpdateMigrator.ts",
94
94
  "installedPath": ".instar/hooks/instar/scope-coherence-checkpoint.js",
95
- "contentHash": "c05e308a956d13c08a2aecdbec64591b4a94ef3c083e4b4ce95202b03ebce284",
95
+ "contentHash": "2f5fd2f22e14901a68a56add8044e3a85347ad3647630bbd0936b678fe79f1f0",
96
96
  "since": "2025-01-01"
97
97
  },
98
98
  "hook:free-text-guard": {
@@ -101,7 +101,7 @@
101
101
  "domain": "safety",
102
102
  "sourcePath": "src/core/PostUpdateMigrator.ts",
103
103
  "installedPath": ".instar/hooks/instar/free-text-guard.sh",
104
- "contentHash": "c05e308a956d13c08a2aecdbec64591b4a94ef3c083e4b4ce95202b03ebce284",
104
+ "contentHash": "2f5fd2f22e14901a68a56add8044e3a85347ad3647630bbd0936b678fe79f1f0",
105
105
  "since": "2025-01-01"
106
106
  },
107
107
  "hook:claim-intercept": {
@@ -110,7 +110,7 @@
110
110
  "domain": "coherence",
111
111
  "sourcePath": "src/core/PostUpdateMigrator.ts",
112
112
  "installedPath": ".instar/hooks/instar/claim-intercept.js",
113
- "contentHash": "c05e308a956d13c08a2aecdbec64591b4a94ef3c083e4b4ce95202b03ebce284",
113
+ "contentHash": "2f5fd2f22e14901a68a56add8044e3a85347ad3647630bbd0936b678fe79f1f0",
114
114
  "since": "2025-01-01"
115
115
  },
116
116
  "hook:claim-intercept-response": {
@@ -119,7 +119,7 @@
119
119
  "domain": "coherence",
120
120
  "sourcePath": "src/core/PostUpdateMigrator.ts",
121
121
  "installedPath": ".instar/hooks/instar/claim-intercept-response.js",
122
- "contentHash": "c05e308a956d13c08a2aecdbec64591b4a94ef3c083e4b4ce95202b03ebce284",
122
+ "contentHash": "2f5fd2f22e14901a68a56add8044e3a85347ad3647630bbd0936b678fe79f1f0",
123
123
  "since": "2025-01-01"
124
124
  },
125
125
  "hook:auto-approve-permissions": {
@@ -128,7 +128,7 @@
128
128
  "domain": "safety",
129
129
  "sourcePath": "src/core/PostUpdateMigrator.ts",
130
130
  "installedPath": ".instar/hooks/instar/auto-approve-permissions.js",
131
- "contentHash": "c05e308a956d13c08a2aecdbec64591b4a94ef3c083e4b4ce95202b03ebce284",
131
+ "contentHash": "2f5fd2f22e14901a68a56add8044e3a85347ad3647630bbd0936b678fe79f1f0",
132
132
  "since": "2025-01-01"
133
133
  },
134
134
  "job:health-check": {
@@ -1472,7 +1472,7 @@
1472
1472
  "type": "subsystem",
1473
1473
  "domain": "updates",
1474
1474
  "sourcePath": "src/core/PostUpdateMigrator.ts",
1475
- "contentHash": "c05e308a956d13c08a2aecdbec64591b4a94ef3c083e4b4ce95202b03ebce284",
1475
+ "contentHash": "2f5fd2f22e14901a68a56add8044e3a85347ad3647630bbd0936b678fe79f1f0",
1476
1476
  "since": "2025-01-01"
1477
1477
  },
1478
1478
  "subsystem:scheduler": {
@@ -1482,6 +1482,22 @@ Before answering ANY question about my capabilities or architecture from memory
1482
1482
  2. **If result says "block"** — STOP. You may be working on the wrong project for this topic.
1483
1483
  3. **If result says "warn"** — Pause and verify before proceeding.
1484
1484
 
1485
+ ### ORG-INTENT.md (Organizational Intent at Runtime)
1486
+
1487
+ If \`.instar/ORG-INTENT.md\` exists on disk, the Coherence Gate now reads it on every outbound message review and surfaces the three-rule contract to the value-alignment reviewer:
1488
+
1489
+ - **Constraints** are mandatory — violations are flagged with severity \`block\` and the message is blocked.
1490
+ - **Goals** are organizational defaults — contradictions warn or block (depending on severity).
1491
+ - **Values** shape representation — drift warns.
1492
+ - **Tradeoff hierarchy** resolves ties when two values pull in opposite directions; the earlier entry wins.
1493
+
1494
+ This means: writing an ORG-INTENT.md file actually changes how the agent's outbound messages are evaluated. Before this wiring, the file existed only as input to offline analyzers (\`instar intent validate\`, \`instar intent reflect\`).
1495
+
1496
+ Manage it:
1497
+ - Scaffold a starter: \`instar intent org-init "Your Org Name"\`
1498
+ - Validate agent intent against org intent (static analysis): \`instar intent validate\`
1499
+ - Inspect the parsed structure: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/intent/org\`
1500
+
1485
1501
  ## Agent Infrastructure
1486
1502
 
1487
1503
  This project uses instar for persistent agent capabilities.
@@ -0,0 +1,50 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- bump: minor -->
4
+ <!-- minor = new capability (ORG-INTENT runtime gate). Aggregates docs(openclaw-t22) from PR #313 too. -->
5
+
6
+ ## What Changed
7
+
8
+ **feat(org-intent-runtime): wire `ORG-INTENT.md` into the Coherence Gate so organizational intent actually shapes outbound message review.**
9
+
10
+ The `ORG-INTENT.md` format, parser, CLI surface (`instar intent org-init`, `validate`, `reflect`), and HTTP routes (`GET /intent/org`, `/intent/validate`) shipped in v0.9.11. What did not ship was the runtime integration — the Coherence Gate that reviews every outbound message only knew about `ORG-INTENT.md` through a deterministic markdown extraction that produced a flat ~150-token blob. The structured three-rule contract (constraints mandatory, goals defaults, values shape, tradeoff hierarchy resolves ties) was invisible to the reviewer. An agent with a fully-authored `ORG-INTENT.md` on disk behaved identically to one without it.
11
+
12
+ Phase 1 of the org-intent runtime project closes that gap on the message-review surface:
13
+
14
+ 1. **Structured parser wired into the gate.** `loadValueDocs()` now invokes `OrgIntentManager.parse()` and stores the structured `{ name, constraints[], goals[], values[], tradeoffHierarchy[] }` shape alongside the legacy flat blob. Both are surfaced to reviewers; the structured form takes priority.
15
+ 2. **Three-rule contract enforced explicitly in the value-alignment reviewer prompt.** The prompt now says constraint violations MUST block; goal contradictions warn or block by severity; value drift warns; the tradeoff hierarchy resolves ties (earlier entry wins). Constraints, goals, values, and tradeoff hierarchy appear in the prompt as separate labeled sections rather than a mashed-up blob.
16
+ 3. **Criticality auto-promotion.** When `ORG-INTENT.md` contains constraints, the value-alignment reviewer is auto-promoted to `high` criticality. Timeouts on external channels now fail-closed for this reviewer instead of slipping through unreviewed.
17
+ 4. **Migration parity.** Existing agents' CLAUDE.md gains an "ORG-INTENT.md (Organizational Intent at Runtime)" subsection in the Coherence Gate section so the agent learns the file is now load-bearing. The migration is idempotent — re-runs are no-ops.
18
+
19
+ Spec: `docs/specs/ORG-INTENT-RUNTIME-GATE-SPEC.md`. ELI16 companion: `docs/specs/ORG-INTENT-RUNTIME-GATE-SPEC.eli16.md`. Side-effects review: `upgrades/side-effects/org-intent-runtime-gate.md`.
20
+
21
+ This is Phase 1 of a four-phase project; the remaining phases (session-start injection, tradeoff helper, drift detection job) are deferred to subsequent releases.
22
+
23
+ ---
24
+
25
+ **Also included: docs(openclaw-t22) — codex framework limitation documented.**
26
+
27
+ Spec note added to `docs/specs/OPENCLAW-IMPORT-BEFORE-PROMPT-BUILD-SPEC.md` acknowledging that the pre-prompt memory recall feature (T2.2) only fires on Claude Code sessions. Codex CLI does not expose an equivalent per-prompt hook, so on codex-configured topics the recall pass does not run. This is a documented v1 scope choice surfaced by the 2026-05-21 OpenClaw v1.0 re-audit in topic 9003. The ELI16 companion was updated in plain language so operators understand the limitation before enabling the feature on a codex-configured topic.
28
+
29
+ ## What to Tell Your User
30
+
31
+ If your agent already has an organizational intent file on disk (ORG-INTENT.md in the .instar directory), this release makes that file actually load-bearing for the first time. The agent's outbound message review now consults the structured constraints, goals, values, and tradeoff hierarchy — and will block messages that violate the constraints you wrote. Review the file before the upgrade lands, because constraints you wrote loosely now have real teeth.
32
+
33
+ If you have not authored an organizational intent file, behavior is unchanged. This is a zero-cost upgrade for those agents.
34
+
35
+ A second change in this release (the openclaw-t22 docs note): if you have a Telegram topic configured for the Codex CLI framework, the pre-prompt memory recall feature does not fire on that topic. This is a documented limitation, not a bug.
36
+
37
+ ## Summary of New Capabilities
38
+
39
+ - **ORG-INTENT.md is now a runtime input to the Coherence Gate.** Three-rule contract enforcement: constraints block, goals warn/block, values warn, tradeoff hierarchy resolves ties.
40
+ - **Value-alignment reviewer prompt** is rewritten to surface the structured contract as separate labeled sections, explicitly enforcing constraint-vs-goal-vs-value semantics.
41
+ - **Migration parity**: existing agents pick up the change automatically via `PostUpdateMigrator.migrateClaudeMd()` — the CLAUDE.md Coherence Gate section gains a new subsection so the agent knows the file is load-bearing.
42
+ - **Three new test suites** added to enforce the wiring at all three tiers (unit, integration, E2E).
43
+
44
+ ## Evidence
45
+
46
+ - Tier 1 unit tests: `tests/unit/CoherenceGate.test.ts` (5 new tests under the "ORG-INTENT.md structured loading" describe block, all passing). `tests/unit/PostUpdateMigrator-org-intent-runtime.test.ts` (5 new tests for migration parity, all passing).
47
+ - Tier 2 integration tests: `tests/integration/coherence-gate-org-intent.test.ts` (4 tests against the live `/review/evaluate` HTTP route, all passing).
48
+ - Tier 3 E2E lifecycle tests: `tests/e2e/org-intent-runtime-lifecycle.test.ts` (4 tests mirroring production wiring from `src/commands/server.ts`, all passing — including the "feature is alive" check that returns 200, not 503).
49
+ - Type-check: `npx tsc --noEmit` clean.
50
+ - The full test suite must remain green before merge per Zero-Failure Standard.
@@ -0,0 +1,117 @@
1
+ # Side-effects review — org-intent runtime gate (Phase 1)
2
+
3
+ Spec: `docs/specs/ORG-INTENT-RUNTIME-GATE-SPEC.md`
4
+ ELI16: `docs/specs/ORG-INTENT-RUNTIME-GATE-SPEC.eli16.md`
5
+ Phase: 1 of 4 (this PR). Phases 2-4 (session-start injection, tradeoff helper, drift detection job) are queued.
6
+
7
+ ## Surface map
8
+
9
+ | Change | File | Type |
10
+ |---|---|---|
11
+ | `OrgIntentReviewContext` interface + `ReviewContext.orgIntent` field | `src/core/CoherenceReviewer.ts` | Type extension (additive, optional field) |
12
+ | `OrgIntentManager.parse()` wired into `loadValueDocs()` | `src/core/CoherenceGate.ts` | Behavior change (structured parsing replaces flat extraction for `ORG-INTENT.md` only) |
13
+ | Reviewer prompt rewrite with three-rule contract | `src/core/reviewers/value-alignment.ts` | Behavior change (prompt content) |
14
+ | Criticality auto-promotion for value-alignment when ORG-INTENT has constraints | `src/core/CoherenceGate.ts` | Behavior change (failure-mode handling) |
15
+ | CLAUDE.md template: ORG-INTENT runtime subsection | `src/scaffold/templates.ts` | Doc change (fresh agents) |
16
+ | CLAUDE.md migration: ORG-INTENT runtime subsection patched into existing files | `src/core/PostUpdateMigrator.ts` | Migration parity (existing agents) |
17
+ | Tier 1 unit tests | `tests/unit/CoherenceGate.test.ts`, `tests/unit/PostUpdateMigrator-org-intent-runtime.test.ts` | Test addition |
18
+ | Tier 2 integration test | `tests/integration/coherence-gate-org-intent.test.ts` | Test addition |
19
+ | Tier 3 E2E lifecycle test | `tests/e2e/org-intent-runtime-lifecycle.test.ts` | Test addition |
20
+
21
+ No new agent-installed config keys. No new hooks. No agent-installed code changes — the runtime wiring is entirely in instar source. Migration is to `CLAUDE.md` only.
22
+
23
+ ## Over-block analysis
24
+
25
+ **Could the new wiring block messages that previously passed?**
26
+
27
+ Yes — that is exactly the intended effect for agents with an authored `ORG-INTENT.md`. The behavior change is: constraints written in `ORG-INTENT.md` now actually block outbound messages that violate them. Prior to this change, the same agent with the same file would have let those messages through.
28
+
29
+ For agents without an `ORG-INTENT.md`, behavior is unchanged. The structured-intent path is gated on `OrgIntentManager.parse()` returning non-null; absent, template-only, or unparseable files return null and fall back to the legacy flat-blob path (which itself is what shipped before).
30
+
31
+ **Could the criticality auto-promotion over-block?**
32
+
33
+ The promotion only affects timeout behavior. Specifically: when `value-alignment` reviewer TIMES OUT on an external-facing message AND `ORG-INTENT.md` has at least one constraint, the gate fails closed instead of falling open. Pre-change behavior: a timeout on `value-alignment` led to `ALL_ABSTAIN` or `WARN_ONLY`, which fell open for internal channels and queued/fail-closed for external depending on config. Post-change behavior: external timeout under this condition triggers `HIGH_CRIT_TIMEOUT` which fails closed.
34
+
35
+ Net effect on operator: slightly higher rate of "Review system unavailable" responses on external channels under reviewer-timeout stress, instead of unreviewed messages slipping through. Override available: explicit `config.reviewerCriticality['value-alignment'] = 'standard'` restores prior behavior.
36
+
37
+ **Could the migration over-write user-customized CLAUDE.md content?**
38
+
39
+ No. Both insertion paths use content-sniff guards (`!content.includes('ORG-INTENT.md (Organizational Intent at Runtime)') && !content.includes('Organizational Intent at Runtime')`). The migration is purely additive — it inserts before an anchor (`**Topic-Project Bindings**`) when present, falls back to appending when absent, and skips entirely when the subsection is already present. Re-runs are idempotent (verified by unit test).
40
+
41
+ ## Under-block analysis
42
+
43
+ **What does the new wiring NOT catch?**
44
+
45
+ - **Semantic constraint violations the reviewer LLM does not detect.** The reviewer relies on the LLM (`sonnet` by default) to recognize when a draft message violates a written constraint. A subtle violation — say, hinting at internal pricing without quoting a specific number — may slip through if the LLM does not connect the constraint to the draft.
46
+ - **Constraint scoping**: the current model treats all constraints as universal. There is no way to say "this constraint applies only to external contacts." Phase 3 may add channel/recipient scoping.
47
+ - **Tradeoff hierarchy use outside the reviewer**: only the value-alignment reviewer consults it. Code paths that make decisions (research agents, planning) cannot ask the hierarchy for a tiebreaker yet. Phase 3 adds a tradeoff helper API.
48
+ - **Drift accumulation**: a stream of messages each individually passing review can collectively drift from organizational intent. Phase 4 adds periodic drift detection.
49
+
50
+ **What if ORG-INTENT.md is mutated after the gate boots?**
51
+
52
+ The 60-minute `ValueDocCache` TTL means edits do not take effect until cache expiry (or process restart). This is documented in the Phase 4 E2E test (`cache-stale` case) so a future refactor cannot silently break the invariant. A future improvement (Phase 2 or 3) may add fs.watch-based invalidation.
53
+
54
+ ## Level-of-abstraction fit
55
+
56
+ The runtime wiring lives in `src/core/CoherenceGate.ts` and `src/core/reviewers/value-alignment.ts` — the right layer. The parser already lived at `src/core/OrgIntentManager.ts`; this change connects the two at the layer that actually evaluates outbound messages.
57
+
58
+ The migration lives in `src/core/PostUpdateMigrator.ts` — the right layer for changes that need to propagate to existing agents.
59
+
60
+ No new abstractions introduced. The change adds one new type (`OrgIntentReviewContext`), one new private method (`resolveCriticality`), and one new helper function (`formatOrgIntent`) — all minimal and proportional to the work.
61
+
62
+ ## Signal-vs-authority compliance
63
+
64
+ This is the right place in the stack for ORG-INTENT enforcement. The Coherence Gate is the authoritative pre-delivery review for outbound messages. The reviewer prompt explicitly distinguishes:
65
+
66
+ - **Constraints** → AUTHORITY: severity MUST be `block`. The reviewer is told to block constraint violations.
67
+ - **Goals** → mixed: contradictions warn or block depending on severity. The reviewer has discretion.
68
+ - **Values** → SIGNAL: drift warns. Not authoritative.
69
+ - **Tradeoff hierarchy** → SIGNAL feeding AUTHORITY: it tells the reviewer how to resolve ties; the reviewer is still authoritative on the verdict.
70
+
71
+ Lower-precision signals (e.g. deterministic keyword scans in the PEL) could be added later for blatant constraint violations, but those would be signals; the reviewer remains the authority. Per `feedback_signal_vs_authority` from agent memory.
72
+
73
+ ## Interactions with existing systems
74
+
75
+ | System | Interaction | Risk |
76
+ |---|---|---|
77
+ | `value-alignment` reviewer (existing) | Prompt rewritten; receives `orgIntent` field in context | Low — prompt change tested at all three tiers |
78
+ | Other reviewers (existing) | No change | None |
79
+ | `loadValueDocs` cache | Extended to include `orgIntent` field | Low — additive |
80
+ | `ValueDocCache` TTL | Unchanged (60 minutes) | Documented; locked in by E2E test |
81
+ | Legacy `orgValues` flat blob | Still loaded and passed to reviewers | None — backwards compatible |
82
+ | Custom reviewers reading `context.orgValues` | Still work as before | None |
83
+ | `instar intent` CLI surface (existing) | Unchanged | None |
84
+ | `/intent/org`, `/intent/validate` HTTP routes (existing) | Unchanged | None |
85
+ | PostUpdateMigrator other migrations | New migration is independent | None |
86
+ | Husky pre-push tone-gate / version-gate | Should pass — new content has Evidence section, version bump is minor | Verified by full-suite run before push |
87
+
88
+ No other instar systems consume `ORG-INTENT.md`. The structured parser was a one-purpose primitive used only by the offline analyzer CLI and now by the gate.
89
+
90
+ ## Rollback cost
91
+
92
+ Low. The legacy flat-blob path (`extractValueSection` → `orgValues`) is retained and still passed to reviewers. Three options:
93
+
94
+ 1. **Code revert**: `git revert <PR-merge-sha>` restores prior behavior. Tests will fail until the new test files are also removed, but production behavior reverts cleanly.
95
+ 2. **Soft revert via reviewer config**: explicitly set `config.responseReview.reviewers['value-alignment'].mode = 'warn'` to demote constraint violations from `block` to `warn`. This restores most of the prior behavior without reverting code.
96
+ 3. **Soft revert via criticality config**: explicitly set `config.responseReview.reviewerCriticality['value-alignment'] = 'standard'` to undo the timeout-fail-closed change without touching the rest.
97
+
98
+ No data migration to roll back. No file format changes. No agent-installed code changes.
99
+
100
+ ## Test coverage summary
101
+
102
+ | Tier | File | Tests | Status |
103
+ |---|---|---|---|
104
+ | 1 (unit) | `tests/unit/CoherenceGate.test.ts` (new describe block) | 5 | ✓ passing |
105
+ | 1 (unit) | `tests/unit/PostUpdateMigrator-org-intent-runtime.test.ts` | 5 | ✓ passing |
106
+ | 2 (integration) | `tests/integration/coherence-gate-org-intent.test.ts` | 4 | ✓ passing |
107
+ | 3 (E2E lifecycle) | `tests/e2e/org-intent-runtime-lifecycle.test.ts` | 4 | ✓ passing |
108
+
109
+ All three tiers exercise the same parser + gate + reviewer + HTTP route + production wiring, with each tier proving a different layer of the invariant.
110
+
111
+ ## Open follow-ups (deferred to later phases, NOT this PR)
112
+
113
+ - Phase 2: Inject parsed intent at session-start (alongside identity/topic context).
114
+ - Phase 3: Standalone `POST /intent/tradeoff-resolve` helper consulted by non-reviewer code.
115
+ - Phase 4: Periodic drift detection job sampling recent outbound actions vs intent.
116
+ - Cache invalidation on `ORG-INTENT.md` mutation (fs.watch or signal-based).
117
+ - Per-channel constraint scoping (some constraints external-only, others universal).