@cordfuse/politik 0.4.0 → 0.6.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 (81) hide show
  1. package/EXECUTION.md +90 -85
  2. package/POLITIK-ARCHITECTURE.md +111 -176
  3. package/PROTOCOLS.md +120 -289
  4. package/README.md +130 -177
  5. package/RESEARCH.md +142 -436
  6. package/RUNTIME.md +253 -261
  7. package/docs/adr/0001-chamber-transport.md +2 -0
  8. package/docs/adr/0002-charter-schema.md +2 -0
  9. package/docs/adr/0003-state-json-schema.md +2 -0
  10. package/docs/adr/0004-motion-enactment.md +2 -0
  11. package/docs/adr/0005-hansard-format.md +2 -0
  12. package/docs/adr/0006-protocol-behavioral-enforcement.md +2 -0
  13. package/docs/adr/0007-protocol-mechanics.md +2 -0
  14. package/docs/adr/0008-session-storage.md +2 -0
  15. package/docs/adr/0009-match-primitive.md +2 -0
  16. package/docs/adr/0010-operator-interface.md +2 -0
  17. package/docs/adr/0011-shared-sessions.md +2 -0
  18. package/docs/adr/0012-plain-vocabulary.md +68 -0
  19. package/docs/adr/0013-rule-defined-protocols.md +89 -0
  20. package/package.json +1 -1
  21. package/protocols/CONTRIBUTING.md +47 -87
  22. package/protocols/adversarial-review.yml +19 -0
  23. package/protocols/elimination-rounds.yml +18 -0
  24. package/protocols/majority-vote.yml +18 -0
  25. package/protocols/panel-review.yml +19 -0
  26. package/protocols/single-decider.yml +18 -0
  27. package/protocols/unanimous-vote.yml +17 -0
  28. package/src/actors.ts +124 -100
  29. package/src/agents.ts +64 -23
  30. package/src/ballot.ts +747 -0
  31. package/src/canon.ts +23 -10
  32. package/src/capability.ts +16 -99
  33. package/src/charter.ts +41 -34
  34. package/src/cli.ts +541 -480
  35. package/src/{prorogation.ts → closing.ts} +43 -43
  36. package/src/conflict.ts +14 -14
  37. package/src/containment.ts +11 -11
  38. package/src/doctor.ts +1 -1
  39. package/src/election.ts +4 -4
  40. package/src/envelope.ts +3 -3
  41. package/src/escalation.ts +44 -44
  42. package/src/fault.ts +8 -8
  43. package/src/federation.ts +14 -14
  44. package/src/git.ts +21 -18
  45. package/src/heartbeat.ts +32 -32
  46. package/src/index.ts +5 -5
  47. package/src/init.ts +66 -65
  48. package/src/integrity.ts +30 -30
  49. package/src/ledger.ts +3 -3
  50. package/src/{hansard.ts → log.ts} +20 -20
  51. package/src/{crisis.ts → misconduct.ts} +70 -70
  52. package/src/operator.ts +5 -5
  53. package/src/pending.ts +9 -9
  54. package/src/projection.ts +30 -30
  55. package/src/protocol-sdk.ts +12 -121
  56. package/src/protocol.ts +8 -78
  57. package/src/providers/github.ts +12 -12
  58. package/src/quorum.ts +7 -7
  59. package/src/remote.ts +1 -1
  60. package/src/runner.ts +134 -55
  61. package/src/scm.ts +14 -14
  62. package/src/spawn.ts +4 -4
  63. package/src/standings.ts +13 -13
  64. package/src/state.ts +6 -6
  65. package/src/templates/session.ts +448 -0
  66. package/src/tournament.ts +20 -20
  67. package/src/transport.ts +4 -4
  68. package/src/tree.ts +16 -16
  69. package/protocols/adversarial-collaboration.yml +0 -28
  70. package/protocols/corporate.yml +0 -35
  71. package/protocols/elimination-tournament.yml +0 -41
  72. package/protocols/emergency-response-ics.yml +0 -27
  73. package/protocols/jury-deliberation.yml +0 -32
  74. package/protocols/monarchy.yml +0 -31
  75. package/protocols/parliamentary.yml +0 -66
  76. package/protocols/peer-review.yml +0 -44
  77. package/protocols/republic.yml +0 -36
  78. package/protocols/socialism-collective.yml +0 -31
  79. package/protocols/solo.yml +0 -32
  80. package/src/division.ts +0 -609
  81. package/src/templates/parliamentary.ts +0 -580
package/src/canon.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * CANON — the canonical primitive layer.
3
3
  *
4
4
  * The engine speaks these terms. Protocols translate them to industry
5
- * vocabulary; nothing below this layer knows what "Speaker" or "Sprint" means.
5
+ * vocabulary; nothing below this layer knows what "Owner" or "Sprint" means.
6
6
  *
7
7
  * This module is types and frozen constants only — no logic, no I/O. It is the
8
8
  * single source of truth for CANON in code, so that any drift from
@@ -32,7 +32,7 @@ export type Role = (typeof ROLES)[number];
32
32
 
33
33
  /**
34
34
  * The one hard constitutional rule: AUTHORITY is always human. A Charter
35
- * declaring a machine as AUTHORITY is invalid and fails Writ Drop validation.
35
+ * declaring a machine as AUTHORITY is invalid and fails session opening validation.
36
36
  */
37
37
  export const HUMAN_ONLY_ROLES: readonly Role[] = Object.freeze(['AUTHORITY']);
38
38
 
@@ -55,7 +55,7 @@ export const PRIMITIVES = [
55
55
  'CHARTER',
56
56
  'RECORD',
57
57
  'MOTION',
58
- 'DIVISION',
58
+ 'BALLOT',
59
59
  'MATCH',
60
60
  'ESCALATION',
61
61
  'SUSPENSION',
@@ -74,7 +74,7 @@ export const VERBS = [
74
74
  'READ',
75
75
  'WRITE',
76
76
  'VOTE',
77
- 'ASSENT',
77
+ 'ENACT',
78
78
  'ESCALATE',
79
79
  'PROMOTE',
80
80
  'DEMOTE',
@@ -90,18 +90,31 @@ export const VERBS = [
90
90
 
91
91
  export type Verb = (typeof VERBS)[number];
92
92
 
93
+ /**
94
+ * The verbs each role holds by default — the same table the role files state.
95
+ * A Charter may grant more; an agent is told exactly these unless the caller
96
+ * passes its own list.
97
+ */
98
+ export const ROLE_VERBS: Readonly<Record<Role, readonly Verb[]>> = Object.freeze({
99
+ AUTHORITY: VERBS,
100
+ DELEGATE: VERBS.filter((v) => v !== 'DISSOLVE'),
101
+ OPERATOR: ['READ', 'WRITE', 'VOTE', 'ESCALATE', 'SPAWN'],
102
+ MEMBER: ['READ', 'VOTE', 'ESCALATE'],
103
+ OBSERVER: ['READ'],
104
+ });
105
+
93
106
  /* -------------------------------------------------------------------------- */
94
107
  /* States */
95
108
  /* -------------------------------------------------------------------------- */
96
109
 
97
110
  /**
98
- * The five valid states of a proceeding. CONSTITUTIONAL_CRISIS is deliberately
111
+ * The five valid states of a proceeding. MISCONDUCT is deliberately
99
112
  * absent — it is a *cause of suspension*, not a state (ADR-0003).
100
113
  */
101
114
  export const STATES = [
102
115
  'STATE_CONVENED',
103
116
  'STATE_SUSPENDED',
104
- 'STATE_PROROGUED',
117
+ 'STATE_CLOSED',
105
118
  'STATE_STALE',
106
119
  'STATE_INVALID',
107
120
  ] as const;
@@ -119,10 +132,10 @@ export type State = (typeof STATES)[number];
119
132
  * quiet".
120
133
  */
121
134
  export const SUSPENSION_CAUSES = [
122
- 'POINT_OF_ORDER',
123
- 'SPEAKER_ORDER',
135
+ 'ESCALATION',
136
+ 'OWNER_ORDER',
124
137
  'DISPUTED_EXIT',
125
- 'CONSTITUTIONAL_CRISIS',
138
+ 'MISCONDUCT',
126
139
  'DEADLOCK',
127
140
  ] as const;
128
141
 
@@ -133,7 +146,7 @@ export type SuspensionCause = (typeof SUSPENSION_CAUSES)[number];
133
146
  /* -------------------------------------------------------------------------- */
134
147
 
135
148
  /**
136
- * How a carried Motion is enacted on ASSENT. Declared in the Charter; Writ Drop
149
+ * How a carried Motion is enacted on ENACT. Declared in the Charter; session opening
137
150
  * enforces the squash/fast_forward constraints (ADR-0002).
138
151
  */
139
152
  export const MERGE_STRATEGIES = [
package/src/capability.ts CHANGED
@@ -1,65 +1,34 @@
1
1
  /**
2
- * Actor capability profiles — the five dimensions.
2
+ * Actor capability profiles — the three dimensions.
3
3
  *
4
4
  * A Charter declares what a constituency *requires*; an actor declares what
5
- * they *are*. This module decides whether the two match, at Writ Drop and again
5
+ * they *are*. This module decides whether the two match, at session opening and again
6
6
  * before an agent is spawned.
7
7
  *
8
8
  * The dimensions (POLITIK-ARCHITECTURE.md § Actor Capability Profile):
9
9
  *
10
10
  * 1. Role tier — trust and verbs. Already enforced elsewhere.
11
- * 2. Personality archetype — how the actor collaborates under pressure.
12
- * 3. Soft skills — how it reasons and communicates.
13
- * 4. Hard skills — domain competence, `required` and `excluded`.
14
- * 5. Model / knowledge grade — the underlying intelligence, per seat.
11
+ * 2. Hard skills — domain competence, `required` and `excluded`.
12
+ * 3. Model / knowledge grade — the underlying intelligence, per seat.
13
+ *
14
+ * Plus the mandate a seat expects. Every dimension here gates seating; a
15
+ * profile field that gated nothing (personality archetypes, soft skills) was
16
+ * removed rather than kept as an unmeasured variable.
15
17
  *
16
18
  * `excluded` matters as much as `required`, and is the less obvious of the two:
17
19
  * an actor working outside its domain does not fail loudly, it produces
18
20
  * confident wrong output. Excluding a skill is how a Charter says "not this,
19
21
  * even though you could".
20
22
  *
21
- * This module is also the instrument the research layer depends on. If profile
22
- * composition has measurable effects, the profiles have to be real and recorded
23
- * rather than declared and ignored.
24
- *
25
23
  * Attribution: Steve Krisjanovs, Cordfuse
26
24
  */
27
25
 
28
26
  import { parse as parseYaml } from 'yaml';
29
27
 
30
28
  import { splitFrontmatter, type Constituency } from './charter.ts';
31
- import type { HansardEntry } from './hansard.ts';
29
+ import type { RecordEntry } from './log.ts';
32
30
  import type { Role } from './canon.ts';
33
31
 
34
- /* -------------------------------------------------------------------------- */
35
- /* Dimensions 2 and 3 */
36
- /* -------------------------------------------------------------------------- */
37
-
38
- export const ARCHETYPES = [
39
- 'HARDLINER',
40
- 'DIPLOMAT',
41
- 'ANALYST',
42
- 'CREATIVE',
43
- 'LONE_WOLF',
44
- 'TEAM_PLAYER',
45
- 'JOKESTER',
46
- ] as const;
47
-
48
- export type Archetype = (typeof ARCHETYPES)[number];
49
-
50
- export const SOFT_SKILLS = [
51
- 'COMMUNICATION',
52
- 'CREATIVITY',
53
- 'ANALYTICAL_THINKING',
54
- 'PERSUASION',
55
- 'TECHNICAL_ACUMEN',
56
- ] as const;
57
-
58
- export type SoftSkill = (typeof SOFT_SKILLS)[number];
59
-
60
- export const isArchetype = (v: unknown): v is Archetype =>
61
- typeof v === 'string' && (ARCHETYPES as readonly string[]).includes(v);
62
-
63
32
  /* -------------------------------------------------------------------------- */
64
33
  /* Profile */
65
34
  /* -------------------------------------------------------------------------- */
@@ -67,8 +36,6 @@ export const isArchetype = (v: unknown): v is Archetype =>
67
36
  export interface ActorProfile {
68
37
  readonly actor: string;
69
38
  readonly role: Role;
70
- readonly archetype?: Archetype | null;
71
- readonly soft_skills?: Readonly<Partial<Record<SoftSkill, number>>>;
72
39
  readonly hard_skills?: readonly string[];
73
40
  readonly model?: string | null;
74
41
  /** ISO year-month, e.g. `2025-01`. */
@@ -77,7 +44,7 @@ export interface ActorProfile {
77
44
  }
78
45
 
79
46
  export interface CapabilityIssue {
80
- readonly dimension: 'hard_skills' | 'model' | 'knowledge_cutoff' | 'archetype' | 'mandate';
47
+ readonly dimension: 'hard_skills' | 'model' | 'knowledge_cutoff' | 'mandate';
81
48
  readonly severity: 'fail' | 'warn';
82
49
  readonly message: string;
83
50
  }
@@ -122,9 +89,9 @@ const cutoffSatisfies = (minimum: string | null, actual: string | null): boolean
122
89
  * Check an actor against the constituency it would be seated in.
123
90
  *
124
91
  * Hard failures block the seating; warnings are recorded and proceed. The split
125
- * follows the architecture: the engine "validates model compliance at Writ Drop
92
+ * follows the architecture: the engine "validates model compliance at session opening
126
93
  * and refuses to spawn a mismatched model", while a preferred-but-absent model
127
- * or an unstated archetype are configuration gaps, not disqualifications.
94
+ * is a configuration gap, not a disqualification.
128
95
  */
129
96
  export const checkCapability = (
130
97
  profile: ActorProfile,
@@ -195,13 +162,6 @@ export const checkCapability = (
195
162
  });
196
163
  }
197
164
 
198
- if (profile.archetype !== undefined && profile.archetype !== null && !isArchetype(profile.archetype)) {
199
- issues.push({
200
- dimension: 'archetype',
201
- severity: 'warn',
202
- message: `unknown archetype: ${String(profile.archetype)}`,
203
- });
204
- }
205
165
 
206
166
  return { ok: !issues.some((i) => i.severity === 'fail'), issues };
207
167
  };
@@ -224,15 +184,15 @@ export interface MismatchInput {
224
184
  /**
225
185
  * Record a SKILL_MISMATCH fault.
226
186
  *
227
- * Fires when Hansard performance reveals a mismatch that Writ Drop did not
187
+ * Fires when record performance reveals a mismatch that session opening did not
228
188
  * catch — output in an excluded domain, or repeated failure on required domain
229
189
  * work. Consequence depends on the Charter: auto-demote where permitted,
230
- * otherwise escalate to the Speaker.
190
+ * otherwise escalate to the owner.
231
191
  *
232
192
  * The record is permanent either way. Future sessions plan against it, which is
233
193
  * the point of keeping actor performance history at all.
234
194
  */
235
- export const skillMismatch = (input: MismatchInput): HansardEntry => ({
195
+ export const skillMismatch = (input: MismatchInput): RecordEntry => ({
236
196
  type: 'FAULT_ACTOR',
237
197
  at: input.at,
238
198
  actor: 'RECORD',
@@ -245,43 +205,11 @@ export const skillMismatch = (input: MismatchInput): HansardEntry => ({
245
205
  Observed: input.observed,
246
206
  Consequence: input.auto_demotion
247
207
  ? 'auto-demotion (permitted by Charter)'
248
- : 'escalated to the Speaker — auto_demotion is false',
208
+ : 'escalated to the owner — auto_demotion is false',
249
209
  Record: 'permanent — future sessions plan against this',
250
210
  },
251
211
  });
252
212
 
253
- /* -------------------------------------------------------------------------- */
254
- /* Composition */
255
- /* -------------------------------------------------------------------------- */
256
-
257
- export interface Composition {
258
- readonly archetypes: Readonly<Partial<Record<Archetype, number>>>;
259
- readonly distinct: number;
260
- readonly homogeneous: boolean;
261
- }
262
-
263
- /**
264
- * Describe the archetype composition of a seated bench.
265
- *
266
- * Measured, never judged. RESEARCH.md asks whether complementary composition
267
- * outperforms homogeneous composition — that is an open empirical question, and
268
- * a framework that warned about "bad" mixes would be answering it by assumption
269
- * and contaminating its own instrument.
270
- */
271
- export const composition = (profiles: readonly ActorProfile[]): Composition => {
272
- const archetypes: Partial<Record<Archetype, number>> = {};
273
- for (const p of profiles) {
274
- if (p.archetype === undefined || p.archetype === null) continue;
275
- archetypes[p.archetype] = (archetypes[p.archetype] ?? 0) + 1;
276
- }
277
- const distinct = Object.keys(archetypes).length;
278
- return {
279
- archetypes,
280
- distinct,
281
- homogeneous: distinct === 1 && profiles.length > 1,
282
- };
283
- };
284
-
285
213
  /* -------------------------------------------------------------------------- */
286
214
  /* Loading */
287
215
  /* -------------------------------------------------------------------------- */
@@ -312,20 +240,9 @@ export const parseProfile = (source: string, fallbackActor: string): ActorProfil
312
240
  if (!isObject(raw)) return null;
313
241
 
314
242
  const model = isObject(raw['model']) ? raw['model'] : {};
315
- const soft: Partial<Record<SoftSkill, number>> = {};
316
- if (isObject(raw['soft_skills'])) {
317
- for (const [key, value] of Object.entries(raw['soft_skills'])) {
318
- if ((SOFT_SKILLS as readonly string[]).includes(key) && typeof value === 'number') {
319
- soft[key as SoftSkill] = value;
320
- }
321
- }
322
- }
323
-
324
243
  return {
325
244
  actor: typeof raw['actor'] === 'string' ? raw['actor'] : fallbackActor,
326
245
  role: (typeof raw['role'] === 'string' ? raw['role'] : 'MEMBER') as Role,
327
- archetype: isArchetype(raw['archetype']) ? raw['archetype'] : null,
328
- soft_skills: soft,
329
246
  hard_skills: strings(raw['hard_skills']),
330
247
  model: typeof model['name'] === 'string' ? model['name'] : (typeof raw['model'] === 'string' ? raw['model'] : null),
331
248
  knowledge_cutoff:
package/src/charter.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
- * CHARTER.md — parser and Writ Drop validator.
2
+ * CHARTER.md — parser and session opening validator.
3
3
  *
4
4
  * The Charter is the sovereign law of a session: markdown with a single YAML
5
5
  * frontmatter block. The frontmatter carries every machine-read field; the
6
- * markdown body carries human-readable Standing Orders which the engine never
6
+ * markdown body carries human-readable Charter which the engine never
7
7
  * parses.
8
8
  *
9
9
  * Schema and the eight validation rules are fixed by ADR-0002 (with rules 5-7
@@ -23,13 +23,13 @@ import {
23
23
  type Role,
24
24
  } from './canon.ts';
25
25
  import type { ProtocolRecordMode } from './protocol.ts';
26
- import { isResolution, isExitPolicy, type Resolution, type ExitPolicy } from './division.ts';
27
- import { isTerminationPolicy, type TerminationPolicy } from './prorogation.ts';
26
+ import { isResolution, isExitPolicy, type Resolution, type ExitPolicy } from './ballot.ts';
27
+ import { isTerminationPolicy, type TerminationPolicy } from './closing.ts';
28
28
 
29
29
  /**
30
30
  * A content fingerprint of a Charter's source text.
31
31
  *
32
- * Recorded on the WRIT_DROP entry at session open so an immutable-charter
32
+ * Recorded on the SESSION_OPENED entry at session open so an immutable-charter
33
33
  * protocol (ADR-0007 `immutable_charter`) can prove its constitution has not
34
34
  * been edited since. The raw CHARTER.md bytes are hashed — not the parsed
35
35
  * object — so any change the operator makes to the file, meaningful or not, is
@@ -77,7 +77,7 @@ export interface Endurance {
77
77
  readonly max_motions: number | null;
78
78
  readonly max_cost_usd: number | null;
79
79
  /**
80
- * Spend at which the Speaker is warned, before the ceiling stops the session.
80
+ * Spend at which the owner is warned, before the ceiling stops the session.
81
81
  * The low-fuel light: a proceeding that dies at its ceiling with no warning
82
82
  * gives nobody the chance to extend the budget or wind down gracefully.
83
83
  */
@@ -96,13 +96,19 @@ export interface SessionBlock {
96
96
  readonly checkpoint_interval_hours: number | null;
97
97
  readonly deadline: string | null;
98
98
  readonly merge_strategy: MergeStrategy;
99
- readonly assent: Role;
99
+ readonly enact: Role;
100
100
  /**
101
- * ADR-0010: whether assent, rule and prorogue requested by an AI harness or a
102
- * script are staged for the Speaker's confirmation. Absent means 'off', so every
101
+ * True when the Charter is locked once the session opens: any later edit to
102
+ * CHARTER.md refuses governance acts. Copied from the protocol at scaffold,
103
+ * and recorded on the SESSION_OPENED entry so editing this line cannot unlock it.
104
+ */
105
+ readonly immutable_charter: boolean;
106
+ /**
107
+ * ADR-0010: whether enact, rule and close requested by an AI harness or a
108
+ * script are staged for the owner's confirmation. Absent means 'off', so every
103
109
  * session convened before ADR-0010 behaves exactly as it did.
104
110
  */
105
- readonly speaker_confirmation: 'required' | 'off';
111
+ readonly owner_confirmation: 'required' | 'off';
106
112
  /**
107
113
  * ADR-0011: whether a confirmed act's commit must be signed with the confirming
108
114
  * person's git signing key. Absent means 'off'.
@@ -149,8 +155,8 @@ export interface Constituency {
149
155
  /**
150
156
  * Constitutional-capture mitigations (RUNTIME.md § Constitutional Capture).
151
157
  *
152
- * These were implemented in `src/crisis.ts` but never parsed, so the YAML the
153
- * documentation shows was inert — a Speaker could declare a Witness Council and
158
+ * These were implemented in `src/misconduct.ts` but never parsed, so the YAML the
159
+ * documentation shows was inert — an owner could declare a Witness Council and
154
160
  * get nothing. Parsed here so the declaration has effect.
155
161
  */
156
162
  export interface Governance {
@@ -173,7 +179,7 @@ export interface Charter {
173
179
  readonly minimum_cast: Readonly<Partial<Record<Role, number>>>;
174
180
  readonly domain_veto: readonly Role[];
175
181
  /** Protocol override points (ADR-0007). Absent selections default to the
176
- * parliamentary behavior, so an older Charter is unchanged. */
182
+ * default protocol (majority-vote) behavior. */
177
183
  readonly mechanics: {
178
184
  readonly resolution: Resolution;
179
185
  readonly exit: ExitPolicy;
@@ -186,7 +192,7 @@ export interface Charter {
186
192
  readonly auto_retry_delay_minutes: number;
187
193
  };
188
194
  readonly constituencies: readonly Constituency[];
189
- /** Unparsed Standing Orders prose. Carried, never interpreted. */
195
+ /** Unparsed Charter prose. Carried, never interpreted. */
190
196
  readonly body: string;
191
197
  }
192
198
 
@@ -357,11 +363,12 @@ export const parseCharter = (source: string): ParseResult => {
357
363
  ? session['merge_strategy']
358
364
  : 'merge_commit',
359
365
  // Default only when absent. A present-but-invalid value is preserved so
360
- // Writ Drop rule 7 can reject it — coercing it to AUTHORITY here masked the
361
- // rule and let a bad assent silently open a session (AUDIT #8).
362
- assent: session['assent'] === undefined ? 'AUTHORITY' : (session['assent'] as Role),
366
+ // session opening rule 7 can reject it — coercing it to AUTHORITY here masked the
367
+ // rule and let a bad enact silently open a session (AUDIT #8).
368
+ enact: session['enact'] === undefined ? 'AUTHORITY' : (session['enact'] as Role),
369
+ immutable_charter: session['immutable_charter'] === true,
363
370
  stale_action: session['stale_action'] === 'dissolve' ? 'dissolve' : 'suspend',
364
- speaker_confirmation: session['speaker_confirmation'] === 'required' ? 'required' : 'off',
371
+ owner_confirmation: session['owner_confirmation'] === 'required' ? 'required' : 'off',
365
372
  signed_confirmations: session['signed_confirmations'] === 'required' ? 'required' : 'off',
366
373
  checkpoint_interval_hours: asNumberOrNull(session['checkpoint_interval_hours']),
367
374
  endurance: {
@@ -397,7 +404,7 @@ export const parseCharter = (source: string): ParseResult => {
397
404
  const m = isObject(raw['mechanics']) ? raw['mechanics'] : {};
398
405
  return {
399
406
  resolution: isResolution(m['resolution']) ? m['resolution'] : 'majority',
400
- exit: isExitPolicy(m['exit']) ? m['exit'] : 'division',
407
+ exit: isExitPolicy(m['exit']) ? m['exit'] : 'vote',
401
408
  termination: isTerminationPolicy(m['termination']) ? m['termination'] : 'objective',
402
409
  };
403
410
  })(),
@@ -408,7 +415,7 @@ export const parseCharter = (source: string): ParseResult => {
408
415
  return {
409
416
  // RUNTIME.md's documented defaults. A Charter that says nothing gets
410
417
  // retry rather than an immediate escalation, because a rate limit is
411
- // not something to wake a Speaker for.
418
+ // not something to wake an owner for.
412
419
  auto_retry_max: max !== null && max >= 0 ? max : 3,
413
420
  auto_retry_delay_minutes: delay !== null && delay >= 0 ? delay : 5,
414
421
  };
@@ -444,14 +451,14 @@ export const parseCharter = (source: string): ParseResult => {
444
451
  };
445
452
 
446
453
  /* -------------------------------------------------------------------------- */
447
- /* Validate — Writ Drop */
454
+ /* Validate — session opening */
448
455
  /* -------------------------------------------------------------------------- */
449
456
 
450
457
  /**
451
- * Apply the Writ Drop validation rules (ADR-0002 § Validation rules).
458
+ * Apply the session opening validation rules (ADR-0002 § Validation rules).
452
459
  *
453
460
  * A failing result means SESSION_INVALID: the session never opens and the
454
- * issues are committed to the Hansard naming what failed.
461
+ * issues are committed to the record naming what failed.
455
462
  *
456
463
  * `protocol` is optional. Rule 2 (protocol resolution) and rule 5 (squash vs
457
464
  * distributed record mode) are only enforced when the resolved protocol is
@@ -487,7 +494,7 @@ export const validateCharter = (
487
494
  if (requiredAuthority !== undefined && requiredAuthority < 1) {
488
495
  issues.push({
489
496
  field: 'minimum_cast.AUTHORITY',
490
- message: 'may never be overridden to 0 — a session with no Speaker cannot proceed',
497
+ message: 'may never be overridden to 0 — a session with no Owner cannot proceed',
491
498
  rule: 4,
492
499
  });
493
500
  }
@@ -503,7 +510,7 @@ export const validateCharter = (
503
510
  if (c.role === 'AUTHORITY' && c.agent !== null) {
504
511
  issues.push({
505
512
  field: `constituencies[${i}].agent`,
506
- message: `AUTHORITY is always human — this Charter seats the agent "${c.agent}" as Speaker`,
513
+ message: `AUTHORITY is always human — this Charter seats the agent "${c.agent}" as Owner`,
507
514
  });
508
515
  }
509
516
  }
@@ -511,11 +518,11 @@ export const validateCharter = (
511
518
  // Rule 3 — declared constituencies must satisfy minimum_cast.
512
519
  //
513
520
  // ADR-0002 says "assigned constituencies", which reads ambiguously. It means
514
- // the seats this Charter assigns, not actors sitting in them: Writ Drop runs
521
+ // the seats this Charter assigns, not actors session in them: session opening runs
515
522
  // *before* the session opens, so no actor has been seated yet and the other
516
523
  // reading would make the rule uncheckable at the only moment it runs.
517
524
  // Whether seats are actually filled is a runtime question, and quorum answers
518
- // it at Division time.
525
+ // it at vote time.
519
526
  const slotsByRole = new Map<Role, number>();
520
527
  for (const c of charter.constituencies) {
521
528
  slotsByRole.set(c.role, (slotsByRole.get(c.role) ?? 0) + c.slots);
@@ -543,20 +550,20 @@ export const validateCharter = (
543
550
  });
544
551
  }
545
552
 
546
- // Rule 6 — fast_forward leaves no merge node, so no evidence of a Division.
553
+ // Rule 6 — fast_forward leaves no merge node, so no evidence of a vote.
547
554
  if (charter.session.merge_strategy === 'fast_forward' && charter.session.quorum !== 1) {
548
555
  issues.push({
549
556
  field: 'session.merge_strategy',
550
- message: `fast_forward requires session.quorum: 1 (declared ${charter.session.quorum}) — it leaves no merge node to evidence a Division`,
557
+ message: `fast_forward requires session.quorum: 1 (declared ${charter.session.quorum}) — it leaves no merge node to evidence a vote`,
551
558
  rule: 6,
552
559
  });
553
560
  }
554
561
 
555
- // Rule 7 — assent must name a CANON role. Parsing now defaults only when the
562
+ // Rule 7 — enact must name a CANON role. Parsing now defaults only when the
556
563
  // key is absent, so a present-but-invalid value reaches here and is rejected.
557
- if (!isRole(charter.session.assent)) {
564
+ if (!isRole(charter.session.enact)) {
558
565
  issues.push({
559
- field: 'session.assent',
566
+ field: 'session.enact',
560
567
  message: 'must name a CANON role',
561
568
  rule: 7,
562
569
  });
@@ -575,10 +582,10 @@ export const validateCharter = (
575
582
  };
576
583
 
577
584
  /**
578
- * Parse and validate in one step — the Writ Drop entry point.
585
+ * Parse and validate in one step — the session opening entry point.
579
586
  * Rule 8: on pass, the caller sets `STATE.json.state = CONVENED`.
580
587
  */
581
- export const writDrop = (
588
+ export const sessionOpening = (
582
589
  source: string,
583
590
  protocol?: ProtocolContext,
584
591
  ): ValidationResult & { readonly charter?: Charter } => {