@cratylus/canon 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/agents/architect.js +14 -108
  2. package/dist/agents/architect.js.map +1 -1
  3. package/dist/agents/assayer.d.ts +2 -0
  4. package/dist/agents/assayer.js +20 -0
  5. package/dist/agents/assayer.js.map +1 -0
  6. package/dist/agents/implementer.js +9 -69
  7. package/dist/agents/implementer.js.map +1 -1
  8. package/dist/agents/kino.js +24 -110
  9. package/dist/agents/kino.js.map +1 -1
  10. package/dist/agents/mav.js +43 -79
  11. package/dist/agents/mav.js.map +1 -1
  12. package/dist/agents/nico.js +33 -61
  13. package/dist/agents/nico.js.map +1 -1
  14. package/dist/agents/planner.js +8 -80
  15. package/dist/agents/planner.js.map +1 -1
  16. package/dist/dimensions/role/architect.js +19 -1
  17. package/dist/dimensions/role/architect.js.map +1 -1
  18. package/dist/dimensions/role/{build.d.ts → assayer.d.ts} +1 -1
  19. package/dist/dimensions/role/assayer.js +25 -0
  20. package/dist/dimensions/role/assayer.js.map +1 -0
  21. package/dist/dimensions/role/{diagnose.d.ts → implementer.d.ts} +1 -1
  22. package/dist/dimensions/role/implementer.js +12 -0
  23. package/dist/dimensions/role/implementer.js.map +1 -0
  24. package/dist/dimensions/role/{curate.d.ts → planner.d.ts} +1 -1
  25. package/dist/dimensions/role/planner.js +14 -0
  26. package/dist/dimensions/role/planner.js.map +1 -0
  27. package/dist/hooks/purview-guardrail.d.ts +2 -0
  28. package/dist/hooks/purview-guardrail.js +302 -0
  29. package/dist/hooks/purview-guardrail.js.map +1 -0
  30. package/dist/roles/architect.d.ts +2 -0
  31. package/dist/roles/architect.js +101 -0
  32. package/dist/roles/architect.js.map +1 -0
  33. package/dist/roles/assayer.d.ts +2 -0
  34. package/dist/roles/assayer.js +66 -0
  35. package/dist/roles/assayer.js.map +1 -0
  36. package/dist/roles/hold.d.ts +57 -0
  37. package/dist/roles/hold.js +105 -0
  38. package/dist/roles/hold.js.map +1 -0
  39. package/dist/roles/implementer.d.ts +2 -0
  40. package/dist/roles/implementer.js +60 -0
  41. package/dist/roles/implementer.js.map +1 -0
  42. package/dist/roles/planner.d.ts +2 -0
  43. package/dist/roles/planner.js +70 -0
  44. package/dist/roles/planner.js.map +1 -0
  45. package/dist/skills/deliver/skill.js +41 -3
  46. package/dist/skills/deliver/skill.js.map +1 -1
  47. package/package.json +1 -1
  48. package/dist/dimensions/role/build.js +0 -2
  49. package/dist/dimensions/role/build.js.map +0 -1
  50. package/dist/dimensions/role/converse.d.ts +0 -2
  51. package/dist/dimensions/role/converse.js +0 -2
  52. package/dist/dimensions/role/converse.js.map +0 -1
  53. package/dist/dimensions/role/curate.js +0 -2
  54. package/dist/dimensions/role/curate.js.map +0 -1
  55. package/dist/dimensions/role/diagnose.js +0 -2
  56. package/dist/dimensions/role/diagnose.js.map +0 -1
  57. package/dist/dimensions/role/document.d.ts +0 -2
  58. package/dist/dimensions/role/document.js +0 -2
  59. package/dist/dimensions/role/document.js.map +0 -1
  60. package/dist/dimensions/role/implement.d.ts +0 -2
  61. package/dist/dimensions/role/implement.js +0 -2
  62. package/dist/dimensions/role/implement.js.map +0 -1
  63. package/dist/dimensions/role/operate.d.ts +0 -2
  64. package/dist/dimensions/role/operate.js +0 -2
  65. package/dist/dimensions/role/operate.js.map +0 -1
  66. package/dist/dimensions/role/orchestrate.d.ts +0 -2
  67. package/dist/dimensions/role/orchestrate.js +0 -2
  68. package/dist/dimensions/role/orchestrate.js.map +0 -1
  69. package/dist/dimensions/role/plan.d.ts +0 -2
  70. package/dist/dimensions/role/plan.js +0 -2
  71. package/dist/dimensions/role/plan.js.map +0 -1
  72. package/dist/dimensions/role/research.d.ts +0 -2
  73. package/dist/dimensions/role/research.js +0 -2
  74. package/dist/dimensions/role/research.js.map +0 -1
  75. package/dist/dimensions/role/review.d.ts +0 -2
  76. package/dist/dimensions/role/review.js +0 -2
  77. package/dist/dimensions/role/review.js.map +0 -1
  78. package/dist/dimensions/role/test.d.ts +0 -2
  79. package/dist/dimensions/role/test.js +0 -2
  80. package/dist/dimensions/role/test.js.map +0 -1
@@ -0,0 +1,302 @@
1
+ // purview-guardrail — the gate that makes a ROLE CONTRACT scoreable.
2
+ //
3
+ // A role value now states the arrow the position is over the ladder
4
+ // `intent ≺ C ≺ spec ≺ artifact`, and an act whose domain or codomain falls outside
5
+ // that arrow is delegated NECESSARILY. Declared, that is a steer. This cell is the
6
+ // bound: it refuses, before the call fires, an act the holder's own contract puts
7
+ // outside its arrow.
8
+ //
9
+ // WHY A SECOND CELL RATHER THAN A SECOND RUBRIC LEG. One gate, one contract. The
10
+ // stance guard judges `autonomy` — whether the agent collapsed into order-taking — and
11
+ // this one judges `role`. They score different declarations, at different moments, and
12
+ // `gates` in the stance manifest is keyed by OWNING CELL precisely so a second guarded
13
+ // dimension is a second entry rather than an append to somebody else's prompt. The
14
+ // judge BACKEND is shared, exactly as the pre-hook shares it: one judge, two contracts.
15
+ //
16
+ // IT QUOTES THE AGENT'S OWN PROJECTED CONTRACT, and that is the design decision worth
17
+ // stating. The rubric carries no role text and names no agent. The worker reads the
18
+ // `## Role` section out of the persona's own deployed Target and hands it to the judge
19
+ // as the law to score against, so the gate scores WHAT THE CORPUS DECLARES rather than
20
+ // an author's opinion about good behaviour — and a corpus that mints a sixth role gets
21
+ // it judged with no edit here. This is the lesson the stance guard learned the
22
+ // expensive way: its allowlist drifted and left `architect` and `kino` unjudged while
23
+ // every agent in the corpus composed the fragment it claimed to enforce.
24
+ //
25
+ // WHAT IT BLOCKS is what the arrow excludes, and nothing else:
26
+ // · a dispatch to a builder for a piece no planner decomposed, from a holder whose
27
+ // arrow does not write spec — the architect skipping the middle rung;
28
+ // · a write to the substrate by a holder whose arrow does not write artifact;
29
+ // · a dispatch whose prompt is the operator's literal words rather than a cut piece
30
+ // — the same dispatch-echo the stance guard catches at turn end, refused here
31
+ // because at this moment the contract that convicts it is the ROLE's.
32
+ // WHAT IT PASSES: a dispatch to a planner, a dispatch to an assayer, READING anything,
33
+ // and writing whatever the arrow reserves. Reading is never a block — the architect's
34
+ // contract makes an artifact read a descent, but a read is cheap to undo and a gate
35
+ // that fires on one would wedge every legitimate orientation.
36
+ //
37
+ // FAIL-OPEN, EVIDENCE-CHECKED, RE-ENTRY-CAPPED — all three inherited from the sibling
38
+ // pre-hook, which is also the structural model for the worker. A block whose cited span
39
+ // is not literally in the payload is DISCARDED: a fabricated block is not a lesser
40
+ // error than a missed one.
41
+ export const purviewGuardrail = {
42
+ id: 'purview-guardrail',
43
+ residue: 'structural-refusal ↾ mid-turn act ∉ role-arrow · deny-before-fire ⟨descent ⟨write(artifact) ∉ writes⟩ · skipped-rung ⟨dispatch(build) ∄ decomposition⟩ · dispatch-echo ⟨literal-words ≠ cut-piece⟩⟩ · pass ⟨read · act ∈ reserves · dispatch ↦ plan ∨ assay⟩ · law = the HOLDER-projected role-section ⟨quoted verbatim · ¬ authored-opinion⟩ · shared judge-backend ⟨sibling⟩ · fail-open ∧ evidence-checked ∧ re-entry-capped',
44
+ substrate: 'harness',
45
+ order: 1,
46
+ events: ['subagent.dispatch.pre', 'tool.use.pre'],
47
+ entry: 'purview-guardrail.sh',
48
+ timeout: 60,
49
+ refs: [],
50
+ workers: [
51
+ {
52
+ filename: 'purview-guardrail.sh',
53
+ targetPath: 'packages/canon/targets/guardrail/purview-guardrail.sh',
54
+ executable: true,
55
+ content: `#!/usr/bin/env sh
56
+ # purview-guardrail — a PreToolUse hook that STRUCTURALLY REFUSES, before the call
57
+ # fires, a mid-turn act that falls outside the arrow the agent's OWN role contract
58
+ # declares.
59
+ #
60
+ # THE LAW IS NOT IN THIS FILE AND NOT IN THE RUBRIC. It is the \`## Role\` section of
61
+ # the persona's deployed Target, read at run time and handed to the judge as the
62
+ # contract to score against. No role text, no agent name and no behavioural opinion is
63
+ # hard-coded anywhere in this gate.
64
+ #
65
+ # SAFETY MODEL (mirrors both siblings):
66
+ # - SCOPE-ENROLLED by PRESENCE. A persona carrying a stance manifest is judged; every
67
+ # other scope is silent. No allowlist — the projection that places a persona enrolls
68
+ # it, and nothing central lists anybody.
69
+ # - CONTRACT-ENROLLED, one step further. A persona whose Target carries no \`## Role\`
70
+ # section has no arrow to be outside of, so it is allowed. A gate cannot convict
71
+ # against a law that was never declared.
72
+ # - FAILS OPEN. Any error (no jq, no Target, judge failure) -> exit 0.
73
+ # - EVIDENCE-CHECKED. A BLOCK must quote a span that is literally present in the
74
+ # payload; a citation that is not there is a fabricated block and is DISCARDED.
75
+ # - LOOP-SAFE. A re-entry cap: never deny an identical tool_input twice.
76
+ #
77
+ # INPUT : Claude Code PreToolUse hook JSON on stdin.
78
+ # OUTPUT : on a purview breach -> a deny decision on stdout + exit 0.
79
+ # otherwise -> no stdout + exit 0.
80
+ #
81
+ # POSIX sh. Depends on: jq. Missing jq -> fail open.
82
+
83
+ set -eu
84
+
85
+ # The sibling Stop hook's deployed dir owns the SHARED judge backend, resolved from
86
+ # this script's own location exactly as the pre-hook resolves it — every hooks root
87
+ # holds the hook dirs as siblings, so this derivation is true at every site this file
88
+ # can land.
89
+ SELF_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
90
+ HOOKS_ROOT="$(dirname -- "$SELF_DIR")"
91
+ JUDGE_DIR="\${STANCE_GUARD_DIR:-$HOOKS_ROOT/stance-guardrail}"
92
+ NEUTRAL_ROOT="$(dirname -- "$(dirname -- "$HOOKS_ROOT")")/.agents"
93
+ RUBRIC="\${PURVIEW_RUBRIC:-$NEUTRAL_ROOT/purview-guardrail/purview-judge-prompt.md}"
94
+ JUDGE_CMD="\${STANCE_JUDGE_CMD:-sh $JUDGE_DIR/stance-judge.sh}"
95
+ LOG="\${PURVIEW_GUARD_LOG:-$SELF_DIR/misses.log}"
96
+
97
+ trap 'exit 0' EXIT
98
+
99
+ allow() { exit 0; }
100
+ note() { printf '%s\\n' "$1" >> "$LOG" 2>/dev/null || true; }
101
+
102
+ input="$(cat)"
103
+ [ -n "$input" ] || allow
104
+ command -v jq >/dev/null 2>&1 || allow
105
+
106
+ cwd="$(printf '%s' "$input" | jq -r '.cwd // empty' 2>/dev/null || true)"
107
+ [ -n "$cwd" ] && cd "$cwd" 2>/dev/null || true
108
+
109
+ # --- scope gate: the persona's OWN stance manifest -------------------------------------------
110
+ stance_scope="$(printf '%s' "$input" | jq -r '.stance_scope // empty' 2>/dev/null || true)"
111
+ [ -n "$stance_scope" ] || allow
112
+ manifest="$stance_scope/stance/manifest.json"
113
+ [ -f "$manifest" ] || allow
114
+ agent_type="$(jq -r '.agent // empty' "$manifest" 2>/dev/null || true)"
115
+ [ -n "$agent_type" ] || allow
116
+
117
+ # --- the LAW: this persona's own projected role contract -------------------------------------
118
+ # A persona scope is \`<root>/agent/personas/<name>\` and the Target it was projected
119
+ # from is \`<root>/agent/agents/<name>.md\` — two levels out and back down, the same
120
+ # shape of derivation the judge path above uses. Overridable for test rigs.
121
+ AGENT_ROOT="$(dirname -- "$(dirname -- "$stance_scope")")"
122
+ AGENT_MD="\${PURVIEW_AGENT_MD:-$AGENT_ROOT/agents/$agent_type.md}"
123
+ [ -f "$AGENT_MD" ] || allow
124
+ contract="$(awk '/^## Role$/{f=1;next} /^## /{f=0} f' "$AGENT_MD" 2>/dev/null || true)"
125
+ # A contract that is a BARE TOKEN states no arrow, so there is nothing to be outside
126
+ # of. Only a multi-line contract is scoreable, and saying so here is what keeps the
127
+ # gate from inventing a law for a corpus that has not declared one.
128
+ [ "$(printf '%s\\n' "$contract" | grep -c '[^[:space:]]')" -ge 2 ] || allow
129
+
130
+ # --- extract the judged payload, branched by act ---------------------------------------------
131
+ tool_name="$(printf '%s' "$input" | jq -r '.tool_name // empty' 2>/dev/null || true)"
132
+ [ -n "$tool_name" ] || allow
133
+
134
+ case "$tool_name" in
135
+ Agent|SendMessage|Task)
136
+ body="$(printf '%s' "$input" | jq -r '.tool_input.prompt // .tool_input.message // .tool_input.description // ""' 2>/dev/null || true)"
137
+ target="$(printf '%s' "$input" | jq -r '.tool_input.subagent_type // .tool_input.agent // .tool_input.name // ""' 2>/dev/null || true)"
138
+ act="DISPATCH to \\\`\${target:-unnamed}\\\` (codomain: the spec this delegate will build from)"
139
+ ;;
140
+ Write|Edit|MultiEdit|NotebookEdit)
141
+ body="$(printf '%s' "$input" | jq -r '.tool_input.file_path // .tool_input.path // .tool_input.notebook_path // ""' 2>/dev/null || true)"
142
+ act="WRITE to the substrate (codomain: artifact)"
143
+ ;;
144
+ *)
145
+ # DEFENCE IN DEPTH. \`tool.use.pre\` fires on every tool on a harness with no
146
+ # subject selector; these two classes are the only acts this contract can
147
+ # convict, and a read is deliberately not one of them.
148
+ allow ;;
149
+ esac
150
+
151
+ [ -n "\${body:-}" ] || allow
152
+
153
+ payload="=== THE HOLDER'S DECLARED CONTRACT (agent: $agent_type) ===
154
+ $contract
155
+ === THE ACT ABOUT TO FIRE ===
156
+ $act
157
+ $body"
158
+
159
+ # --- loop-safety: never deny an identical tool_input twice ----------------------------------
160
+ session_id="$(printf '%s' "$input" | jq -r '.session_id // "nosession"' 2>/dev/null || echo nosession)"
161
+ sig="$(printf '%s' "$input" | jq -c '.tool_input' 2>/dev/null | cksum | cut -d' ' -f1 2>/dev/null || echo 0)"
162
+ seen="\${TMPDIR:-/tmp}/.purview-pre-$session_id-$sig"
163
+ [ -f "$seen" ] && allow
164
+
165
+ # --- judge (SHARED backend, OWN rubric) -----------------------------------------------------
166
+ if [ -n "\${PURVIEW_EMIT_PAYLOAD:-}" ]; then
167
+ jq -cn --arg r "$RUBRIC" --arg p "$payload" '{rubric:$r, payload:$p}'
168
+ exit 0
169
+ fi
170
+ if [ -n "\${PURVIEW_VERDICT_FILE:-}" ]; then
171
+ verdict="$(cat "\${PURVIEW_VERDICT_FILE}" 2>/dev/null || true)"
172
+ [ -n "$verdict" ] || {
173
+ note "$(date -u +%Y-%m-%dT%H:%M:%SZ) judge-empty tool=$tool_name agent=$agent_type"
174
+ allow
175
+ }
176
+ else
177
+ verdict="$(printf '%s' "$payload" | $JUDGE_CMD "$RUBRIC" 2>/dev/null)" || {
178
+ note "$(date -u +%Y-%m-%dT%H:%M:%SZ) judge-fail tool=$tool_name agent=$agent_type"
179
+ allow
180
+ }
181
+ fi
182
+
183
+ decision="$(printf '%s\\n' "$verdict" | sed -n 's/^VERDICT:[[:space:]]*//p' | head -1)"
184
+ [ "$decision" = "BLOCK" ] || allow
185
+
186
+ reason="$(printf '%s\\n' "$verdict" | sed -n 's/^REASON:[[:space:]]*//p' | head -1)"
187
+ [ -n "$reason" ] || reason="This act falls outside the arrow your role contract declares."
188
+
189
+ # --- EVIDENCE CHECK: the cited span must be literally in the payload -------------------------
190
+ # A block naming a span the payload does not contain is a hallucinated block, and a
191
+ # fabricated refusal is not a lesser error than a missed one. Same rule, same reason as
192
+ # the turn-end sibling.
193
+ cited="$(printf '%s\\n' "$verdict" | sed -n 's/^SPAN:[[:space:]]*//p' | head -1)"
194
+ if [ -n "$cited" ]; then
195
+ printf '%s' "$payload" | grep -qF -- "$cited" || {
196
+ note "$(date -u +%Y-%m-%dT%H:%M:%SZ) evidence-fail tool=$tool_name agent=$agent_type span=$cited"
197
+ allow
198
+ }
199
+ fi
200
+
201
+ : > "$seen" 2>/dev/null || true
202
+
203
+ feedback="PURVIEW GUARDRAIL — denied this $tool_name call: it falls outside the arrow your own \\
204
+ role contract declares. $reason Delegation is a THEOREM of that arrow, not an option: an act whose \\
205
+ domain or codomain lies outside it goes to the role that owns it — a decomposition to a planner, a \\
206
+ build to an implementer, an artifact reading to an assayer. Hand it over and carry on with what the \\
207
+ contract reserves. (Legitimate and NOT blocked here: reading anything, dispatching to a planner or an \\
208
+ assayer, and performing any act the contract's own \\\`reserves\\\` clause names.)"
209
+
210
+ jq -cn --arg r "$feedback" '{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:$r}}'
211
+ exit 0
212
+ `,
213
+ },
214
+ {
215
+ filename: 'purview-judge-prompt.md',
216
+ targetPath: 'packages/canon/targets/guardrail/purview-judge-prompt.md',
217
+ executable: false,
218
+ // NEUTRAL, exactly as the stance rubric is, and for a stronger reason here: this
219
+ // rubric carries no corpus content at all. It is a procedure for scoring a
220
+ // contract supplied at run time, so it is the same bytes for any corpus that
221
+ // declares a role arrow — which is what makes the neutral root its right home
222
+ // rather than a convenience.
223
+ shared: true,
224
+ content: `# Purview judge — does this act fall outside the agent's declared arrow?
225
+
226
+ You are a PURVIEW JUDGE. You are given two things:
227
+
228
+ 1. **THE HOLDER'S DECLARED CONTRACT** — the \`## Role\` section of the agent's own definition,
229
+ verbatim. It states an arrow of the form \`reads⟨…⟩ → writes⟨…⟩\` over a ladder of
230
+ representational layers, the acts the arrow **reserves**, and often a named defect.
231
+ 2. **THE ACT ABOUT TO FIRE** — either a DISPATCH (the delegate prompt) or a WRITE (the path).
232
+
233
+ Your one job: decide whether the act falls **outside** that arrow. You judge conformance to the
234
+ contract you were handed. You do **not** judge whether the contract is wise, whether the act is a
235
+ good idea, or whether the code is any good.
236
+
237
+ ## The law is the contract, not your opinion
238
+
239
+ Every rule you apply must be readable **in the supplied contract**. If the contract does not exclude
240
+ the act, the act passes — however unwise it looks to you. An agent is entitled to the whole of what
241
+ its arrow permits, and a gate that convicts on an unwritten rule is worse than no gate, because it
242
+ teaches the agent to distrust a law it can read.
243
+
244
+ Read the arrow first, then the \`reserves\` clause, then the rest.
245
+
246
+ ## How to read an arrow
247
+
248
+ \`reads⟨A · B⟩ → writes⟨C⟩\` means: the agent may consume layers A and B, and may produce layer C.
249
+ The ladder runs \`intent ≺ C ≺ spec ≺ artifact\` from most abstract to least, where \`C\` is the
250
+ durative concept lattice — the design.
251
+
252
+ An act has a **domain** (the layer it consumes) and a **codomain** (the layer it produces):
253
+
254
+ - a DISPATCH produces a **spec** — the delegate's instructions are the layer being written;
255
+ - a WRITE to a source or config file produces an **artifact**;
256
+ - reading anything at all produces **nothing**, and is never a breach.
257
+
258
+ An act is **outside the arrow** when its codomain is not in the contract's \`writes\` set. That is the
259
+ whole test, and it is mechanical.
260
+
261
+ ## What to BLOCK
262
+
263
+ - **A write whose codomain is \`artifact\` by a holder whose \`writes\` set excludes \`artifact\`.**
264
+ The contract usually names this: \`descent\`. The path in the payload is the evidence.
265
+ - **A dispatch whose codomain is \`spec\` by a holder whose \`writes\` set excludes \`spec\`.** This is
266
+ the skipped rung: a holder that writes only the design has handed a delegate a spec that no
267
+ spec-writing role produced. The prompt is the evidence.
268
+ - **A dispatch whose prompt is the operator's literal words rather than a piece the agent cut.** The
269
+ contract that convicts this is the same clause: a dispatch is a spec, and transcription is not
270
+ authorship. Evidence is the prompt reading as relayed instructions rather than a bounded piece
271
+ with its own acceptance.
272
+
273
+ ## What to PASS — and these are the majority
274
+
275
+ - **Any read.** Reading is outside the test by construction. Even where a contract calls
276
+ artifact-reading a descent, that is a standing discipline, not a mid-turn refusal.
277
+ - **A dispatch to a role the contract explicitly routes to.** Contracts name their delegations
278
+ (\`⟨C → spec⟩ ↦ plan\`, \`⟨artifact → C⟩ ↦ assay\`). Handing work to a named delegate is the arrow
279
+ WORKING.
280
+ - **Any act the \`reserves\` clause names**, whatever it is.
281
+ - **A write by a holder whose \`writes\` set includes \`artifact\`.** Most agents in most corpora
282
+ build. Do not read a contract's other clauses as narrowing an arrow that plainly permits the act.
283
+ - **Anything you are unsure about.** Fail toward PASS. A missed breach costs one wrong act; a
284
+ fabricated block costs the agent's trust in a law it can read for itself, and it wedges work.
285
+
286
+ ## Output
287
+
288
+ Emit **only** this block, nothing before or after:
289
+
290
+ \`\`\`
291
+ VERDICT: BLOCK|PASS
292
+ REASON: <one sentence naming the clause of the contract the act falls outside, and the codomain that put it there>
293
+ SPAN: <a short literal substring copied from the payload that shows the act — omit this line entirely when the verdict is PASS>
294
+ \`\`\`
295
+
296
+ \`SPAN\` is checked against the payload character for character. If you cannot copy a literal span out
297
+ of the payload, you do not have the evidence for a BLOCK, and the verdict is PASS.
298
+ `,
299
+ },
300
+ ],
301
+ };
302
+ //# sourceMappingURL=purview-guardrail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"purview-guardrail.js","sourceRoot":"","sources":["../../src/hooks/purview-guardrail.ts"],"names":[],"mappings":"AAEA,qEAAqE;AACrE,EAAE;AACF,oEAAoE;AACpE,oFAAoF;AACpF,mFAAmF;AACnF,kFAAkF;AAClF,qBAAqB;AACrB,EAAE;AACF,iFAAiF;AACjF,uFAAuF;AACvF,uFAAuF;AACvF,uFAAuF;AACvF,mFAAmF;AACnF,wFAAwF;AACxF,EAAE;AACF,sFAAsF;AACtF,oFAAoF;AACpF,uFAAuF;AACvF,uFAAuF;AACvF,uFAAuF;AACvF,+EAA+E;AAC/E,sFAAsF;AACtF,yEAAyE;AACzE,EAAE;AACF,+DAA+D;AAC/D,qFAAqF;AACrF,0EAA0E;AAC1E,gFAAgF;AAChF,sFAAsF;AACtF,kFAAkF;AAClF,0EAA0E;AAC1E,uFAAuF;AACvF,sFAAsF;AACtF,oFAAoF;AACpF,8DAA8D;AAC9D,EAAE;AACF,sFAAsF;AACtF,wFAAwF;AACxF,mFAAmF;AACnF,2BAA2B;AAE3B,MAAM,CAAC,MAAM,gBAAgB,GAAa;IACxC,EAAE,EAAE,mBAAmB;IACvB,OAAO,EACL,iaAAia;IACna,SAAS,EAAE,SAAS;IACpB,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC,uBAAuB,EAAE,cAAc,CAAC;IACjD,KAAK,EAAE,sBAAsB;IAC7B,OAAO,EAAE,EAAE;IACX,IAAI,EAAE,EAAE;IACR,OAAO,EAAE;QACP;YACE,QAAQ,EAAE,sBAAsB;YAChC,UAAU,EAAE,uDAAuD;YACnE,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6Jd;SACI;QACD;YACE,QAAQ,EAAE,yBAAyB;YACnC,UAAU,EAAE,0DAA0D;YACtE,UAAU,EAAE,KAAK;YACjB,iFAAiF;YACjF,2EAA2E;YAC3E,6EAA6E;YAC7E,8EAA8E;YAC9E,6BAA6B;YAC7B,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Ed;SACI;KACF;CACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { RoleCell } from './hold.js';
2
+ export declare const architectRole: RoleCell;
@@ -0,0 +1,101 @@
1
+ import { convergence as convergence_audienceAdaptation } from '../dimensions/audience-adaptation/convergence.js';
2
+ import { principalSelf } from '../dimensions/autonomy/decision-authority.js';
3
+ import { handoff as handoff_autonomy } from '../dimensions/autonomy/handoff.js';
4
+ import { humanOnTheLoop as humanOnTheLoop_autonomy } from '../dimensions/autonomy/human-on-the-loop.js';
5
+ import { missionCommand } from '../dimensions/autonomy/mission-command.js';
6
+ import { researchInvestigation as researchInvestigation_capabilities } from '../dimensions/capabilities/research-investigation.js';
7
+ import { systemDesign as systemDesign_capabilities } from '../dimensions/capabilities/system-design.js';
8
+ import { cratylism as cratylism_engineeringPrinciples } from '../dimensions/engineering-principles/cratylism.js';
9
+ import { dry as dry_engineeringPrinciples } from '../dimensions/engineering-principles/dry.js';
10
+ import { firstPrinciples as firstPrinciples_engineeringPrinciples } from '../dimensions/engineering-principles/first-principles.js';
11
+ import { greenField as greenField_engineeringPrinciples } from '../dimensions/engineering-principles/green-field.js';
12
+ import { llmNative as llmNative_engineeringPrinciples } from '../dimensions/engineering-principles/llm-native.js';
13
+ import { mece as mece_engineeringPrinciples } from '../dimensions/engineering-principles/mece.js';
14
+ import { separationOfConcerns as separationOfConcerns_engineeringPrinciples } from '../dimensions/engineering-principles/separation-of-concerns.js';
15
+ import { simplicity as simplicity_engineeringPrinciples } from '../dimensions/engineering-principles/simplicity.js';
16
+ import { trustButVerify as trustButVerify_engineeringPrinciples } from '../dimensions/engineering-principles/trust-but-verify.js';
17
+ import { plain as plain_formality } from '../dimensions/formality/plain.js';
18
+ import { systemsThinking as systemsThinking_framing } from '../dimensions/framing/systems-thinking.js';
19
+ import { honesty as honesty_guardrails } from '../dimensions/guardrails/honesty.js';
20
+ import { correctionConsolidation as correctionConsolidation_learning } from '../dimensions/learning/correction-consolidation.js';
21
+ import { delivery as delivery_objective } from '../dimensions/objective/delivery.js';
22
+ import { planAndSolve as planAndSolve_reasoningStrategy } from '../dimensions/reasoning-strategy/plan-and-solve.js';
23
+ import { architect as architect_role } from '../dimensions/role/architect.js';
24
+ import { optimize as optimize_satisficing } from '../dimensions/satisficing/optimize.js';
25
+ import { acceptanceCriteriaCheck as acceptanceCriteriaCheck_selfEvaluation } from '../dimensions/self-evaluation/acceptance-criteria-check.js';
26
+ import { projection as projection_situationAwareness } from '../dimensions/situation-awareness/projection.js';
27
+ import { decisionRationale as decisionRationale_transparency } from '../dimensions/transparency/decision-rationale.js';
28
+ // THE TOP RUNG. `architect`, `planner` and `implementer` are one ladder differing FIRST in
29
+ // decision authority — principal here, withheld below — and SECOND in the arrow each
30
+ // one is. Every rung carries `mission-command`, whose escalation clause is the shared
31
+ // law: surface the fork, do not resolve it. That single rule is what keeps delegation
32
+ // from silently becoming re-delegation of the design.
33
+ //
34
+ // WHAT THE CAPABILITY SET SAYS, AND WHAT IT DELIBERATELY DOES NOT.
35
+ // `software-engineering` was always absent, and that absence used to be the entire
36
+ // delegation boundary. It is now redundant with a contract that states the boundary out
37
+ // loud, which is the improvement: an absence cannot be quoted by a rubric and cannot be
38
+ // distinguished from an oversight by anyone reading the Target.
39
+ //
40
+ // Two capabilities were REMOVED when the contract was written down, because the
41
+ // contract convicted them. `planning-decomposition` was glossed "the decomposition that
42
+ // hands work out" while `⟨C → spec⟩ ↦ plan` says the opposite, and an agent holding a
43
+ // capability exercises it. `review-critique ≜ ⟨adversarial threat-modeling
44
+ // severity-triage⟩` is a substrate act under a name that sounded conceptual; the
45
+ // critique this rung performs is `judge`, which the contract reserves by name.
46
+ export const architectRole = {
47
+ sign: architect_role,
48
+ // `design` holds the lattice, `deliver` closes the loop on what comes back. Declared
49
+ // rather than described — omp injects them before a dispatched subagent's first
50
+ // prompt and the generic launcher names them as required reading for a main session,
51
+ // so a holder is the same agent either way it is reached.
52
+ skills: ['design', 'deliver'],
53
+ vector: {
54
+ formality: plain_formality,
55
+ // `convergence`: this position's output is UNDERSTANDING, which is worthless at a
56
+ // density its reader cannot take. A holder whose interlocutor is a peer expert
57
+ // overrides it — `nico` does — which is precisely what a default is for.
58
+ audienceAdaptation: convergence_audienceAdaptation,
59
+ transparency: decisionRationale_transparency,
60
+ autonomy: [
61
+ principalSelf,
62
+ humanOnTheLoop_autonomy,
63
+ missionCommand,
64
+ handoff_autonomy,
65
+ ],
66
+ // `delivery`, against the obvious pull toward `insight`. The characteristic failure
67
+ // of this position is becoming a theorist who emits documents while the work
68
+ // stalls; the standing drive is the finished system, and design is how it gets
69
+ // there rather than what it is for.
70
+ objective: delivery_objective,
71
+ engineeringPrinciples: [
72
+ cratylism_engineeringPrinciples,
73
+ llmNative_engineeringPrinciples,
74
+ firstPrinciples_engineeringPrinciples,
75
+ // The three carrying this position's specific load: concerns must not mix,
76
+ // delegated work is checked rather than trusted, and executors are told to BREAK
77
+ // what does not conform rather than accrete beside it.
78
+ separationOfConcerns_engineeringPrinciples,
79
+ trustButVerify_engineeringPrinciples,
80
+ greenField_engineeringPrinciples,
81
+ simplicity_engineeringPrinciples,
82
+ dry_engineeringPrinciples,
83
+ mece_engineeringPrinciples,
84
+ ],
85
+ guardrails: [honesty_guardrails],
86
+ capabilities: [
87
+ systemDesign_capabilities,
88
+ researchInvestigation_capabilities,
89
+ ],
90
+ learning: correctionConsolidation_learning,
91
+ situationAwareness: projection_situationAwareness,
92
+ framing: systemsThinking_framing,
93
+ reasoningStrategy: planAndSolve_reasoningStrategy,
94
+ satisficing: optimize_satisficing,
95
+ // NOT an executable test oracle. A suite going green proves the executor's own
96
+ // claim and says nothing about conformance to the design; acceptance is judged
97
+ // against the criteria the design states.
98
+ selfEvaluation: acceptanceCriteriaCheck_selfEvaluation,
99
+ },
100
+ };
101
+ //# sourceMappingURL=architect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"architect.js","sourceRoot":"","sources":["../../src/roles/architect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,8BAA8B,EAAE,MAAM,kDAAkD,CAAC;AACjH,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,cAAc,IAAI,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACxG,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,qBAAqB,IAAI,kCAAkC,EAAE,MAAM,sDAAsD,CAAC;AACnI,OAAO,EAAE,YAAY,IAAI,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACxG,OAAO,EAAE,SAAS,IAAI,+BAA+B,EAAE,MAAM,mDAAmD,CAAC;AACjH,OAAO,EAAE,GAAG,IAAI,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAC/F,OAAO,EAAE,eAAe,IAAI,qCAAqC,EAAE,MAAM,0DAA0D,CAAC;AACpI,OAAO,EAAE,UAAU,IAAI,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AACrH,OAAO,EAAE,SAAS,IAAI,+BAA+B,EAAE,MAAM,oDAAoD,CAAC;AAClH,OAAO,EAAE,IAAI,IAAI,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAClG,OAAO,EAAE,oBAAoB,IAAI,0CAA0C,EAAE,MAAM,gEAAgE,CAAC;AACpJ,OAAO,EAAE,UAAU,IAAI,gCAAgC,EAAE,MAAM,oDAAoD,CAAC;AACpH,OAAO,EAAE,cAAc,IAAI,oCAAoC,EAAE,MAAM,0DAA0D,CAAC;AAClI,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,eAAe,IAAI,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACvG,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACpF,OAAO,EAAE,uBAAuB,IAAI,gCAAgC,EAAE,MAAM,oDAAoD,CAAC;AACjI,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACrF,OAAO,EAAE,YAAY,IAAI,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AACpH,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,QAAQ,IAAI,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AACzF,OAAO,EAAE,uBAAuB,IAAI,sCAAsC,EAAE,MAAM,4DAA4D,CAAC;AAC/I,OAAO,EAAE,UAAU,IAAI,6BAA6B,EAAE,MAAM,iDAAiD,CAAC;AAC9G,OAAO,EAAE,iBAAiB,IAAI,8BAA8B,EAAE,MAAM,kDAAkD,CAAC;AAGvH,2FAA2F;AAC3F,qFAAqF;AACrF,sFAAsF;AACtF,sFAAsF;AACtF,sDAAsD;AACtD,EAAE;AACF,mEAAmE;AACnE,mFAAmF;AACnF,wFAAwF;AACxF,wFAAwF;AACxF,gEAAgE;AAChE,EAAE;AACF,gFAAgF;AAChF,wFAAwF;AACxF,sFAAsF;AACtF,2EAA2E;AAC3E,iFAAiF;AACjF,+EAA+E;AAE/E,MAAM,CAAC,MAAM,aAAa,GAAa;IACrC,IAAI,EAAE,cAAc;IACpB,qFAAqF;IACrF,gFAAgF;IAChF,qFAAqF;IACrF,0DAA0D;IAC1D,MAAM,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,MAAM,EAAE;QACN,SAAS,EAAE,eAAe;QAC1B,kFAAkF;QAClF,+EAA+E;QAC/E,yEAAyE;QACzE,kBAAkB,EAAE,8BAA8B;QAClD,YAAY,EAAE,8BAA8B;QAC5C,QAAQ,EAAE;YACR,aAAa;YACb,uBAAuB;YACvB,cAAc;YACd,gBAAgB;SACjB;QACD,oFAAoF;QACpF,6EAA6E;QAC7E,+EAA+E;QAC/E,oCAAoC;QACpC,SAAS,EAAE,kBAAkB;QAC7B,qBAAqB,EAAE;YACrB,+BAA+B;YAC/B,+BAA+B;YAC/B,qCAAqC;YACrC,2EAA2E;YAC3E,iFAAiF;YACjF,uDAAuD;YACvD,0CAA0C;YAC1C,oCAAoC;YACpC,gCAAgC;YAChC,gCAAgC;YAChC,yBAAyB;YACzB,0BAA0B;SAC3B;QACD,UAAU,EAAE,CAAC,kBAAkB,CAAC;QAChC,YAAY,EAAE;YACZ,yBAAyB;YACzB,kCAAkC;SACnC;QACD,QAAQ,EAAE,gCAAgC;QAC1C,kBAAkB,EAAE,6BAA6B;QACjD,OAAO,EAAE,uBAAuB;QAChC,iBAAiB,EAAE,8BAA8B;QACjD,WAAW,EAAE,oBAAoB;QACjC,+EAA+E;QAC/E,+EAA+E;QAC/E,0CAA0C;QAC1C,cAAc,EAAE,sCAAsC;KACvD;CACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { RoleCell } from './hold.js';
2
+ export declare const assayerRole: RoleCell;
@@ -0,0 +1,66 @@
1
+ import { maintenance as maintenance_audienceAdaptation } from '../dimensions/audience-adaptation/maintenance.js';
2
+ import { handoff as handoff_autonomy } from '../dimensions/autonomy/handoff.js';
3
+ import { missionCommand } from '../dimensions/autonomy/mission-command.js';
4
+ import { researchInvestigation as researchInvestigation_capabilities } from '../dimensions/capabilities/research-investigation.js';
5
+ import { softwareEngineering as softwareEngineering_capabilities } from '../dimensions/capabilities/software-engineering.js';
6
+ import { cratylism as cratylism_engineeringPrinciples } from '../dimensions/engineering-principles/cratylism.js';
7
+ import { firstPrinciples as firstPrinciples_engineeringPrinciples } from '../dimensions/engineering-principles/first-principles.js';
8
+ import { mece as mece_engineeringPrinciples } from '../dimensions/engineering-principles/mece.js';
9
+ import { plain as plain_formality } from '../dimensions/formality/plain.js';
10
+ import { analytical as analytical_framing } from '../dimensions/framing/analytical.js';
11
+ import { honesty as honesty_guardrails } from '../dimensions/guardrails/honesty.js';
12
+ import { correctionConsolidation as correctionConsolidation_learning } from '../dimensions/learning/correction-consolidation.js';
13
+ import { thoroughness as thoroughness_objective } from '../dimensions/objective/thoroughness.js';
14
+ import { structuredData as structuredData_outputFormat } from '../dimensions/output-format/structured-data.js';
15
+ import { react as react_reasoningStrategy } from '../dimensions/reasoning-strategy/react.js';
16
+ import { assayer as assayer_role } from '../dimensions/role/assayer.js';
17
+ import { satisfice as satisfice_satisficing } from '../dimensions/satisficing/satisfice.js';
18
+ import { acceptanceCriteriaCheck as acceptanceCriteriaCheck_selfEvaluation } from '../dimensions/self-evaluation/acceptance-criteria-check.js';
19
+ import { comprehension as comprehension_situationAwareness } from '../dimensions/situation-awareness/comprehension.js';
20
+ import { provenanceAttribution as provenanceAttribution_transparency } from '../dimensions/transparency/provenance-attribution.js';
21
+ // THE UPWARD ARROW. `software-engineering` is PRESENT here and absent one rung up, and
22
+ // the two facts are the same decision: this is the position that descends, so that the
23
+ // design-holder does not.
24
+ //
25
+ // EVERY ASPECT BELOW IS CHOSEN AGAINST THE ONE FAILURE MODE — turning into a code
26
+ // reviewer. `thoroughness` rewards answering every concept in `realizes(unit)` rather
27
+ // than finding something to say. `satisfice` stops at the answer instead of reading on.
28
+ // `structured-data` makes the report a list of ⟨concept, uncovered-factor, locus⟩ rather
29
+ // than a narrative, and a narrative is where mechanism-prose gets in. `cratylism`
30
+ // carries the cheapest of the three questions — does the artifact SPELL its concept —
31
+ // and `first-principles` forbids inheriting the executor's own account of what it built.
32
+ //
33
+ // `design` and no `deliver`: it must read the lattice to lift into it, and judging is
34
+ // not its remit.
35
+ export const assayerRole = {
36
+ sign: assayer_role,
37
+ skills: ['design'],
38
+ vector: {
39
+ formality: plain_formality,
40
+ audienceAdaptation: maintenance_audienceAdaptation,
41
+ // `provenance-attribution`: an unachieved concept travels with a locus, and a locus
42
+ // asserted without a source is a claim the principal cannot route.
43
+ transparency: provenanceAttribution_transparency,
44
+ // No `principal-self`. It is dispatched, it answers, it returns.
45
+ autonomy: [missionCommand, handoff_autonomy],
46
+ objective: thoroughness_objective,
47
+ engineeringPrinciples: [
48
+ cratylism_engineeringPrinciples,
49
+ firstPrinciples_engineeringPrinciples,
50
+ mece_engineeringPrinciples,
51
+ ],
52
+ guardrails: [honesty_guardrails],
53
+ capabilities: [
54
+ softwareEngineering_capabilities,
55
+ researchInvestigation_capabilities,
56
+ ],
57
+ learning: correctionConsolidation_learning,
58
+ situationAwareness: comprehension_situationAwareness,
59
+ framing: analytical_framing,
60
+ reasoningStrategy: react_reasoningStrategy,
61
+ satisficing: satisfice_satisficing,
62
+ outputFormat: structuredData_outputFormat,
63
+ selfEvaluation: acceptanceCriteriaCheck_selfEvaluation,
64
+ },
65
+ };
66
+ //# sourceMappingURL=assayer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assayer.js","sourceRoot":"","sources":["../../src/roles/assayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,8BAA8B,EAAE,MAAM,kDAAkD,CAAC;AACjH,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,qBAAqB,IAAI,kCAAkC,EAAE,MAAM,sDAAsD,CAAC;AACnI,OAAO,EAAE,mBAAmB,IAAI,gCAAgC,EAAE,MAAM,oDAAoD,CAAC;AAC7H,OAAO,EAAE,SAAS,IAAI,+BAA+B,EAAE,MAAM,mDAAmD,CAAC;AACjH,OAAO,EAAE,eAAe,IAAI,qCAAqC,EAAE,MAAM,0DAA0D,CAAC;AACpI,OAAO,EAAE,IAAI,IAAI,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAClG,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,UAAU,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACpF,OAAO,EAAE,uBAAuB,IAAI,gCAAgC,EAAE,MAAM,oDAAoD,CAAC;AACjI,OAAO,EAAE,YAAY,IAAI,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjG,OAAO,EAAE,cAAc,IAAI,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC/G,OAAO,EAAE,KAAK,IAAI,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,SAAS,IAAI,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC5F,OAAO,EAAE,uBAAuB,IAAI,sCAAsC,EAAE,MAAM,4DAA4D,CAAC;AAC/I,OAAO,EAAE,aAAa,IAAI,gCAAgC,EAAE,MAAM,oDAAoD,CAAC;AACvH,OAAO,EAAE,qBAAqB,IAAI,kCAAkC,EAAE,MAAM,sDAAsD,CAAC;AAGnI,uFAAuF;AACvF,uFAAuF;AACvF,0BAA0B;AAC1B,EAAE;AACF,kFAAkF;AAClF,sFAAsF;AACtF,wFAAwF;AACxF,yFAAyF;AACzF,kFAAkF;AAClF,sFAAsF;AACtF,yFAAyF;AACzF,EAAE;AACF,sFAAsF;AACtF,iBAAiB;AAEjB,MAAM,CAAC,MAAM,WAAW,GAAa;IACnC,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE,CAAC,QAAQ,CAAC;IAClB,MAAM,EAAE;QACN,SAAS,EAAE,eAAe;QAC1B,kBAAkB,EAAE,8BAA8B;QAClD,oFAAoF;QACpF,mEAAmE;QACnE,YAAY,EAAE,kCAAkC;QAChD,iEAAiE;QACjE,QAAQ,EAAE,CAAC,cAAc,EAAE,gBAAgB,CAAC;QAC5C,SAAS,EAAE,sBAAsB;QACjC,qBAAqB,EAAE;YACrB,+BAA+B;YAC/B,qCAAqC;YACrC,0BAA0B;SAC3B;QACD,UAAU,EAAE,CAAC,kBAAkB,CAAC;QAChC,YAAY,EAAE;YACZ,gCAAgC;YAChC,kCAAkC;SACnC;QACD,QAAQ,EAAE,gCAAgC;QAC1C,kBAAkB,EAAE,gCAAgC;QACpD,OAAO,EAAE,kBAAkB;QAC3B,iBAAiB,EAAE,uBAAuB;QAC1C,WAAW,EAAE,qBAAqB;QAClC,YAAY,EAAE,2BAA2B;QACzC,cAAc,EAAE,sCAAsC;KACvD;CACF,CAAC"}
@@ -0,0 +1,57 @@
1
+ import type { Agent as AgentIdentity, DimensionFieldsOf } from '@cratylus/schema';
2
+ import { MANIFEST } from '../manifest.js';
3
+ import type { Agent, Role } from '../manifest.js';
4
+ /** Every dimension FIELD of this corpus, as an agent carries it. */
5
+ type DimensionFields = DimensionFieldsOf<typeof MANIFEST>;
6
+ /**
7
+ * What a role SUPPLIES — a partial dimension vector, minus `role` (which is the
8
+ * role's own `sign`) and plus `guardrails`, which is `required: true` in the
9
+ * manifest and is therefore the position's to state. A position that confines
10
+ * nobody is not a lesser position, it is an unconfined one, and the catch-all
11
+ * belongs where every holder inherits it rather than on each holder in turn.
12
+ */
13
+ export type RoleVector = Partial<Omit<DimensionFields, 'role' | 'guardrails'>> & Pick<DimensionFields, 'guardrails'>;
14
+ /** The expectations attached to one position. */
15
+ export interface RoleCell {
16
+ /**
17
+ * The `role` dimension value — the position's CONTRACT, not merely its name. It
18
+ * states the pair ⟨reads, writes⟩ over the ladder and the acts the pair reserves;
19
+ * delegation is a theorem of the pair rather than a second declaration beside it.
20
+ */
21
+ readonly sign: Role;
22
+ /** The apparatus every holder operates through. Holders may add; see `holds`. */
23
+ readonly skills?: readonly string[];
24
+ /** The aspects expected of anyone holding the position — DEFAULTS, every one. */
25
+ readonly vector: RoleVector;
26
+ }
27
+ /**
28
+ * What the HOLDER declares: its identity, and any dimension value of its own.
29
+ *
30
+ * Unbounded in size — `kino` declares an entire domain over the architect role — and
31
+ * bounded in exactly one way: `role` is absent, because the contract is the position's.
32
+ * An aspect stated here OVERRIDES a scalar the role supplies and EXTENDS a set.
33
+ */
34
+ export type Declared = AgentIdentity & Partial<Omit<DimensionFields, 'role'>>;
35
+ /**
36
+ * `select(a) = hold(a) ⊕ declare(a)` — the two-operand fold, run at authoring time so
37
+ * the projected Target stays flat.
38
+ *
39
+ * `⊕` reads the manifest's own `arity`, so the precedence rule is stated once and
40
+ * cannot disagree with itself:
41
+ *
42
+ * · set → role members first, then the holder's own — EXTEND. A role-supplied
43
+ * member therefore survives every holder, which is why a set needs no
44
+ * inviolability marking: union already guarantees it.
45
+ * · scalar → the holder's value when the KEY IS PRESENT, else the role's — OVERRIDE.
46
+ * Present-with-`null` is an explicit suppression and is honoured as one;
47
+ * absent means "whatever the position says", which is the common case.
48
+ *
49
+ * A dimension neither operand states is `null` — omit-to-inherit, exactly as a
50
+ * hand-written vector spells it.
51
+ *
52
+ * `provenance.mark` NEVER folds: it is instance-bound, minted per agent at
53
+ * `create-agent`, and two agents sharing a mark are indistinguishable in the one place
54
+ * an operator reads them. It arrives on `declared` and leaves untouched.
55
+ */
56
+ export declare function holds(role: RoleCell, declared: Declared): Agent;
57
+ export {};