@eir-labs/coltrane 0.24.30 → 0.24.32

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 (87) hide show
  1. package/agents/change-verifier.json +4 -2
  2. package/agents/deploy-scout.json +2 -2
  3. package/agents/red-law-reviewer.json +54 -0
  4. package/agents/red-spec-attester.json +53 -0
  5. package/agents/red-spec-builder.json +56 -0
  6. package/agents/red-spec-drafter.json +1 -1
  7. package/agents/spec-reviewer.json +1 -1
  8. package/dist/src/chart.js +4 -0
  9. package/dist/src/chart.js.map +1 -1
  10. package/dist/src/chat_completions_port.d.ts +41 -0
  11. package/dist/src/chat_completions_port.js +221 -0
  12. package/dist/src/chat_completions_port.js.map +1 -0
  13. package/dist/src/claude_invoker.d.ts +18 -0
  14. package/dist/src/claude_invoker.js +771 -22
  15. package/dist/src/claude_invoker.js.map +1 -1
  16. package/dist/src/cli.d.ts +1 -1
  17. package/dist/src/cli.js +49 -8
  18. package/dist/src/cli.js.map +1 -1
  19. package/dist/src/completions_invoker.d.ts +79 -0
  20. package/dist/src/completions_invoker.js +220 -0
  21. package/dist/src/completions_invoker.js.map +1 -0
  22. package/dist/src/composition.d.ts +13 -0
  23. package/dist/src/composition.js +16 -0
  24. package/dist/src/composition.js.map +1 -1
  25. package/dist/src/genome_schema.d.ts +200 -0
  26. package/dist/src/genome_schema.js +37 -0
  27. package/dist/src/genome_schema.js.map +1 -1
  28. package/dist/src/genome_store.d.ts +30 -2
  29. package/dist/src/genome_store.js +51 -8
  30. package/dist/src/genome_store.js.map +1 -1
  31. package/dist/src/index.d.ts +5 -0
  32. package/dist/src/index.js +9 -0
  33. package/dist/src/index.js.map +1 -1
  34. package/dist/src/invoker_selection.d.ts +58 -0
  35. package/dist/src/invoker_selection.js +110 -0
  36. package/dist/src/invoker_selection.js.map +1 -0
  37. package/dist/src/ledger.d.ts +45 -2
  38. package/dist/src/ledger.js +23 -3
  39. package/dist/src/ledger.js.map +1 -1
  40. package/dist/src/mcp.js +2 -2
  41. package/dist/src/mcp.js.map +1 -1
  42. package/dist/src/outputs.d.ts +24 -0
  43. package/dist/src/outputs.js +1 -0
  44. package/dist/src/outputs.js.map +1 -1
  45. package/dist/src/registry.js +16 -0
  46. package/dist/src/registry.js.map +1 -1
  47. package/dist/src/repo_index.d.ts +13 -0
  48. package/dist/src/repo_index.js +90 -10
  49. package/dist/src/repo_index.js.map +1 -1
  50. package/dist/src/reside_backing.d.ts +3 -2
  51. package/dist/src/reside_backing.js +8 -2
  52. package/dist/src/reside_backing.js.map +1 -1
  53. package/dist/src/reuse.d.ts +8 -0
  54. package/dist/src/reuse.js.map +1 -1
  55. package/dist/src/run_deps.d.ts +10 -10
  56. package/dist/src/run_deps.js +25 -15
  57. package/dist/src/run_deps.js.map +1 -1
  58. package/dist/src/runtime.d.ts +205 -109
  59. package/dist/src/runtime.js +908 -145
  60. package/dist/src/runtime.js.map +1 -1
  61. package/dist/src/server.js +148 -45
  62. package/dist/src/server.js.map +1 -1
  63. package/dist/src/server_relay.js +28 -0
  64. package/dist/src/server_relay.js.map +1 -1
  65. package/dist/src/skill_runner.mjs +9 -2
  66. package/dist/src/skill_subprocess.d.ts +20 -1
  67. package/dist/src/skill_subprocess.js +11 -4
  68. package/dist/src/skill_subprocess.js.map +1 -1
  69. package/dist/src/transcript_store.d.ts +14 -0
  70. package/dist/src/transcript_store.js +39 -0
  71. package/dist/src/transcript_store.js.map +1 -0
  72. package/dist/src/turn_loop.d.ts +173 -0
  73. package/dist/src/turn_loop.js +283 -0
  74. package/dist/src/turn_loop.js.map +1 -0
  75. package/dist/src/version.d.ts +1 -1
  76. package/dist/src/version.js +1 -1
  77. package/dist/src/worker.js +6 -0
  78. package/dist/src/worker.js.map +1 -1
  79. package/dist/src/worker_env.d.ts +4 -2
  80. package/dist/src/worker_env.js +42 -0
  81. package/dist/src/worker_env.js.map +1 -1
  82. package/domain_types/change-set.json +33 -22
  83. package/domain_types/red-spec.json +32 -23
  84. package/domain_types/seat-primer.json +65 -0
  85. package/package.json +1 -1
  86. package/standards/build-from-red-spec-v0.json +93 -0
  87. package/standards/draft-red-laws-v0.json +68 -0
@@ -1,32 +1,12 @@
1
1
  {
2
2
  "slug": "change-set",
3
- "version": 1,
3
+ "version": 3,
4
4
  "extends": "Artifact",
5
5
  "domain": "software-change",
6
6
  "status": "active",
7
- "description": "The change itself, carried as content rather than applied — the seat that produces it holds a read-only grant, so the artefact is reviewable before anything mutates. departures is separate from rationale on purpose: a change that diverged from its plan and amended the record is honest, and a change that diverged silently is not distinguishable from one that did not.",
8
7
  "schema": {
9
8
  "type": "object",
10
9
  "properties": {
11
- "diffs": {
12
- "type": "array",
13
- "description": "Per-path patch content, in unified-diff form.",
14
- "items": {
15
- "type": "object",
16
- "properties": {
17
- "path": {
18
- "type": "string"
19
- },
20
- "patch": {
21
- "type": "string"
22
- }
23
- },
24
- "required": [
25
- "path",
26
- "patch"
27
- ]
28
- }
29
- },
30
10
  "tests_added": {
31
11
  "type": "array",
32
12
  "items": {
@@ -63,13 +43,44 @@
63
43
  "why"
64
44
  ]
65
45
  }
46
+ },
47
+ "changes": {
48
+ "type": "array",
49
+ "description": "The changed files, BY ADDRESS (contract-records-by-address-v1). A seat supplies {path, base}: the file and the commit its change is measured from. The ENGINE stamps, at seal, from RunDeps.tree_root: blob_sha (git hash-object of the file, or the literal \"deleted\"), patch_sha256 (sha256 of `git diff <base> -- <path>`) and bytes (that diff's length). A consumer reads the change with `git diff <base> -- <path>` and checks it against patch_sha256. No patch body is ever model output.",
50
+ "items": {
51
+ "type": "object",
52
+ "properties": {
53
+ "path": {
54
+ "type": "string"
55
+ },
56
+ "base": {
57
+ "type": "string"
58
+ },
59
+ "blob_sha": {
60
+ "type": "string",
61
+ "description": "engine-stamped at seal"
62
+ },
63
+ "patch_sha256": {
64
+ "type": "string",
65
+ "description": "engine-stamped at seal"
66
+ },
67
+ "bytes": {
68
+ "type": "number",
69
+ "description": "engine-stamped at seal"
70
+ }
71
+ },
72
+ "required": [
73
+ "path",
74
+ "base"
75
+ ]
76
+ }
66
77
  }
67
78
  }
68
79
  },
69
80
  "required_fields": [
70
81
  "validation_criteria",
71
82
  "input_refs",
72
- "diffs",
83
+ "changes",
73
84
  "rationale"
74
85
  ]
75
86
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "slug": "red-spec",
3
- "version": 2,
3
+ "version": 4,
4
4
  "extends": "Artifact",
5
5
  "domain": "spec-drafting",
6
6
  "status": "active",
@@ -11,27 +11,6 @@
11
11
  "type": "string",
12
12
  "description": "The written spec (path added by the diffs)."
13
13
  },
14
- "diffs": {
15
- "type": "array",
16
- "description": "Per-path unified diffs: the RED test files (real assertions, failing because unimplemented) and the spec doc.",
17
- "items": {
18
- "type": "object",
19
- "properties": {
20
- "path": {
21
- "type": "string"
22
- },
23
- "patch": {
24
- "type": "string",
25
- "description": "The unified diff itself, not a description of it. The spec-drafting review chair reads test bodies OUT OF THIS FIELD ('read each red test in the diffs'), so this is the evidence the gate adjudicates, not documentation of the change. Observed on gig 34ff466b: every patch sealed as a one-line summary ('full unified diff captured from git diff --cached ... content present verbatim in the working tree at this path') — true, and useless as evidence. The reviewer refused, correctly, marking NON-TAUTOLOGY and REDNESS 'NOT RUN'. The gate was not failed, it was STARVED, and the seal accepted that silently because the type asked only for a string.",
26
- "pattern": "(^|\\n)[+-]"
27
- }
28
- },
29
- "required": [
30
- "path",
31
- "patch"
32
- ]
33
- }
34
- },
35
14
  "coverage_map": {
36
15
  "type": "array",
37
16
  "description": "EVERY subsystem-contract invariant mapped to the red test that verifies it: each {invariant_id, test_name, test_file}.",
@@ -65,13 +44,43 @@
65
44
  "items": {
66
45
  "type": "string"
67
46
  }
47
+ },
48
+ "laws": {
49
+ "type": "array",
50
+ "description": "The RED laws, BY ADDRESS (contract-records-by-address-v1). A seat supplies {path, commit}: where the committed law file is. The ENGINE stamps, at seal, from RunDeps.tree_root: blob_sha (git rev-parse <commit>:<path>) and tests (the it/test titles in that blob, in file order). A reviewing seat reads the exact law with `git show <commit>:<path>` and checks it against blob_sha. No patch body is ever model output: gig c1771b13's attester hit the 32,000 output-token cap three times re-typing ~150KB of patches into the retired `diffs` field.",
51
+ "items": {
52
+ "type": "object",
53
+ "properties": {
54
+ "path": {
55
+ "type": "string"
56
+ },
57
+ "commit": {
58
+ "type": "string"
59
+ },
60
+ "blob_sha": {
61
+ "type": "string",
62
+ "description": "engine-stamped at seal; a seat-supplied value that disagrees with git is refused (law_bytes_mismatch)"
63
+ },
64
+ "tests": {
65
+ "type": "array",
66
+ "items": {
67
+ "type": "string"
68
+ },
69
+ "description": "engine-stamped at seal: the it/test titles in the blob, in file order"
70
+ }
71
+ },
72
+ "required": [
73
+ "path",
74
+ "commit"
75
+ ]
76
+ }
68
77
  }
69
78
  }
70
79
  },
71
80
  "required_fields": [
72
81
  "validation_criteria",
73
82
  "input_refs",
74
- "diffs",
83
+ "laws",
75
84
  "coverage_map",
76
85
  "testing_method"
77
86
  ]
@@ -0,0 +1,65 @@
1
+ {
2
+ "slug": "seat-primer",
3
+ "version": 2,
4
+ "extends": "Signal",
5
+ "domain": "engine",
6
+ "status": "active",
7
+ "schema": {
8
+ "type": "object",
9
+ "properties": {
10
+ "agent_slug": {
11
+ "type": "string",
12
+ "description": "the agent whose seat read the area; a primer is forked only by chairs of this agent"
13
+ },
14
+ "area": {
15
+ "type": "string",
16
+ "description": "lowercase-hyphen area slug the primer covers"
17
+ },
18
+ "session_id": {
19
+ "type": "string",
20
+ "description": "the priming chair's (gig_id, role) session uuid; a fork resumes it with --fork-session"
21
+ },
22
+ "commit": {
23
+ "type": "string",
24
+ "description": "HEAD at seal"
25
+ },
26
+ "files": {
27
+ "type": "array",
28
+ "description": "every file the seat read (and, for a rolling primer, the forked primer's files), each with its git blob at seal; a changed blob is named to the fork as stale",
29
+ "items": {
30
+ "type": "object",
31
+ "properties": {
32
+ "path": {
33
+ "type": "string"
34
+ },
35
+ "blob_sha": {
36
+ "type": "string"
37
+ }
38
+ },
39
+ "required": [
40
+ "path",
41
+ "blob_sha"
42
+ ]
43
+ }
44
+ },
45
+ "context_tokens": {
46
+ "type": "number",
47
+ "description": "input + cache_read + cache_creation of the seat's last usage before sealing; compared with fork_from.max_context_tokens"
48
+ },
49
+ "source": {
50
+ "type": "string"
51
+ },
52
+ "frontier": {
53
+ "type": "string",
54
+ "description": "uuid of the last user line before the seat's first write-tool call (Write, Edit, MultiEdit, NotebookEdit); a fork resumes the primer's session cut there with --resume-session-at, so it loads what the seat read and never what it then did. Absent when the seat wrote nothing or no user line preceded its first write: the fork then resumes the whole session."
55
+ }
56
+ }
57
+ },
58
+ "required_fields": [
59
+ "agent_slug",
60
+ "area",
61
+ "session_id",
62
+ "commit",
63
+ "files"
64
+ ]
65
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eir-labs/coltrane",
3
- "version": "0.24.30",
3
+ "version": "0.24.32",
4
4
  "description": "A methodology engine \u2014 a typed substrate for defining agents, composing multi-phase standards, dispatching gigs, and sealing every output to a content-addressed ledger. Ships as an MCP server.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -0,0 +1,93 @@
1
+ {
2
+ "slug": "build-from-red-spec-v0",
3
+ "domain": "software-change",
4
+ "agent_slugs": [
5
+ "red-spec-attester",
6
+ "red-spec-builder",
7
+ "change-verifier"
8
+ ],
9
+ "phases": [
10
+ {
11
+ "name": "attest-laws",
12
+ "chairs": [
13
+ {
14
+ "role": "attest-laws",
15
+ "agent_slug": "red-spec-attester",
16
+ "depends_on": [],
17
+ "input_contract": [
18
+ "change-request"
19
+ ],
20
+ "output_contract": [
21
+ "red-spec"
22
+ ],
23
+ "required_skills": [],
24
+ "turn_reserve": 8
25
+ }
26
+ ]
27
+ },
28
+ {
29
+ "name": "build",
30
+ "chairs": [
31
+ {
32
+ "role": "build-change",
33
+ "agent_slug": "red-spec-builder",
34
+ "depends_on": [
35
+ "attest-laws"
36
+ ],
37
+ "input_contract": [
38
+ "change-plan",
39
+ "red-spec"
40
+ ],
41
+ "output_contract": [
42
+ "change-set"
43
+ ],
44
+ "required_skills": [],
45
+ "turn_reserve": 16,
46
+ "prime": {
47
+ "area": "coltrane-engine"
48
+ },
49
+ "fork_from": {
50
+ "primer": "coltrane-engine",
51
+ "max_context_tokens": 150000
52
+ }
53
+ }
54
+ ]
55
+ },
56
+ {
57
+ "name": "verify",
58
+ "chairs": [
59
+ {
60
+ "role": "verify-change",
61
+ "agent_slug": "change-verifier",
62
+ "depends_on": [
63
+ "attest-laws",
64
+ "build-change"
65
+ ],
66
+ "input_contract": [
67
+ "change-plan",
68
+ "change-set",
69
+ "red-spec"
70
+ ],
71
+ "output_contract": [
72
+ "change-verdict"
73
+ ],
74
+ "required_skills": [],
75
+ "turn_reserve": 10
76
+ }
77
+ ]
78
+ }
79
+ ],
80
+ "status": "draft",
81
+ "input_types": [
82
+ "change-request",
83
+ "change-plan"
84
+ ],
85
+ "output_types": [
86
+ "red-spec",
87
+ "change-set",
88
+ "change-verdict"
89
+ ],
90
+ "max_examine_rounds": 3,
91
+ "description": "Build a change against RED laws that are ALREADY committed, reviewed and sequenced, and loop until the verify seat's run says green or the rounds are spent. The entry types are the change-request, which names the commit holding the laws, and a change-plan (typically sealed by spec-review-and-sequence-v0). It is for the case software-change-pr-v1 cannot take: that loop always re-drafts laws, and its builder cannot run them. Attest: a read-only seat seals the committed laws from git, never from the working tree, so every amend round re-seals the same text. Build: a seat writes src/** and docs/**, runs the laws and tsc as it goes, and holds no tests/** grant. Verify: change-verifier runs the checks and compares every sealed law against the tree, so a weakened law fails the verdict. A failing verdict re-runs the builder with the verdict fed back, up to max_examine_rounds. It does not publish: the operator reviews the working tree and commits. An amend round re-runs only the builder: the attester's record from the failing round stays its input (contract-amend-nearest-makers-v1). Known limit: `tests/**` is excluded from the builder by allow scoping, not by explicit denial, so the verifier's weakened-law check is the enforcing backstop.",
92
+ "reserve_pool": 40
93
+ }
@@ -0,0 +1,68 @@
1
+ {
2
+ "slug": "draft-red-laws-v0",
3
+ "domain": "spec-drafting",
4
+ "agent_slugs": [
5
+ "red-spec-drafter",
6
+ "red-law-reviewer"
7
+ ],
8
+ "phases": [
9
+ {
10
+ "name": "draft-laws",
11
+ "chairs": [
12
+ {
13
+ "role": "draft-laws",
14
+ "agent_slug": "red-spec-drafter",
15
+ "depends_on": [],
16
+ "input_contract": [
17
+ "subsystem-contract"
18
+ ],
19
+ "output_contract": [
20
+ "red-spec"
21
+ ],
22
+ "required_skills": [],
23
+ "turn_reserve": 16,
24
+ "prime": {
25
+ "area": "coltrane-engine"
26
+ },
27
+ "fork_from": {
28
+ "primer": "coltrane-engine",
29
+ "max_context_tokens": 150000
30
+ }
31
+ }
32
+ ]
33
+ },
34
+ {
35
+ "name": "review-laws",
36
+ "chairs": [
37
+ {
38
+ "role": "review-laws",
39
+ "agent_slug": "red-law-reviewer",
40
+ "depends_on": [
41
+ "draft-laws"
42
+ ],
43
+ "input_contract": [
44
+ "subsystem-contract",
45
+ "red-spec"
46
+ ],
47
+ "output_contract": [
48
+ "change-verdict"
49
+ ],
50
+ "required_skills": [],
51
+ "turn_reserve": 8
52
+ }
53
+ ]
54
+ }
55
+ ],
56
+ "status": "draft",
57
+ "input_types": [
58
+ "subsystem-contract",
59
+ "change-request"
60
+ ],
61
+ "output_types": [
62
+ "red-spec",
63
+ "change-verdict"
64
+ ],
65
+ "max_examine_rounds": 2,
66
+ "description": "Draft RED laws for a contract the operator has ALREADY decided, and have them reviewed by a seat that runs them, without publishing anything. The entry types are a subsystem-contract (obligations, invariants with how each is checkable, failure modes) and a change-request naming the existing law files the contract supersedes. Draft: red-spec-drafter writes a real test for every invariant and failure mode into tests/** and the argued half into docs/specs/**, rewrites the superseded laws, runs them, watches them fail, and seals a red-spec from `git diff --cached`. Review: red-law-reviewer RUNS every law and reads every file. It fails the verdict on an uncovered item, a skipped path the request asked for, a patch that does not match the staged tree, a law that is not observed red for the contract's reason, a test that could never fail, or a removed out-of-concern law. A failing review goes back to the drafter, up to max_examine_rounds. It does not publish: the operator commits the laws and adjusts the pinned law counts, then builds them with build-from-red-spec-v0. v0 first seated spec-reviewer, which holds no tools and so could never observe redness (gig 6ed46423); this composition replaces it.",
67
+ "reserve_pool": 30
68
+ }