@eir-labs/coltrane 0.7.3 → 0.7.5
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.
- package/agents/lineage-scout-internal.json +4 -7
- package/charts/studio-repass-v0.json +43 -0
- package/dist/src/claude_invoker.js +14 -13
- package/dist/src/claude_invoker.js.map +1 -1
- package/dist/src/cli.d.ts +1 -1
- package/dist/src/runtime.d.ts +56 -0
- package/dist/src/runtime.js +102 -0
- package/dist/src/runtime.js.map +1 -1
- package/dist/src/server.d.ts +1 -0
- package/dist/src/server.js +4 -0
- package/dist/src/server.js.map +1 -1
- package/dist/src/tool_providers.d.ts +12 -0
- package/dist/src/tool_providers.js +15 -11
- package/dist/src/tool_providers.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +3 -3
- package/standards/lineage-deepen-v0.json +27 -0
- package/standards/lineage-pass-v1.json +1 -1
- package/standards/lineage-reweave-v0.json +56 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BrowserGrant } from "./genome_schema.js";
|
|
1
2
|
/** How a granted tool name resolves to something runnable. */
|
|
2
3
|
export interface ToolProvider {
|
|
3
4
|
tool: string;
|
|
@@ -39,6 +40,17 @@ export declare function mcpServerOf(grant: string): string | null;
|
|
|
39
40
|
* config from `mcpServerConfigs` (deployment-registered; coltrane ships its own); everything else —
|
|
40
41
|
* including an MCP grant for an unconfigured server — is `unknown` (a dead name). */
|
|
41
42
|
export declare function resolveToolGrants(allowed: readonly string[], registry: ToolProviderRegistry, mcpServerConfigs?: Readonly<Record<string, unknown>>): ResolvedGrants;
|
|
43
|
+
/** Per-agent grant resolution: fold the deny-by-default browser cage this agent's `browser_grant`
|
|
44
|
+
* builds into the mcp server configs, then resolve every grant. This is the ONE place per-agent
|
|
45
|
+
* resolution happens — shared by the invoker's spawn path (claude_invoker) and runGig's dispatch
|
|
46
|
+
* preflight (runtime) so the two resolve against the IDENTICAL environment. A preflight that
|
|
47
|
+
* resolved against a different environment than the chair actually gets would either refuse a
|
|
48
|
+
* runnable gig or wave a doomed one through — the drift this collapses. Structural agent type so
|
|
49
|
+
* it needs no dependency on the full Agent record. */
|
|
50
|
+
export declare function resolveAgentGrants(agent: {
|
|
51
|
+
allowed_tools?: readonly string[] | undefined;
|
|
52
|
+
browser_grant?: BrowserGrant | undefined;
|
|
53
|
+
}, registry: ToolProviderRegistry, mcpServerConfigs?: Readonly<Record<string, unknown>>): ResolvedGrants;
|
|
42
54
|
/** Fail closed: an agent that grants an unresolvable tool must not be dispatched — a granted tool
|
|
43
55
|
* with no provider is indistinguishable from a real one until the agent tries (and fails) to call
|
|
44
56
|
* it. Raising here at dispatch surfaces it as a clear error instead of a confabulated answer. */
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
// which resolves to one of three provider classes:
|
|
3
|
-
// - host-builtin (Read/Write/Edit/Bash/Glob/Grep/WebFetch/WebSearch/…): provided by the Claude
|
|
4
|
-
// runtime, governed by --allowedTools + code_tool_access. No MCP server needed.
|
|
5
|
-
// - mcp: provided by an MCP server (e.g. a browser server) that must be wired into the spawn's
|
|
6
|
-
// --mcp-config. The OSS engine ships this RESOLUTION machinery; a deployment registers the
|
|
7
|
-
// actual server config (the server itself is deployment-provided).
|
|
8
|
-
// - in_house: a runtime primitive (e.g. output_write) the engine provides directly.
|
|
9
|
-
// A grant that resolves to NONE of these is a DEAD NAME — the prompt lists a tool the spawn can't
|
|
10
|
-
// provide, so the model confabulates. resolveToolGrants surfaces those as `unknown` so dispatch can
|
|
11
|
-
// fail closed instead of launching a spawn that advertises tools it cannot back.
|
|
1
|
+
import { playwrightServerFor } from "./playwright_cage.js";
|
|
12
2
|
// Host-builtin Claude Code tools — provided by the runtime, not an MCP server. Grants are governed
|
|
13
3
|
// by --allowedTools + code_tool_access; they never need a provider entry and are never "unknown".
|
|
14
4
|
const HOST_BUILTINS = new Set([
|
|
@@ -90,6 +80,20 @@ export function resolveToolGrants(allowed, registry, mcpServerConfigs = {}) {
|
|
|
90
80
|
}
|
|
91
81
|
return { mcpServers, inHouse, unknown, effectiveAllowed };
|
|
92
82
|
}
|
|
83
|
+
/** Per-agent grant resolution: fold the deny-by-default browser cage this agent's `browser_grant`
|
|
84
|
+
* builds into the mcp server configs, then resolve every grant. This is the ONE place per-agent
|
|
85
|
+
* resolution happens — shared by the invoker's spawn path (claude_invoker) and runGig's dispatch
|
|
86
|
+
* preflight (runtime) so the two resolve against the IDENTICAL environment. A preflight that
|
|
87
|
+
* resolved against a different environment than the chair actually gets would either refuse a
|
|
88
|
+
* runnable gig or wave a doomed one through — the drift this collapses. Structural agent type so
|
|
89
|
+
* it needs no dependency on the full Agent record. */
|
|
90
|
+
export function resolveAgentGrants(agent, registry, mcpServerConfigs = {}) {
|
|
91
|
+
const browserCage = playwrightServerFor(agent.browser_grant);
|
|
92
|
+
const effectiveConfigs = browserCage
|
|
93
|
+
? { ...mcpServerConfigs, playwright: browserCage }
|
|
94
|
+
: mcpServerConfigs;
|
|
95
|
+
return resolveToolGrants(agent.allowed_tools ?? [], registry, effectiveConfigs);
|
|
96
|
+
}
|
|
93
97
|
/** Fail closed: an agent that grants an unresolvable tool must not be dispatched — a granted tool
|
|
94
98
|
* with no provider is indistinguishable from a real one until the agent tries (and fails) to call
|
|
95
99
|
* it. Raising here at dispatch surfaces it as a clear error instead of a confabulated answer. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool_providers.js","sourceRoot":"","sources":["../../src/tool_providers.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"tool_providers.js","sourceRoot":"","sources":["../../src/tool_providers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AA6B3D,mGAAmG;AACnG,kGAAkG;AAClG,MAAM,aAAa,GAAwB,IAAI,GAAG,CAAC;IACjD,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAA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,CAAC,6BAA6B;YAC3G,2FAA2F,CAC9F,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Engine semver. Keep in lockstep with package.json `version` (enforced by test). */
|
|
2
|
-
export declare const COLTRANE_VERSION = "0.7.
|
|
2
|
+
export declare const COLTRANE_VERSION = "0.7.5";
|
|
3
3
|
/**
|
|
4
4
|
* The commit this engine checkout is sitting on, or null when it can't be determined.
|
|
5
5
|
*
|
package/dist/src/version.js
CHANGED
|
@@ -17,7 +17,7 @@ import { existsSync, readFileSync, statSync } from "node:fs";
|
|
|
17
17
|
import { dirname, join, resolve } from "node:path";
|
|
18
18
|
import { fileURLToPath } from "node:url";
|
|
19
19
|
/** Engine semver. Keep in lockstep with package.json `version` (enforced by test). */
|
|
20
|
-
export const COLTRANE_VERSION = "0.7.
|
|
20
|
+
export const COLTRANE_VERSION = "0.7.5";
|
|
21
21
|
/**
|
|
22
22
|
* The commit this engine checkout is sitting on, or null when it can't be determined.
|
|
23
23
|
*
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eir-labs/coltrane",
|
|
3
|
-
"version": "0.7.
|
|
4
|
-
"description": "A methodology engine
|
|
3
|
+
"version": "0.7.5",
|
|
4
|
+
"description": "A methodology engine — 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",
|
|
7
7
|
"author": "Eir",
|
|
@@ -99,4 +99,4 @@
|
|
|
99
99
|
"typescript": "^5.6.0",
|
|
100
100
|
"vitest": "^3.0.0"
|
|
101
101
|
}
|
|
102
|
-
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "lineage-deepen-v0",
|
|
3
|
+
"domain": "lineage",
|
|
4
|
+
"status": "active",
|
|
5
|
+
"description": "A LINEAGE DEEPEN re-runs only the thin external seat of a lineage pass, with a sharper question. When a completed pass leaves a gap on the external side — a source it did not reach, a precedent read too shallowly — this standard re-performs just the outward sense: the external scout sweeps the body of prior work again under a re-pointed lineage-question and seals fresh lineage-hits. It touches neither the internal inventory nor the drawn lineage; those are reused as-is by the re-weave. One phase, one chair, least authority — the smallest re-run that sharpens the external reading of a pass without paying to redo the whole thing.",
|
|
6
|
+
"agent_slugs": [
|
|
7
|
+
"lineage-scout-external"
|
|
8
|
+
],
|
|
9
|
+
"phases": [
|
|
10
|
+
{
|
|
11
|
+
"name": "identify",
|
|
12
|
+
"chairs": [
|
|
13
|
+
{
|
|
14
|
+
"role": "identify-external",
|
|
15
|
+
"agent_slug": "lineage-scout-external",
|
|
16
|
+
"depends_on": [],
|
|
17
|
+
"input_contract": ["lineage-question"],
|
|
18
|
+
"output_contract": ["lineage-hit"],
|
|
19
|
+
"required_skills": []
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"intent": "Re-run the outward sense alone. identify-external takes the sharpened lineage-question and sweeps the external body of prior work with web tools, verifying each source live and sealing grounded lineage-hits — the deepened external reading. It holds no internal grant and draws no connection: it produces hits the re-weave can be held to, nothing more."
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"input_types": ["lineage-question"],
|
|
26
|
+
"output_types": ["lineage-hit"]
|
|
27
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "lineage-reweave-v0",
|
|
3
|
+
"domain": "lineage",
|
|
4
|
+
"status": "active",
|
|
5
|
+
"description": "A LINEAGE REWEAVE re-draws the synthesis of a lineage pass from REUSED and NEW seeds, without re-running the scouts. Its entry chair takes the two senses from outside itself — the unchanged internal-inventory the original pass already sealed, and the external lineage-hits (the pass's original plus any a deepen re-run sharpened) — and draws the connection again: a lineage-map of grounded edges, each saying our X descends-from / aligns-with / diverges-from / supersedes / informed-by their Y. It then judges the gap against the re-drawn lineage and plans the alignment, and composes the formal lineage-record. The associate chair is an ENTRY chair (depends_on []): the senses are seeded by the arrangement's edges, so no seat here re-senses anything — the reweave reasons over what was retrieved before, exactly the cost a re-pass is meant to save.",
|
|
6
|
+
"agent_slugs": [
|
|
7
|
+
"lineage-weaver",
|
|
8
|
+
"lineage-scribe"
|
|
9
|
+
],
|
|
10
|
+
"phases": [
|
|
11
|
+
{
|
|
12
|
+
"name": "associate",
|
|
13
|
+
"chairs": [
|
|
14
|
+
{
|
|
15
|
+
"role": "associate",
|
|
16
|
+
"agent_slug": "lineage-weaver",
|
|
17
|
+
"depends_on": [],
|
|
18
|
+
"input_contract": ["lineage-hit", "internal-inventory"],
|
|
19
|
+
"output_contract": ["lineage-map"],
|
|
20
|
+
"required_skills": []
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"intent": "The core act, re-performed. Reason over the seeded senses — the reused internal-inventory and both the original and the deepened lineage-hits — and DRAW THE CONNECTION: for each defensible pairing, an edge naming the relation, grounded on BOTH sides, dropping any edge that cannot be grounded both ways. No tools: this seat connects only what the senses already retrieved. The lineage-map it seals is the re-drawn lineage."
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "assess",
|
|
27
|
+
"chairs": [
|
|
28
|
+
{
|
|
29
|
+
"role": "assess",
|
|
30
|
+
"agent_slug": "lineage-weaver",
|
|
31
|
+
"depends_on": ["associate"],
|
|
32
|
+
"input_contract": ["lineage-map"],
|
|
33
|
+
"output_contract": ["alignment-plan"],
|
|
34
|
+
"required_skills": []
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"intent": "Judge the gap and plan the alignment off the re-drawn lineage. Where our internal state has no edge to a source the sharpened prior work establishes, or a source supersedes what we hold, name the gap plainly; then sequence the actions that would close it — cite, adopt, diverge deliberately, or supersede — sealed with the gap summary as an alignment-plan."
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "compose",
|
|
41
|
+
"chairs": [
|
|
42
|
+
{
|
|
43
|
+
"role": "compose",
|
|
44
|
+
"agent_slug": "lineage-scribe",
|
|
45
|
+
"depends_on": ["associate", "assess"],
|
|
46
|
+
"input_contract": ["lineage-map", "alignment-plan"],
|
|
47
|
+
"output_contract": ["lineage-record"],
|
|
48
|
+
"required_skills": []
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"intent": "Compose the re-woven lineage-record: the identified external body, the reused internal inventory, the re-drawn connections, the gap, and the alignment recommendation — carrying each connection's both-side grounding through so the artifact is checkable citation by citation. Create only from upstream; introduce no new source."
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"input_types": ["lineage-hit", "internal-inventory"],
|
|
55
|
+
"output_types": ["lineage-record"]
|
|
56
|
+
}
|