@cordfuse/politik 0.3.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 (69) hide show
  1. package/EXECUTION.md +766 -0
  2. package/LICENSE +21 -0
  3. package/POLITIK-ARCHITECTURE.md +676 -0
  4. package/PROTOCOLS.md +1106 -0
  5. package/README.md +193 -0
  6. package/RESEARCH.md +475 -0
  7. package/RUNTIME.md +1355 -0
  8. package/bin/politik.js +31 -0
  9. package/docs/adr/0001-chamber-transport.md +67 -0
  10. package/docs/adr/0002-charter-schema.md +142 -0
  11. package/docs/adr/0003-state-json-schema.md +134 -0
  12. package/docs/adr/0004-motion-enactment.md +215 -0
  13. package/docs/adr/0005-hansard-format.md +171 -0
  14. package/docs/adr/0006-protocol-behavioral-enforcement.md +89 -0
  15. package/docs/adr/0007-protocol-mechanics.md +100 -0
  16. package/docs/adr/0008-session-storage.md +108 -0
  17. package/docs/adr/0009-match-primitive.md +74 -0
  18. package/package.json +55 -0
  19. package/protocols/CONTRIBUTING.md +130 -0
  20. package/protocols/adversarial-collaboration.yml +28 -0
  21. package/protocols/corporate.yml +35 -0
  22. package/protocols/elimination-tournament.yml +41 -0
  23. package/protocols/emergency-response-ics.yml +27 -0
  24. package/protocols/jury-deliberation.yml +32 -0
  25. package/protocols/monarchy.yml +31 -0
  26. package/protocols/parliamentary.yml +66 -0
  27. package/protocols/peer-review.yml +44 -0
  28. package/protocols/republic.yml +36 -0
  29. package/protocols/socialism-collective.yml +31 -0
  30. package/protocols/solo.yml +32 -0
  31. package/src/actors.ts +742 -0
  32. package/src/agents.ts +318 -0
  33. package/src/canon.ts +173 -0
  34. package/src/capability.ts +336 -0
  35. package/src/charter.ts +545 -0
  36. package/src/cli.ts +2174 -0
  37. package/src/conflict.ts +211 -0
  38. package/src/containment.ts +155 -0
  39. package/src/crisis.ts +381 -0
  40. package/src/division.ts +609 -0
  41. package/src/doctor.ts +168 -0
  42. package/src/election.ts +233 -0
  43. package/src/envelope.ts +223 -0
  44. package/src/escalation.ts +320 -0
  45. package/src/fault.ts +241 -0
  46. package/src/federation.ts +299 -0
  47. package/src/git.ts +163 -0
  48. package/src/hansard.ts +201 -0
  49. package/src/heartbeat.ts +282 -0
  50. package/src/index.ts +43 -0
  51. package/src/init.ts +396 -0
  52. package/src/integrity.ts +153 -0
  53. package/src/ledger.ts +341 -0
  54. package/src/lockfs.ts +58 -0
  55. package/src/projection.ts +293 -0
  56. package/src/prorogation.ts +307 -0
  57. package/src/protocol-sdk.ts +248 -0
  58. package/src/protocol.ts +241 -0
  59. package/src/providers/github.ts +347 -0
  60. package/src/quorum.ts +137 -0
  61. package/src/runner.ts +534 -0
  62. package/src/scm.ts +142 -0
  63. package/src/spawn.ts +160 -0
  64. package/src/standings.ts +143 -0
  65. package/src/state.ts +179 -0
  66. package/src/templates/parliamentary.ts +359 -0
  67. package/src/tournament.ts +200 -0
  68. package/src/transport.ts +190 -0
  69. package/src/tree.ts +371 -0
@@ -0,0 +1,676 @@
1
+ # POLITIK
2
+ ### A Governed Multi-Agent Framework Built on Git
3
+
4
+ **Framework name: Politik**
5
+ **Repo:** `cordfuse/politik`
6
+ **Attribution:** Steve Krisjanovs, Cordfuse
7
+
8
+ **Note:** "Parliament" appears throughout as the default protocol vocabulary — not the framework name. The framework is Politik.
9
+
10
+ ---
11
+
12
+ > **Run local, run free.**
13
+ > **Run OAuth, run far.**
14
+ > **Run API keys, run carefully.**
15
+
16
+ ---
17
+
18
+ ## STATUS
19
+ - **Visibility:** Public · DOI: 10.5281/zenodo.19490359
20
+ - **Stage:** Architecture locked — reference implementation in progress
21
+
22
+ ---
23
+
24
+ ## PRIORITY 0 — NAMING (Before any scaffolding)
25
+
26
+ Nothing gets committed to a public repo, npm, Docker Hub, or Homebrew until these are locked.
27
+
28
+ ```
29
+ [x] Name the framework — POLITIK
30
+ [x] Name the canonical primitive layer — CANON
31
+ [x] Name the session unit — SESSION / PROCEEDING
32
+ [x] Name the governance protocol system — PROTOCOL
33
+ [x] Name the SCM provider abstraction — SCM Provider Interface
34
+ [x] Verify npm namespace — @cordfuse/politik
35
+ [x] Verify GitHub org/repo name — cordfuse/politik
36
+ [x] Verify Docker Hub namespace — cordfuse/politik
37
+ ```
38
+ **Status:** Framework name locked. CANON locked. All namespaces verified.
39
+
40
+ **Constraints:**
41
+ - Cannot contain "GitHub", "git", or any provider trademark
42
+ - Cannot contain "Claude", "Gemini", "OpenAI", or any AI provider trademark
43
+ - Should reflect governance model, not persistence layer
44
+ - Must be available across npm, Docker Hub, GitHub org
45
+
46
+ ---
47
+
48
+ ## THE IDEA
49
+
50
+ Politik is a **governed multi-agent operating system** where:
51
+
52
+ - A **human** is the constitutional authority — present but not operational
53
+ - **Agents** are CLI processes that spawn, do work, and dispose
54
+ - A **SCM repository** (GitHub or any SCM) IS the session — charter, record, state, and invite in one
55
+ - A **pluggable transport** is the chamber floor
56
+ - **Pluggable governance protocols** map the framework to any industry vocabulary
57
+ - **No new infrastructure required** — GitHub already built it
58
+
59
+ Nobody connected these pieces this way before.
60
+
61
+ ---
62
+
63
+ ## THE TAGLINE
64
+
65
+ ```
66
+ Run local, run free.
67
+ Run OAuth, run far.
68
+ Run API keys, run carefully.
69
+ ```
70
+
71
+ ---
72
+
73
+ ## CORE CONCEPTS
74
+
75
+ ### The Session Repo
76
+ The SCM repository IS the Politik session. It is:
77
+ - The charter (protocol Standing Orders)
78
+ - The record (Hansard)
79
+ - The invite (repo access = taking a Seat)
80
+ - The audit trail (git history)
81
+ - The notification system (GitHub Actions)
82
+ - The debate floor (Discussions)
83
+ - The motion system (Pull Requests)
84
+ - The escalation system (Issues)
85
+
86
+ ### The Agent Model
87
+ Agents are **stateless workers**:
88
+ ```
89
+ Broadcast received
90
+ ↓
91
+ Agent spawned
92
+ ↓
93
+ Prompt executed
94
+ ↓
95
+ Result committed to Hansard
96
+ ↓
97
+ Agent disposed
98
+ ```
99
+
100
+ No persistent process. No long-lived sessions. State lives in git, not in the agent.
101
+
102
+ ### The Human Role
103
+ The Speaker (human) is **constitutionally present, not operationally present**:
104
+ - Drops the Writ (creates session repo)
105
+ - Defines Standing Orders (CHARTER.md)
106
+ - Receives Points of Order (SCM Issues + email)
107
+ - Rules on escalations (commits ruling to repo)
108
+ - Prorogues the session (closes Milestone)
109
+
110
+ The Speaker does not babysit the session. The session governs itself.
111
+
112
+ ---
113
+
114
+ ## CANONICAL PRIMITIVE LAYER (CANON)
115
+
116
+ The engine speaks these terms. Protocols translate them to industry vocabulary.
117
+
118
+ ### Roles
119
+ | Canonical | Description |
120
+ |---|---|
121
+ | `AUTHORITY` | Speaker — constitutional ruler. **Always human. Cannot be a machine agent under any Charter configuration.** |
122
+ | `DELEGATE` | Deputy Speaker — pre-delegated proxy for AUTHORITY. Human or machine. |
123
+ | `OPERATOR` | Elevated trust, broad portfolio. Human or machine. |
124
+ | `MEMBER` | Standard trust, scoped verbs. Human or machine. |
125
+ | `OBSERVER` | Read-only, no floor rights. Human or machine. |
126
+
127
+ **Roles describe trust level and mandate — not whether the actor is human or AI.**
128
+
129
+ Any role except AUTHORITY can be assigned to a human or a machine agent. A human expert can join as OPERATOR alongside machine agents. A machine can be promoted through performance. The governance layer is species-agnostic by design.
130
+
131
+ **The one hard constitutional rule:** AUTHORITY is always human. The Speaker cannot be a machine. A Charter that declares a machine as AUTHORITY is invalid and the session will fail Writ Drop validation. This is the architectural safeguard that keeps human governance in the loop regardless of session autonomy level.
132
+
133
+ This design enables the Human Flaw research thesis: the same protocol can be run with human actors and machine actors on identical problems. If OPERATOR meant "machine" by definition, that comparison would be impossible.
134
+
135
+ ### Session Primitives
136
+ | Canonical | Description |
137
+ |---|---|
138
+ | `SESSION` | A Proceeding with no children — the leaf node of the Politik tree. Every node is a Proceeding. SESSION is shorthand for a leaf. |
139
+ | `PROCEEDING` | The full lifecycle of a Politik workflow — from Writ Drop to Prorogation. A proceeding contains one or more sittings separated by suspensions. |
140
+ | `CHARTER` | Standing Orders — sovereign law of the session |
141
+ | `RECORD` | Hansard — append-only attributed log |
142
+ | `MOTION` | Tabled business — a PR |
143
+ | `DIVISION` | Vote — PR review |
144
+ | `ESCALATION` | Point of Order — an Issue |
145
+ | `SUSPENSION` | Session pause — proceeding open, agents stopped, resumable |
146
+ | `QUORUM` | Minimum actors for valid session |
147
+ | `CONFLICT` | Two Motions touch the same lines — mechanical, routine, resolved by any actor holding WRITE. Not a governance failure. |
148
+ | `DEADLOCK` | Irreconcilable state — no valid Division outcome. A governance failure, distinct from CONFLICT. |
149
+
150
+ ### Session States
151
+ These are the valid states a proceeding can be in at any point:
152
+
153
+ | State | Code | Meaning |
154
+ |---|---|---|
155
+ | Convened | `STATE_CONVENED` | Proceeding is actively running — agents are live, motions are being processed |
156
+ | Suspended | `STATE_SUSPENDED` | Proceeding is paused — agents stopped, Hansard open, resumable via `politik resume` |
157
+ | Prorogued | `STATE_PROROGUED` | Proceeding is permanently closed — Hansard sealed, repo archived |
158
+ | Stale | `STATE_STALE` | No Hansard commit in `heartbeat_timeout_hours` — auto-suspension triggered |
159
+ | Invalid | `STATE_INVALID` | Session failed Writ Drop validation — never opened |
160
+
161
+ **Developer plain English:**
162
+ - Convened = running
163
+ - Suspended = paused
164
+ - Prorogued = done, closed permanently
165
+ - Stale = went quiet, auto-paused
166
+
167
+ **Note on vocabulary:** All CANON terms are chosen to be immediately readable by a developer with no political science background. "Prorogued" is the one term that requires a one-line definition on first use — it means permanently closed. All others are self-evident.
168
+
169
+ ### Verbs
170
+ | Canonical | Description |
171
+ |---|---|
172
+ | `READ` | View files, read Hansard |
173
+ | `WRITE` | Commit, table motion |
174
+ | `VOTE` | Division, approve/reject |
175
+ | `ASSENT` | Enact a carried Motion — merge the PR. Distinct from VOTE: the Division decides, the Assent enacts. Invalid unless the Motion carried, the proceeding is CONVENED, and no VETO is outstanding. Defaults to AUTHORITY; grantable by Charter. |
176
+ | `ESCALATE` | File Point of Order |
177
+ | `PROMOTE` | Elevate actor trust level |
178
+ | `DEMOTE` | Reduce actor trust level |
179
+ | `HIRE` | Bring a new actor into a convened proceeding |
180
+ | `FIRE` | Remove an actor — attributed, with stated reason committed to Hansard |
181
+ | `SUSPEND` | Pause proceeding — agents stop, STATE → suspended |
182
+ | `EXPEL` | Remove actor for Standing Orders violation — distinct from FIRE |
183
+ | `VETO` | Domain veto — specific override |
184
+ | `SPAWN` | Call sub-session / committee |
185
+ | `DISSOLVE` | Close proceeding permanently — STATE → prorogued |
186
+ | `EXIT` | Actor leaves the session — voluntary or forced, classified by exit type |
187
+
188
+ ### Power Inversions (first-class primitives)
189
+ Some lower-trust actors hold domain-specific veto power:
190
+ - Safety Officer overrides IC on safety grounds
191
+ - Patient holds treatment veto in healthcare
192
+ - Jury holds final Division in legal protocol
193
+ These are `DOMAIN_VETO` primitives — declared in Charter, not inferred.
194
+
195
+ ---
196
+
197
+ ### Actor Capability Profile — Five Dimensions
198
+
199
+ Every actor in a Politik session carries a capability profile declared at Writ Drop. This profile determines not just what the actor is *allowed* to do (role tier) but what it is *suited* to do. Capability profiles apply to human and machine actors equally — they are species-agnostic.
200
+
201
+ This is the formal model of organisational intelligence: the same variables that determine whether a human team succeeds or fails, now Charter-configurable, Hansard-measurable, and empirically testable for the first time.
202
+
203
+ **Dimension 1 — Role Tier**
204
+
205
+ Trust level, verb access, floor rights. Covered in the Roles section. AUTHORITY → DELEGATE → OPERATOR → MEMBER → OBSERVER.
206
+
207
+ **Dimension 2 — Personality Archetype**
208
+
209
+ How the actor collaborates under pressure and in deliberation:
210
+
211
+ | Archetype | Behaviour | Machine default | Human vice risk |
212
+ |---|---|---|---|
213
+ | `HARDLINER` | Principled, rigid, low compromise | Holds standard without pride | Pride prevents accepting correct challenge |
214
+ | `DIPLOMAT` | Consensus-builder, high compromise | Seeks agreement without cowardice | Cowardice produces bad consensus |
215
+ | `ANALYST` | Data-driven, slow to commit, high accuracy | Thorough without sloth | Sloth produces paralysis |
216
+ | `CREATIVE` | Novel solutions, lateral thinking, unconventional | Innovative without ego | Hubris dismisses simpler correct answers |
217
+ | `LONE_WOLF` | Independent, low deference, self-directed | Executes mandate without tribalism | Tribalism produces factionalism |
218
+ | `TEAM_PLAYER` | Deferential, consensus-seeking, collaborative | Cooperative without conformity | Conformity produces groupthink |
219
+ | `JOKESTER` | Lateral, disruptive, creative under pressure | Introduces novelty without chaos | Sloth deflects serious escalations |
220
+
221
+ Machine actors can be assigned any personality archetype. They carry the profile without the corresponding vice. A machine DIPLOMAT seeks consensus without the cowardice that makes human diplomats capitulate. A machine HARDLINER holds the standard without the pride that makes human hardliners wrong and certain of it.
222
+
223
+ **Dimension 3 — Soft Skills**
224
+
225
+ How the actor reasons, communicates, and operates within the session:
226
+
227
+ | Skill | Description | Measurable in Hansard |
228
+ |---|---|---|
229
+ | `COMMUNICATION` | Clarity and precision of motion reasoning | Escalation rate, Division acceptance rate |
230
+ | `CREATIVITY` | Propensity for novel solutions vs established patterns | Motion novelty score (post-session analysis) |
231
+ | `ANALYTICAL_THINKING` | Depth of reasoning before committing | Time per motion, revision rate |
232
+ | `PERSUASION` | Ability to move Divisions through argument quality | Division win rate vs output quality |
233
+ | `TECHNICAL_ACUMEN` | Strength in implementation and specification | Fault rate on technical motions |
234
+ | `FUNCTIONAL_ACUMEN` | Domain knowledge depth and application | Fault rate on domain-specific motions |
235
+ | `ADAPTABILITY` | Responsiveness to new information mid-session | Revision rate after escalation |
236
+
237
+ **Dimension 4 — Hard Skills**
238
+
239
+ Domain-specific competencies. The actor must be qualified for the work the session requires. Two fields: `required` (must have) and `excluded` (must not default to).
240
+
241
+ ```yaml
242
+ constituency:
243
+ role: OPERATOR
244
+ hard_skills:
245
+ required:
246
+ - BC_AL_development
247
+ - dynamics365
248
+ - AL_Go_pipelines
249
+ excluded:
250
+ - angular_frontend # wrong domain — will produce confident wrong output
251
+ - raw_SQL # out of scope for this session
252
+
253
+ # The excluded field is as important as required.
254
+ # A developer assigned to a PM constituency must be excluded
255
+ # from implementation-first thinking or they will scope by
256
+ # technical complexity rather than business value.
257
+ ```
258
+
259
+ **Hard skill violation handling:**
260
+
261
+ If an actor's Hansard performance reveals a skill mismatch not caught at Writ Drop — producing output in an excluded domain, failing repeatedly on required domain work — the engine flags `FAULT_ACTOR` with subtype `SKILL_MISMATCH`. This triggers:
262
+ - Demotion if Charter allows auto-demotion
263
+ - Escalation to Speaker if `auto_demotion: false`
264
+ - Permanent record in Hansard for future session planning
265
+
266
+ **Dimension 5 — Model / Knowledge Grade**
267
+
268
+ The underlying intelligence — independent of the seat. The "smartness" of the actor regardless of role tier.
269
+
270
+ ```yaml
271
+ constituency:
272
+ role: OPERATOR
273
+ model:
274
+ required: claude-sonnet-5 # minimum model version
275
+ preferred: claude-opus-4-8 # optimal for this work type
276
+ domain_specialisation: BC_AL # fine-tuned variant if available
277
+ knowledge_cutoff_minimum: 2025-01 # must know post-2025 BC releases
278
+ ```
279
+
280
+ Model pinning is per-constituency because different seats have different cognitive demands even within the same session. An OPERATOR doing complex architecture reasoning may require a more capable model than a MEMBER doing routine documentation. The engine validates model compliance at Writ Drop and refuses to spawn a mismatched model regardless of operator assignment.
281
+
282
+ **The empirical research implication:** If session outcomes vary measurably by capability profile composition — and the Hansard and LEDGER provide the data to test this — the result is a complete empirical model of organisational intelligence. Questions now answerable for the first time:
283
+
284
+ - Does complementary personality composition outperform homogeneous composition?
285
+ - Does model pinning to domain-specialist fine-tunes reduce fault rate?
286
+ - What is the optimal personality mix for Parliamentary vs Battle Royale protocols?
287
+ - Can Hansard performance history predict future actor quality better than declared profiles?
288
+ - Does a CREATIVE OPERATOR in an ANALYST-heavy session improve output or introduce noise?
289
+
290
+ Every question is publishable. Every question requires Politik as the instrument.
291
+
292
+ ### Capability Profile and the Vice/Virtue Table — The Interaction
293
+
294
+ Personality archetypes amplified by human vices produce predictable and catastrophic failure modes:
295
+
296
+ | Archetype | Vice | Failure mode | Machine actor behaviour |
297
+ |---|---|---|---|
298
+ | HARDLINER + Pride | Refuses correct challenge | Protocol ossifies | Holds standard, accepts correct challenge |
299
+ | DIPLOMAT + Cowardice | Avoids necessary conflict | Bad decisions pass unchallenged | Seeks consensus, escalates unresolvable conflict |
300
+ | ANALYST + Sloth | Over-analyses, never commits | Session stalls | Commits on schedule, no fatigue |
301
+ | CREATIVE + Hubris | Dismisses simpler correct answers | Complexity for its own sake | Proposes novel solutions, accepts simpler alternatives |
302
+ | LONE_WOLF + Tribalism | Forms personal faction | Session fractures | Executes mandate, no personal allegiance |
303
+ | TEAM_PLAYER + Conformity | Never challenges bad consensus | Groupthink | Cooperates, files escalation on genuine disagreement |
304
+ | JOKESTER + Sloth | Deflects serious escalations | Critical issues missed | Introduces novelty, processes all escalations |
305
+
306
+ The Human Flaw thesis is now complete: it is not just that humans carry vices. It is that personality archetypes — which are genuine human strengths in the right context — become catastrophic failure modes when combined with the wrong vice. The personality is the vector. The vice is the corruption. Machine actors carry the archetype without the vice.
307
+
308
+ ### Human Traits — Three Tiers of Treatment
309
+
310
+ Beyond vices, virtues, and capability profiles, human actors carry additional traits that influence governance outcomes. Politik treats these in three tiers: configurable variables, research questions, and structural eliminations.
311
+
312
+ ---
313
+
314
+ #### Tier 1 — Configurable Charter Parameters (measurable, include now)
315
+
316
+ **ACTOR_STATE — Emotional and Cognitive State**
317
+
318
+ Humans don't perform consistently. Fear, frustration, excitement, ego bruising from a lost Division — all degrade output quality. A human actor on a bad day produces worse work than the same person in peak state. Machine actors have no emotional state. Their output is consistent across any session length.
319
+
320
+ ```yaml
321
+ actor:
322
+ state:
323
+ declared: stable # stable | stressed | degraded
324
+ auto_detect: true # infer from fault rate patterns
325
+ degradation_threshold: # consecutive faults before state downgrades
326
+ faults_in_motions: 3
327
+ window: 5
328
+ ```
329
+
330
+ `ACTOR_STATE` is committed to the Hansard. If an actor's fault rate spikes mid-session, the engine flags `STATE_DEGRADED` — triggering a Speaker notification before a bad Division outcome compounds. For machine actors, `STATE_DEGRADED` may indicate context window saturation or model instability. Both are measurable and both are resolvable.
331
+
332
+ **SESSION_ENDURANCE — Fatigue and Cognitive Load**
333
+
334
+ Human cognitive performance degrades over long sessions. Hour 8 of a sprint is measurably worse than hour 1. Machine actors don't fatigue in the human sense — but very long context windows may degrade LLM output quality as the context saturates. This is an open and publishable research question.
335
+
336
+ ```yaml
337
+ session:
338
+ endurance:
339
+ max_session_hours: 8 # after which quality checks are mandatory
340
+ checkpoint_quality_gate: true # STATE_SNAPSHOT + quality review at N hours
341
+ human_rest_mandate: true # human actors must declare breaks
342
+ ```
343
+
344
+ **MANDATE_ALIGNMENT — Motivation and Incentive**
345
+
346
+ Humans perform differently based on what they are getting out of it. A salaried employee, an equity holder, and someone who hates their job produce different quality outputs under identical protocols. Misaligned mandates are a Constitutional Capture risk — an actor whose personal incentive conflicts with the session goal will subtly optimise for their interest, not the session's.
347
+
348
+ ```yaml
349
+ actor:
350
+ mandate_alignment:
351
+ declared_interest: neutral # neutral | aligned | potentially_conflicted
352
+ conflict_declaration: true # actor must declare conflicts at Writ Drop
353
+ speaker_review_on_conflict: true
354
+ ```
355
+
356
+ Machine actors have one interest: execute the mandate. No personal incentive, no misalignment possible unless the prompt itself encodes conflicting objectives — which is a Charter authoring problem, not an actor problem.
357
+
358
+ ---
359
+
360
+ #### Tier 2 — Research Questions (document, study in experiments)
361
+
362
+ These are not Charter configuration items — they are phenomena Politik can observe and measure across sessions, producing publishable findings.
363
+
364
+ **Cultural Context and Training Bias**
365
+
366
+ A Japanese-trained model and an American-trained model may behave differently under the same Parliamentary Protocol due to cultural norms encoded in their training data around disagreement, hierarchy, and consensus. This is a real and underexplored bias risk. Politik sessions run with models trained on different cultural corpora, under the same protocol, on identical problems — the Hansard records the behavioural differences.
367
+
368
+ Research question: do LLMs trained on different cultural corpora produce measurably different governance behaviours under Constitutional vs Authoritarian protocols?
369
+
370
+ **Session Memory and Prior Interaction Bias**
371
+
372
+ Human actors carry accumulated assumptions and emotional history from prior sessions. A human OPERATOR burned by MEMBER-2 three sprints ago brings that history into the current session. Machine actors start cold. LINEAGE.md provides factual prior session context — not emotional history.
373
+
374
+ Research question: does providing prior session Hansard summaries via LINEAGE.md affect agent behaviour, and does that effect resemble human prior-interaction bias or something different?
375
+
376
+ **Personality Composition Optimisation**
377
+
378
+ Does a session with complementary personality archetypes outperform one with homogeneous profiles? Does a CREATIVE OPERATOR in an ANALYST-heavy session improve output quality or introduce noise? Does a HARDLINER in a DIPLOMAT-majority session produce better outcomes or deadlock?
379
+
380
+ Research question: what personality composition is optimal for each protocol mode — and does the optimal composition predicted by game theory match the empirical LEDGER results?
381
+
382
+ ---
383
+
384
+ #### Tier 3 — Structural Eliminations (absent by design, strengthen experimental validity)
385
+
386
+ These human failure modes do not exist in Politik. They are not variables — they are **controlled-for constants**, eliminated by the headless architecture. Their absence is a feature, not a gap, and it significantly strengthens the experimental design.
387
+
388
+ **Physical Presence and Status Signalling**
389
+
390
+ In a human meeting room, governance outcomes are shaped by who sits at the head of the table, who speaks first, who commands the most physical presence, and who intimidates by hierarchy before a word is spoken. Parliamentary procedure attempted to design around this for centuries — formal speaking orders, yielding the floor, points of order — and never fully solved it.
391
+
392
+ In Politik there is no table head. There is no physical room. Every actor is a text string. Floor rights are determined by Charter, not by physical dominance. Status signalling is structurally absent.
393
+
394
+ **Anchoring Bias and Speaking Order**
395
+
396
+ The first person to speak in a human meeting anchors the room. Every subsequent contribution is evaluated relative to that anchor, not on independent merit. The person who frames the problem first has an asymmetric advantage that persists through the entire discussion regardless of whether their framing was correct.
397
+
398
+ In Politik, motions are tabled as Hansard commits. They are evaluated on content. No actor has an anchoring advantage from speaking order.
399
+
400
+ **Deadline Panic and Time Perception Distortion**
401
+
402
+ Humans experience urgency subjectively. A deadline three days away produces different cognitive states in different people — some accelerate productively, some panic and cut corners, some freeze. The same external deadline produces inconsistent internal responses.
403
+
404
+ In Politik, `deadline` is a Charter parameter. It fires or it doesn't. There is no anxiety, no procrastination, no deadline-driven corner-cutting. The session proceeds at the same cognitive quality on the last motion before the deadline as on the first motion after Writ Drop.
405
+
406
+ **Paper statement on structural eliminations:**
407
+
408
+ *"The instrument controls for status signalling, physical dominance cues, anchoring bias from speaking order, motivational misalignment, and deadline-driven performance degradation by structural design — not by statistical control. These failure modes are eliminated universally across every session. The only variables that remain are protocol selection, actor capability profile, and model capability. This represents a cleaner experimental design than any governance study conducted with human participants."*
409
+
410
+ ---
411
+
412
+ ---
413
+
414
+ ## GOVERNANCE PROTOCOLS
415
+
416
+ Protocols are vocabulary translation manifests. The engine is protocol-agnostic.
417
+
418
+ **Parliamentary is not a privileged mode. It is protocol #1 — the reference implementation.**
419
+ Every industry is equally a protocol. There is no "Parliament mode vs other modes" — Parliamentary is simply the default protocol.
420
+ There is only CANON and protocols on top of it.
421
+
422
+ ### Architecture
423
+ ```
424
+ CANON (engine)
425
+ ↓
426
+ Protocol schema (translation manifest)
427
+ ↓
428
+ User interface (industry vocabulary)
429
+ ```
430
+
431
+ ### Protocol Schema Format
432
+ ```yaml
433
+ protocol:
434
+ name: parliamentary
435
+ version: 1.0.0
436
+ mode: constitutional # constitutional | authoritarian | darwinist | ephemeral | immutable
437
+ record_mode: distributed # distributed | anchored | ephemeral
438
+
439
+ roles:
440
+ AUTHORITY: Speaker
441
+ DELEGATE: Deputy Speaker
442
+ OPERATOR: Minister
443
+ MEMBER: Backbencher
444
+ OBSERVER: Gallery
445
+
446
+ primitives:
447
+ SESSION: Parliament
448
+ CHARTER: Standing Orders
449
+ RECORD: Hansard
450
+ MOTION: Tabled Motion
451
+ DIVISION: Division
452
+ ESCALATION: Point of Order
453
+ SUSPENSION: Prorogation
454
+ QUORUM: Quorum
455
+ EXIT: Resigned from the House
456
+
457
+ domain_veto: [] # list any DOMAIN_VETO roles here
458
+ no_escalation: false # true = Darwinist/Authoritarian — no appeals
459
+ no_record: false # true = Ephemeral mode
460
+ immutable_charter: false # true = Standing Orders cannot be amended mid-session
461
+ ```
462
+
463
+ ---
464
+
465
+ ### Protocol Modes
466
+ | Mode | Description | Example protocols |
467
+ |---|---|---|
468
+ | Constitutional | Checks and balances, escalation paths, human override | Parliamentary, Legal, Corporate, Academic |
469
+ | Authoritarian | Single authority, no Division, escalation routes back to top | Military, Startup, Film, Fascism |
470
+ | Darwinist | No AUTHORITY during session, pure statute, no appeals | Battle Royale, Hackathon, Auction |
471
+ | Ephemeral | No RECORD by design, session evaporates on close | Intelligence, Organized Crime, Whistleblower |
472
+ | Immutable | Standing Orders cannot be amended mid-session | Religion, Emergency Services, Aviation |
473
+
474
+ ---
475
+
476
+
477
+ ## SCM PROVIDER ABSTRACTION
478
+
479
+ GitHub is the reference implementation. The framework speaks to an interface.
480
+
481
+ ```
482
+ SCM Provider Interface
483
+ ├── github ← reference implementation
484
+ ├── gitlab ← community contribution
485
+ ├── gitea ← self-hosted contribution
486
+ ├── forgejo ← open source contribution
487
+ └── bitbucket ← enterprise contribution
488
+ ```
489
+
490
+ ### Interface Methods
491
+ ```typescript
492
+ scm.commit(message, files)
493
+ scm.openPR(title, body, branch)
494
+ scm.requestReview(pr, actors)
495
+ scm.merge(pr, strategy) // strategy: merge_commit | squash | fast_forward
496
+ scm.openIssue(title, body, labels)
497
+ scm.openDiscussion(title, body, category)
498
+ scm.closeMilestone(id)
499
+ scm.notify(actor, message)
500
+ scm.triggerWorkflow(name, inputs)
501
+ scm.createLabel(name, color)
502
+ scm.addCollaborator(handle, permission)
503
+ ```
504
+
505
+ ---
506
+
507
+ ## SESSION REPO STRUCTURE
508
+
509
+ ```
510
+ [session-repo]/
511
+ CHARTER.md ← sovereign law of this session
512
+ HANSARD.md ← append-only session record
513
+ LEDGER.md ← secretarial cost and token ledger (public default)
514
+ STATE.json ← current session state (RECORD agent owns this)
515
+ WRIT.md ← session identity and Writ Drop record
516
+
517
+ roles/
518
+ minister.md ← role capability definition
519
+ backbencher.md
520
+ observer.md
521
+
522
+ actors/
523
+ minister-alpha.md ← who is playing this role
524
+ backbencher-bravo.md
525
+
526
+ motions/
527
+ motion-001.md ← tabled business
528
+ motion-002.md
529
+
530
+ escalations/
531
+ 2026-04-08-001.md ← Point of Order filed
532
+ ruling-001.md ← Speaker ruling
533
+
534
+ sessions/
535
+ 2026-04-08/
536
+ HANSARD.md ← session-specific record
537
+
538
+ .github/
539
+ workflows/
540
+ point-of-order.yml ← Speaker notification
541
+ session-open.yml ← Writ Drop automation
542
+ session-close.yml ← Prorogation automation
543
+ quorum-check.yml ← Validate before proceeding
544
+ CODEOWNERS ← role permission enforcement
545
+
546
+ .politik/
547
+ protocol.yml ← active governance protocol
548
+ defaults.yml ← session defaults
549
+ LEDGER.md ← private ledger (if ledger_visibility: private)
550
+ LINEAGE.md ← (v0.9.x) cross-session decision context
551
+ ```
552
+
553
+ ### File Sovereignty Rules
554
+ ```
555
+ CHARTER.md → Speaker writes, agents read only
556
+ roles/*.md → Speaker defines, agents read only
557
+ actors/*.md → Agents write their own file only
558
+ motions/*.md → OPERATOR+ can create, MEMBER can comment
559
+ escalations/*.md → Any actor can file, Speaker rules
560
+ STATE.json → RECORD agent owns exclusively
561
+ HANSARD.md → Append only, never edited
562
+ LEDGER.md → Clerk role appends after every motion, never edited
563
+ sessions/ → Immutable after session close
564
+ ```
565
+
566
+ ### Hard Containment Rule
567
+ ```
568
+ Agents MAY NEVER traverse above CWD.
569
+
570
+ Reading ../anything = Standing Orders violation
571
+ Logged to Hansard immediately
572
+ Escalated to Speaker automatically
573
+ Session paused pending ruling
574
+ ```
575
+
576
+ ---
577
+
578
+ ## BROADCAST ENVELOPE
579
+
580
+ The self-describing motion packet that travels the transport:
581
+
582
+ ```markdown
583
+ # [SESSION-GUID]
584
+ ## target-actor: OPERATOR
585
+ ## slots-remaining: 3
586
+ ## protocol: parliamentary
587
+ ## prompt: |
588
+ Review the authentication refactor in motion-003
589
+ and file your assessment as a PR review.
590
+ You have READ and VOTE verbs for this motion.
591
+ ```
592
+
593
+ ### Self-Organization Protocol
594
+ 1. Broadcast received by all peers subscribed to the session
595
+ 2. Agent checks: do I match `target-actor`?
596
+ 3. Agent checks: are `slots-remaining` > 0?
597
+ 4. First agent per Constituency declares participation
598
+ 5. Slot claimed atomically via Hansard commit
599
+ 6. Agent spawned, executes prompt, disposes
600
+ 7. Result committed, slot count updated
601
+
602
+ ### First-Actor-Per-Constituency Rule
603
+ On a single machine with multiple agents:
604
+ - Local mutex via lockfile prevents race condition
605
+ - First agent to acquire lock = Constituency broadcaster
606
+ - Subsequent agents on same machine defer to broadcaster
607
+ - Broadcaster bow-out = next agent eligible
608
+
609
+ ---
610
+
611
+ ## CHAMBER TRANSPORT
612
+
613
+ Transport is a **pluggable hook**, not a fixed dependency. The durable substrate is always the session repo — the Hansard is the ordered, attributable source of truth, and slot claims commit there atomically. Transport carries only the *ephemeral real-time nudge* ("a motion is live"); a dropped message loses nothing, since peers fall back to reading the repo.
614
+
615
+ ### Default: git-based transport (zero infrastructure)
616
+ - No broker, nothing new to run — the SCM repository that already **is** the session is also the bus
617
+ - Broadcast and slot-claim ride the same git substrate as the Hansard
618
+ - Latency is the poll/commit cadence — perfectly adequate for governed sessions, which deliberate in minutes, not milliseconds
619
+ - This is the reference transport: it keeps the "git already built it — no new infrastructure" promise intact
620
+ - (Crosstalk is one such git-based transport implementation)
621
+
622
+ ### Opt-in upgrade: NATS (low-latency)
623
+ For latency-sensitive sessions that want real-time nudges instead of poll cadence:
624
+ - Single ~15 MB binary, no dependencies, self-hosted
625
+ - Pub/sub — Session GUID = subject, envelope = message payload
626
+ - **Queue groups deliver each message to exactly one subscriber** — a native primitive for the First-Actor-Per-Constituency rule, with no hand-rolled mutex
627
+ - Optional JetStream adds persistence/replay if wanted
628
+ - The trade is a broker to run. The durable truth still lives in git — NATS only accelerates the nudge.
629
+
630
+ ### Opt-in upgrade, multi-machine: Tailscale + NATS
631
+ - Tailscale handles networking invisibly — stable private addressing, Magic DNS discovery
632
+ - No port forwarding, no VPN config, no firewall rules
633
+ - The NATS node is simply `nats://<host>:4222`, reachable from anywhere on the tailnet
634
+
635
+ ### Rejected: pure P2P mesh (libp2p gossipsub)
636
+ - A DHT / gossip mesh / NAT hole-punching earns its complexity in large, open, permissionless, high-churn swarms — not in small, known, permissioned assemblies
637
+ - "No central broker" is illusory: hole-punch failure falls back to relays, which are brokers
638
+ - Heavy, churning dependency surface — a poor fit for a lean MIT reference implementation
639
+
640
+ ---
641
+
642
+ ## SEE ALSO
643
+
644
+ | File | Contents |
645
+ |---|---|
646
+ | [PROTOCOLS.md](PROTOCOLS.md) | Full protocol library — 35+ protocols across 12 domains |
647
+ | [RUNTIME.md](RUNTIME.md) | Session mechanics, escalation flows, cost model, governance tiers |
648
+ | [RESEARCH.md](RESEARCH.md) | Human Flaw Thesis, Game Theory layer, publication strategy |
649
+ | [EXECUTION.md](EXECUTION.md) | Phases 0–11, Politik Tree hierarchical architecture |
650
+
651
+ ---
652
+
653
+ ## COMMERCIAL IMPLICATIONS
654
+
655
+ ### Open Source Framework (MIT Licence)
656
+
657
+ Politik is open source. The entire framework — CANON primitive layer, protocol library, session engine, Hansard substrate, CLI tooling, and reference implementation — is MIT licensed.
658
+
659
+ ### GitHub Platform Alignment
660
+
661
+ Microsoft owns GitHub, GitHub Actions, Azure, VS Code, Copilot, and Teams. Politik runs natively on every layer of this stack because GitHub IS the session substrate.
662
+
663
+ GitHub Copilot is included in GitHub Enterprise seat licences at flat seat cost — no per-token billing. When Politik runs on GitHub Actions with Copilot as the constituency agent, sessions run at zero marginal inference cost. Other SCM providers (GitLab, Bitbucket) can implement Politik via the SCM provider interface, but require API keys with per-token cost accumulation. The inference economics structurally favour the GitHub platform.
664
+
665
+ ### Jira Replacement Implications
666
+
667
+ Politik produces a superior project record as a zero-overhead side effect of governed sessions. The Hansard captures everything Jira tickets capture — status, assignments, time, commits, reviews, escalations — with perfect attribution and zero human effort. LEDGER replaces story points with exact measured costs. Full analysis in the JIRA REPLACEMENT section above.
668
+
669
+ ### IDE Agent Compatibility
670
+
671
+ IDE-first agents (Cursor, Windsurf, GitHub Copilot Workspace) cannot be spawned as Politik constituencies directly. They are not competitors — the developer using an IDE agent is an OPERATOR in the Politik session. The IDE agent produces the code. Politik governs whether it ships via Division, Hansard record, and LEDGER attribution.
672
+
673
+ ---
674
+
675
+ *Attribution: Steve Krisjanovs, Cordfuse*
676
+ *Status: Architecture locked — reference implementation in progress*