onto-mcp 0.4.12 → 0.4.13
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/.onto/authority/core-lexicon.yaml +1 -1
- package/.onto/authority/supported-models.yaml +137 -0
- package/.onto/domains/accounting-kr/competency_qs.md +153 -153
- package/.onto/processes/reconstruct/obligation-coverage-ledger.yaml +842 -0
- package/.onto/processes/reconstruct/obligation-coverage-recorded.yaml +225 -0
- package/.onto/processes/reconstruct/ontology-seeding-and-maturation-design.md +93 -54
- package/.onto/processes/reconstruct/reconstruct-contract-registry.yaml +169 -8
- package/.onto/processes/reconstruct/reconstruct-execution-ux-contract.md +72 -1
- package/.onto/processes/reconstruct/source-profiles/spreadsheet.md +35 -0
- package/.onto/processes/review/productized-live-path.md +9 -5
- package/.onto/processes/review/prompt-execution-runner-contract.md +32 -8
- package/.onto/processes/review/review-target-profile-contract.md +47 -4
- package/.onto/processes/shared/pipeline-execution-ledger-contract.md +11 -0
- package/.onto/processes/shared/target-material-kind-contract.md +1 -1
- package/README.md +64 -1
- package/dist/cli.js +11 -1
- package/dist/core-api/reconstruct-api.js +575 -24
- package/dist/core-api/review-api.js +70 -5
- package/dist/core-api/review-progress.js +7 -0
- package/dist/core-api/runtime-observation.js +7 -0
- package/dist/core-runtime/artifact-io.js +75 -3
- package/dist/core-runtime/cli/claude-code-review-unit-executor.js +19 -8
- package/dist/core-runtime/cli/materialize-review-prompt-packets.js +68 -14
- package/dist/core-runtime/cli/prepare-review-session.js +34 -1
- package/dist/core-runtime/cli/render-review-final-output.js +2 -1
- package/dist/core-runtime/cli/run-review-prompt-execution.js +758 -48
- package/dist/core-runtime/cli/run-seats.js +18 -0
- package/dist/core-runtime/cli/runtime-submit-context.js +10 -2
- package/dist/core-runtime/cli/unit-resubmit.js +269 -0
- package/dist/core-runtime/cli/worker-structured-output.js +80 -2
- package/dist/core-runtime/discovery/host-detection.js +71 -22
- package/dist/core-runtime/discovery/review-cert-assemble.js +208 -0
- package/dist/core-runtime/discovery/review-cert-record.js +442 -0
- package/dist/core-runtime/discovery/review-execution-units.js +22 -0
- package/dist/core-runtime/discovery/seat-inventory.js +167 -0
- package/dist/core-runtime/discovery/settings-chain.js +311 -52
- package/dist/core-runtime/discovery/supported-models.js +282 -29
- package/dist/core-runtime/discovery/synthesize-cert-assemble.js +197 -0
- package/dist/core-runtime/discovery/synthesize-cert-capsule.js +399 -0
- package/dist/core-runtime/discovery/synthesize-cert-judge.js +340 -0
- package/dist/core-runtime/discovery/synthesize-cert-loop.js +234 -0
- package/dist/core-runtime/discovery/synthesize-cert-mutation.js +117 -0
- package/dist/core-runtime/discovery/synthesize-cert-packet.js +182 -0
- package/dist/core-runtime/discovery/synthesize-cert-record.js +831 -0
- package/dist/core-runtime/discovery/synthesize-cert-sampler.js +336 -0
- package/dist/core-runtime/effort-calibration-ingest.js +135 -0
- package/dist/core-runtime/llm/dispatch-breaker.js +412 -0
- package/dist/core-runtime/llm/dispatch-fallback-adapter-capabilities.js +33 -0
- package/dist/core-runtime/llm/llm-caller.js +188 -47
- package/dist/core-runtime/llm/mock-llm-realization.js +35 -4
- package/dist/core-runtime/llm/model-switcher.js +1 -1
- package/dist/core-runtime/llm/openai-responses-incomplete-error.js +46 -0
- package/dist/core-runtime/llm/sealed-dispatch-capability.js +359 -0
- package/dist/core-runtime/llm/structured-dispatch-error.js +15 -0
- package/dist/core-runtime/onboard/claude-profile-scan.js +65 -0
- package/dist/core-runtime/onboard/cli-host.js +5 -2
- package/dist/core-runtime/onboard/configure-provider.js +33 -1
- package/dist/core-runtime/onboard/host-target.js +28 -3
- package/dist/core-runtime/onboard/register.js +54 -12
- package/dist/core-runtime/pipeline-execution-ledger.js +10 -0
- package/dist/core-runtime/reconstruct/artifact-types.js +35 -0
- package/dist/core-runtime/reconstruct/claim-projection-validation.js +17 -0
- package/dist/core-runtime/reconstruct/competency-projection-contract.js +63 -0
- package/dist/core-runtime/reconstruct/comprehension-artifact.js +321 -0
- package/dist/core-runtime/reconstruct/comprehension-reduce.js +367 -0
- package/dist/core-runtime/reconstruct/comprehension-semantic-map.js +771 -0
- package/dist/core-runtime/reconstruct/contract-registry.js +20 -0
- package/dist/core-runtime/reconstruct/dispatch-fallback-artifacts.js +640 -0
- package/dist/core-runtime/reconstruct/execution-telemetry.js +83 -9
- package/dist/core-runtime/reconstruct/final-output-sections.js +89 -0
- package/dist/core-runtime/reconstruct/governing-snapshot.js +36 -1
- package/dist/core-runtime/reconstruct/leaf-reader.js +305 -0
- package/dist/core-runtime/reconstruct/llm-dispatch-failure.js +270 -0
- package/dist/core-runtime/reconstruct/llm-touch-fingerprint.js +94 -0
- package/dist/core-runtime/reconstruct/material-admission-validation.js +18 -0
- package/dist/core-runtime/reconstruct/material-profile-validation.js +14 -0
- package/dist/core-runtime/reconstruct/materialize-preparation.js +304 -18
- package/dist/core-runtime/reconstruct/maturation-validation.js +1231 -53
- package/dist/core-runtime/reconstruct/mock-llm-realization.js +107 -3
- package/dist/core-runtime/reconstruct/obligation-assertion.js +18 -0
- package/dist/core-runtime/reconstruct/ontology-seed-validation.js +27 -0
- package/dist/core-runtime/reconstruct/output-budget.js +6 -0
- package/dist/core-runtime/reconstruct/pipeline-execution-ledger.js +87 -3
- package/dist/core-runtime/reconstruct/post-seed-validation.js +118 -5
- package/dist/core-runtime/reconstruct/purpose-authority-validation.js +117 -2
- package/dist/core-runtime/reconstruct/record.js +42 -0
- package/dist/core-runtime/reconstruct/registry-verification-validation.js +16 -0
- package/dist/core-runtime/reconstruct/run-control-validation.js +1011 -34
- package/dist/core-runtime/reconstruct/run.js +5198 -536
- package/dist/core-runtime/reconstruct/seed-authoring-readiness-validation.js +54 -3
- package/dist/core-runtime/reconstruct/semantic-quality-gate.js +105 -2
- package/dist/core-runtime/reconstruct/source-observation-delta-validation.js +41 -0
- package/dist/core-runtime/reconstruct/source-observations.js +166 -0
- package/dist/core-runtime/reconstruct/source-safety-validation.js +71 -183
- package/dist/core-runtime/reconstruct/source-scout-pack-validation.js +37 -1
- package/dist/core-runtime/reconstruct/terminal-validation.js +132 -2
- package/dist/core-runtime/review/continuation-plan.js +12 -5
- package/dist/core-runtime/review/issue-artifact-runtime.js +4 -1
- package/dist/core-runtime/review/materializers.js +100 -11
- package/dist/core-runtime/review/nesting-batch.js +6 -2
- package/dist/core-runtime/review/obligation-shardability.js +138 -0
- package/dist/core-runtime/review/pipeline-execution-ledger.js +42 -2
- package/dist/core-runtime/review/review-artifact-utils.js +217 -5
- package/dist/core-runtime/review/review-execution-steps.js +32 -8
- package/dist/core-runtime/review/review-progress-contract.js +8 -0
- package/dist/core-runtime/review/review-prompt-budget.js +97 -0
- package/dist/core-runtime/review/semantic-quality-gate.js +33 -7
- package/dist/core-runtime/review/spreadsheet-review-disposition.js +94 -0
- package/dist/core-runtime/route-identity.js +182 -0
- package/dist/core-runtime/spreadsheet-header-escalation.js +204 -0
- package/dist/core-runtime/spreadsheet-structure-observer.js +2689 -0
- package/dist/core-runtime/target-material-kind.js +58 -0
- package/dist/mcp/server.js +12 -5
- package/dist/tui/app.js +167 -0
- package/dist/tui/data/event-follower.js +116 -0
- package/dist/tui/data/node-detail.js +42 -0
- package/dist/tui/data/projection-poll.js +26 -0
- package/dist/tui/data/session-discovery.js +65 -0
- package/dist/tui/index.js +108 -0
- package/dist/tui/screens/log.js +25 -0
- package/dist/tui/screens/node-detail.js +17 -0
- package/dist/tui/screens/session-selector.js +26 -0
- package/dist/tui/screens/workflow-tree.js +90 -0
- package/dist/tui/view-model/reconstruct-adapter.js +162 -0
- package/dist/tui/view-model/review-adapter.js +270 -0
- package/dist/tui/view-model/tree-view-model.js +19 -0
- package/package.json +18 -3
- package/settings.example.json +77 -16
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read-only LLM seat inventory — a human-facing projection of every model seat
|
|
3
|
+
* the runtime can dispatch, with its resolved (provider, model, effort), the
|
|
4
|
+
* required role, and where the value comes from (own block vs inherited actor
|
|
5
|
+
* vs an unset named dispatch).
|
|
6
|
+
*
|
|
7
|
+
* This is a PROJECTION, not an authority: it changes no schema, gate, or
|
|
8
|
+
* dispatch behaviour. It reuses the gate's own resolver
|
|
9
|
+
* ({@link collectEffectiveModelRoutes}) as the spine so the provider/model/role
|
|
10
|
+
* it reports match exactly what G7 validates and the runtime dispatches — the
|
|
11
|
+
* inventory can never claim a seat the gate does not see. It then enriches each
|
|
12
|
+
* route with the effort knob (which the gate resolver drops) and a provenance
|
|
13
|
+
* label, and appends the named non-settings dispatches that have no settings
|
|
14
|
+
* path so an operator sees the full seat surface, including the ones that are
|
|
15
|
+
* currently unset and fall back to the runtime default.
|
|
16
|
+
*
|
|
17
|
+
* Scope: the inventory lists every seat the gate resolver sees — the configured
|
|
18
|
+
* model routes plus the named non-settings dispatches. A review unit with NO
|
|
19
|
+
* llm block of its own is not a distinct route; it runs as its default actor,
|
|
20
|
+
* so it appears via that actor's row rather than a separate line. A partial
|
|
21
|
+
* (provider-only) unit override does produce its own row, labelled `inherited`.
|
|
22
|
+
*/
|
|
23
|
+
import { collectEffectiveModelRoutes, } from "./settings-chain.js";
|
|
24
|
+
import { RECONSTRUCT_DISPATCH_FALLBACK_LLM_ROUTE_PATH, requiredSupportedModelRoleForDispatch, } from "./supported-models.js";
|
|
25
|
+
import { REVIEW_EXECUTION_UNIT_IDS } from "./review-execution-units.js";
|
|
26
|
+
import { reviewExecutionUnitActor } from "../review/review-execution-profile.js";
|
|
27
|
+
/** Walk settings once, recording the raw (provider, model, effort) of every
|
|
28
|
+
* llm block by its path — the same path shape {@link collectModelSelections}
|
|
29
|
+
* emits, so a route path indexes straight into this map (dispatch-fallback
|
|
30
|
+
* split paths are handled by the caller stripping the `#kind` suffix). */
|
|
31
|
+
function collectRawLlmByPath(settings) {
|
|
32
|
+
const out = new Map();
|
|
33
|
+
const visit = (value, trail) => {
|
|
34
|
+
if (Array.isArray(value)) {
|
|
35
|
+
value.forEach((item, index) => visit(item, `${trail}[${index}]`));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (value === null || typeof value !== "object")
|
|
39
|
+
return;
|
|
40
|
+
const record = value;
|
|
41
|
+
const hasLlmField = typeof record.model === "string" ||
|
|
42
|
+
typeof record.provider === "string" ||
|
|
43
|
+
typeof record.effort === "string";
|
|
44
|
+
if (hasLlmField) {
|
|
45
|
+
out.set(trail || "(root)", {
|
|
46
|
+
...(typeof record.provider === "string" ? { provider: record.provider } : {}),
|
|
47
|
+
...(typeof record.model === "string" ? { model: record.model } : {}),
|
|
48
|
+
...(typeof record.effort === "string" ? { effort: record.effort } : {}),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
for (const [key, child] of Object.entries(record)) {
|
|
52
|
+
visit(child, trail ? `${trail}.${key}` : key);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
visit(settings, "");
|
|
56
|
+
return out;
|
|
57
|
+
}
|
|
58
|
+
const REVIEW_UNIT_LLM_PATH = /^review\.execution\.units\.([^.[]+)\.llm$/;
|
|
59
|
+
/** The two actor path forms {@link collectEffectiveModelRoutes} accepts, in the
|
|
60
|
+
* same precedence (nested `actors.<a>` first, then legacy `<a>`). Returns the
|
|
61
|
+
* one present in the raw map, else the nested form. */
|
|
62
|
+
function actorLlmPath(actor, rawByPath) {
|
|
63
|
+
const nested = `review.execution.actors.${actor}.llm`;
|
|
64
|
+
const legacy = `review.execution.${actor}.llm`;
|
|
65
|
+
return rawByPath.has(nested) || !rawByPath.has(legacy) ? nested : legacy;
|
|
66
|
+
}
|
|
67
|
+
function reviewUnitIdOf(path) {
|
|
68
|
+
const match = REVIEW_UNIT_LLM_PATH.exec(path);
|
|
69
|
+
if (!match)
|
|
70
|
+
return undefined;
|
|
71
|
+
const id = match[1];
|
|
72
|
+
return REVIEW_EXECUTION_UNIT_IDS.includes(id) ? id : undefined;
|
|
73
|
+
}
|
|
74
|
+
/** Build the seat inventory from resolved settings. Pure — no I/O. */
|
|
75
|
+
export function collectSeatInventory(settings) {
|
|
76
|
+
const routes = collectEffectiveModelRoutes(settings);
|
|
77
|
+
const rawByPath = collectRawLlmByPath(settings);
|
|
78
|
+
const rows = routes.map((route) => {
|
|
79
|
+
const unitId = reviewUnitIdOf(route.path);
|
|
80
|
+
if (unitId) {
|
|
81
|
+
const own = rawByPath.get(route.path);
|
|
82
|
+
const actor = reviewExecutionUnitActor(unitId);
|
|
83
|
+
const actorPath = actorLlmPath(actor, rawByPath);
|
|
84
|
+
const actorRaw = rawByPath.get(actorPath);
|
|
85
|
+
const effort = own?.effort ?? actorRaw?.effort;
|
|
86
|
+
const ownModel = own?.model !== undefined;
|
|
87
|
+
const provenance = ownModel
|
|
88
|
+
? "explicit"
|
|
89
|
+
: route.model !== undefined
|
|
90
|
+
? "inherited"
|
|
91
|
+
: "unset";
|
|
92
|
+
return {
|
|
93
|
+
path: route.path,
|
|
94
|
+
role: route.requiredRole,
|
|
95
|
+
provider: route.provider,
|
|
96
|
+
model: route.model,
|
|
97
|
+
effort,
|
|
98
|
+
provenance,
|
|
99
|
+
...(provenance === "inherited" ? { inheritedFrom: actorPath } : {}),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
// Base seat (actors, reconstruct actors) or a dispatch-fallback split path.
|
|
103
|
+
const rawPath = route.path.includes("#")
|
|
104
|
+
? route.path.slice(0, route.path.indexOf("#"))
|
|
105
|
+
: route.path;
|
|
106
|
+
const raw = rawByPath.get(rawPath);
|
|
107
|
+
return {
|
|
108
|
+
path: route.path,
|
|
109
|
+
role: route.requiredRole,
|
|
110
|
+
provider: route.provider,
|
|
111
|
+
model: route.model,
|
|
112
|
+
effort: raw?.effort,
|
|
113
|
+
provenance: route.model !== undefined ? "explicit" : "unset",
|
|
114
|
+
};
|
|
115
|
+
});
|
|
116
|
+
// Named non-settings dispatches with no settings path: surface them so the
|
|
117
|
+
// full seat surface is visible even when unset (they fall back to the runtime
|
|
118
|
+
// default at dispatch). The dispatch-fallback pair already appears above when
|
|
119
|
+
// its llm block is present; only append what the settings walk cannot reach.
|
|
120
|
+
const seenPaths = new Set(rows.map((row) => row.path));
|
|
121
|
+
const fallbackSet = rawByPath.has(RECONSTRUCT_DISPATCH_FALLBACK_LLM_ROUTE_PATH);
|
|
122
|
+
const namedDispatches = [
|
|
123
|
+
{
|
|
124
|
+
path: "(dispatch) request_judge",
|
|
125
|
+
role: requiredSupportedModelRoleForDispatch({ kind: "request_judge" }),
|
|
126
|
+
},
|
|
127
|
+
...(fallbackSet
|
|
128
|
+
? []
|
|
129
|
+
: [
|
|
130
|
+
{
|
|
131
|
+
path: "(dispatch) semantic_map_verify",
|
|
132
|
+
role: requiredSupportedModelRoleForDispatch({
|
|
133
|
+
kind: "semantic_map_verify",
|
|
134
|
+
}),
|
|
135
|
+
},
|
|
136
|
+
]),
|
|
137
|
+
];
|
|
138
|
+
for (const dispatch of namedDispatches) {
|
|
139
|
+
if (seenPaths.has(dispatch.path))
|
|
140
|
+
continue;
|
|
141
|
+
rows.push({
|
|
142
|
+
path: dispatch.path,
|
|
143
|
+
role: dispatch.role,
|
|
144
|
+
provider: undefined,
|
|
145
|
+
model: undefined,
|
|
146
|
+
effort: undefined,
|
|
147
|
+
provenance: "unset",
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
return rows;
|
|
151
|
+
}
|
|
152
|
+
/** Render the inventory as an aligned text table for the CLI. */
|
|
153
|
+
export function renderSeatInventoryTable(rows) {
|
|
154
|
+
const header = ["ROLE", "PROVIDER/MODEL", "EFFORT", "SOURCE", "SEAT"];
|
|
155
|
+
const body = rows.map((row) => [
|
|
156
|
+
row.role,
|
|
157
|
+
row.model ? `${row.provider ?? "?"}/${row.model}` : "(unset → runtime default)",
|
|
158
|
+
row.effort ?? "-",
|
|
159
|
+
row.provenance === "inherited" && row.inheritedFrom
|
|
160
|
+
? `inherited (${row.inheritedFrom})`
|
|
161
|
+
: row.provenance,
|
|
162
|
+
row.path,
|
|
163
|
+
]);
|
|
164
|
+
const widths = header.map((_, col) => Math.max(header[col].length, ...body.map((cells) => cells[col].length)));
|
|
165
|
+
const line = (cells) => cells.map((cell, col) => cell.padEnd(widths[col])).join(" ").trimEnd();
|
|
166
|
+
return [line(header), ...body.map(line)].join("\n");
|
|
167
|
+
}
|