onto-mcp 0.4.11 → 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 +153 -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 +202 -49
- 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/nesting-batch-worker-contract.md +1 -1
- 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 +679 -18
- 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 +131 -0
- package/dist/core-runtime/cli/claude-code-review-unit-executor.js +21 -9
- package/dist/core-runtime/cli/claude-nesting-batch-worker.js +4 -2
- 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 +289 -25
- 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 +326 -0
- package/dist/core-runtime/effort-calibration-reconstruct.js +47 -0
- package/dist/core-runtime/effort-calibration-review.js +22 -0
- package/dist/core-runtime/effort-calibration-sweep.js +110 -0
- package/dist/core-runtime/effort-frontier.js +134 -0
- package/dist/core-runtime/llm/claude-bin.js +77 -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 +316 -35
- 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 +37 -0
- package/dist/core-runtime/reconstruct/benchmark-evidence.js +16 -0
- package/dist/core-runtime/reconstruct/claim-projection-validation.js +19 -5
- 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/directive-validation.js +4 -3
- package/dist/core-runtime/reconstruct/dispatch-fallback-artifacts.js +640 -0
- package/dist/core-runtime/reconstruct/execution-telemetry.js +84 -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 +20 -5
- package/dist/core-runtime/reconstruct/material-profile-validation.js +24 -6
- package/dist/core-runtime/reconstruct/materialize-preparation.js +380 -23
- package/dist/core-runtime/reconstruct/maturation-validation.js +1522 -67
- package/dist/core-runtime/reconstruct/mock-llm-realization.js +120 -1
- package/dist/core-runtime/reconstruct/obligation-assertion.js +18 -0
- package/dist/core-runtime/reconstruct/ontology-seed-validation.js +39 -7
- package/dist/core-runtime/reconstruct/output-budget.js +6 -0
- package/dist/core-runtime/reconstruct/pipeline-execution-ledger.js +112 -5
- package/dist/core-runtime/reconstruct/post-seed-validation.js +122 -11
- package/dist/core-runtime/reconstruct/proof-authority-validation.js +2 -6
- package/dist/core-runtime/reconstruct/purpose-authority-validation.js +119 -7
- package/dist/core-runtime/reconstruct/record.js +49 -3
- package/dist/core-runtime/reconstruct/registry-verification-validation.js +41 -5
- package/dist/core-runtime/reconstruct/run-control-validation.js +1019 -37
- package/dist/core-runtime/reconstruct/run.js +5409 -517
- package/dist/core-runtime/reconstruct/seed-authoring-readiness-validation.js +56 -8
- package/dist/core-runtime/reconstruct/semantic-quality-gate.js +112 -7
- package/dist/core-runtime/reconstruct/source-observation-delta-validation.js +53 -5
- package/dist/core-runtime/reconstruct/source-observations.js +166 -0
- package/dist/core-runtime/reconstruct/source-safety-validation.js +77 -188
- package/dist/core-runtime/reconstruct/source-scout-pack-validation.js +50 -6
- package/dist/core-runtime/reconstruct/terminal-validation.js +145 -13
- 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 +219 -7
- 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 +27 -5
- package/dist/mcp/tool-schemas.js +8 -0
- 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 +20 -3
- package/settings.example.json +77 -16
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import crypto from "node:crypto";
|
|
2
2
|
import fs from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
import { parse as parseYaml
|
|
4
|
+
import { parse as parseYaml } from "yaml";
|
|
5
|
+
import { assertArrayField, atomicWriteYamlDocument as writeYamlDocument } from "../artifact-io.js";
|
|
6
|
+
import { assertObligation } from "./obligation-assertion.js";
|
|
5
7
|
import { loadReconstructContractRegistry, } from "./contract-registry.js";
|
|
6
8
|
function isoNow() {
|
|
7
9
|
return new Date().toISOString();
|
|
@@ -12,10 +14,6 @@ async function sha256File(filePath) {
|
|
|
12
14
|
.update(await fs.readFile(filePath))
|
|
13
15
|
.digest("hex");
|
|
14
16
|
}
|
|
15
|
-
async function writeYamlDocument(filePath, value) {
|
|
16
|
-
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
17
|
-
await fs.writeFile(filePath, stringifyYaml(value), "utf8");
|
|
18
|
-
}
|
|
19
17
|
async function readYamlDocument(filePath) {
|
|
20
18
|
return parseYaml(await fs.readFile(filePath, "utf8"));
|
|
21
19
|
}
|
|
@@ -30,6 +28,10 @@ function evidenceRow(args) {
|
|
|
30
28
|
};
|
|
31
29
|
}
|
|
32
30
|
export async function buildRegistryVerificationEvidenceArtifact(args) {
|
|
31
|
+
assertArrayField(args.contractRegistry.validation_gate_catalog, "contract-registry", "validation_gate_catalog");
|
|
32
|
+
assertArrayField(args.contractRegistry.validator_records, "contract-registry", "validator_records");
|
|
33
|
+
assertArrayField(args.contractRegistry.required_when_predicate_catalog, "contract-registry", "required_when_predicate_catalog");
|
|
34
|
+
assertArrayField(args.contractRegistry.source_profile_records, "contract-registry", "source_profile_records");
|
|
33
35
|
const registryRef = path.resolve(args.registryPath);
|
|
34
36
|
const registryHash = await sha256File(registryRef);
|
|
35
37
|
const artifactAuthorityIds = Object.keys(args.contractRegistry.artifact_authorities)
|
|
@@ -106,19 +108,23 @@ function sortedArtifactAuthorityIds(registry) {
|
|
|
106
108
|
return Object.keys(registry.artifact_authorities).sort();
|
|
107
109
|
}
|
|
108
110
|
function sortedValidationGateIds(registry) {
|
|
111
|
+
assertArrayField(registry.validation_gate_catalog, "contract-registry", "validation_gate_catalog");
|
|
109
112
|
return registry.validation_gate_catalog.map((gate) => gate.gate_id).sort();
|
|
110
113
|
}
|
|
111
114
|
function sortedValidatorIds(registry) {
|
|
115
|
+
assertArrayField(registry.validator_records, "contract-registry", "validator_records");
|
|
112
116
|
return registry.validator_records
|
|
113
117
|
.map((validator) => validator.validator_id)
|
|
114
118
|
.sort();
|
|
115
119
|
}
|
|
116
120
|
function sortedPredicateIds(registry) {
|
|
121
|
+
assertArrayField(registry.required_when_predicate_catalog, "contract-registry", "required_when_predicate_catalog");
|
|
117
122
|
return registry.required_when_predicate_catalog
|
|
118
123
|
.map((predicate) => predicate.predicate_id)
|
|
119
124
|
.sort();
|
|
120
125
|
}
|
|
121
126
|
function sortedSourceProfileIds(registry) {
|
|
127
|
+
assertArrayField(registry.source_profile_records, "contract-registry", "source_profile_records");
|
|
122
128
|
return registry.source_profile_records
|
|
123
129
|
.map((profile) => profile.profile_id)
|
|
124
130
|
.sort();
|
|
@@ -142,7 +148,30 @@ function violation(args) {
|
|
|
142
148
|
};
|
|
143
149
|
}
|
|
144
150
|
export function validateRegistryVerificationEvidence(args) {
|
|
151
|
+
assertArrayField(args.evidence.evidence_rows, "registry-verification-evidence", "evidence_rows");
|
|
152
|
+
assertArrayField(args.evidence.active_artifact_authority_ids, "registry-verification-evidence", "active_artifact_authority_ids");
|
|
153
|
+
assertArrayField(args.evidence.active_validation_gate_ids, "registry-verification-evidence", "active_validation_gate_ids");
|
|
154
|
+
assertArrayField(args.evidence.active_validator_ids, "registry-verification-evidence", "active_validator_ids");
|
|
155
|
+
assertArrayField(args.evidence.required_when_predicate_ids, "registry-verification-evidence", "required_when_predicate_ids");
|
|
156
|
+
assertArrayField(args.evidence.source_profile_ids, "registry-verification-evidence", "source_profile_ids");
|
|
157
|
+
assertArrayField(args.contractRegistry.validator_records, "contract-registry", "validator_records");
|
|
158
|
+
assertArrayField(args.contractRegistry.validation_gate_catalog, "contract-registry", "validation_gate_catalog");
|
|
159
|
+
assertArrayField(args.contractRegistry.required_when_predicate_catalog, "contract-registry", "required_when_predicate_catalog");
|
|
145
160
|
const violations = [];
|
|
161
|
+
// G(a) obligation recorder (INV-OBLIGATION-COVERAGE-1): record that control
|
|
162
|
+
// reached each enforcer block below. Unconditional, before any per-row/per-loop
|
|
163
|
+
// guard so a zero-row clean input still stamps every recorded obligation.
|
|
164
|
+
// (validate_registry_snapshot_hash_matches_current_registry_file is PARKED: the
|
|
165
|
+
// match check is gated on the caller-supplied optional expectedRegistrySha256,
|
|
166
|
+
// not enforced internally — see obligation-coverage-ledger.yaml.)
|
|
167
|
+
const assertedObligationIds = [];
|
|
168
|
+
assertObligation(assertedObligationIds, "validate_registry_snapshot_hash_is_recorded");
|
|
169
|
+
assertObligation(assertedObligationIds, "validate_active_artifact_gate_validator_predicate_and_source_profile_ids_are_unique");
|
|
170
|
+
assertObligation(assertedObligationIds, "validate_active_registry_subject_lists_match_current_registry_catalogs");
|
|
171
|
+
assertObligation(assertedObligationIds, "validate_every_active_gate_has_a_validator_record");
|
|
172
|
+
assertObligation(assertedObligationIds, "validate_every_validator_gate_ref_resolves_to_an_active_gate");
|
|
173
|
+
assertObligation(assertedObligationIds, "validate_every_active_gate_required_when_predicate_resolves");
|
|
174
|
+
assertObligation(assertedObligationIds, "require_evidence_row_for_each_current_registry_subject_id");
|
|
146
175
|
const expectedRegistryRef = args.expectedRegistryRef
|
|
147
176
|
? path.resolve(args.expectedRegistryRef)
|
|
148
177
|
: null;
|
|
@@ -339,10 +368,14 @@ export function validateRegistryVerificationEvidence(args) {
|
|
|
339
368
|
validation_results: violations.length === 0
|
|
340
369
|
? ["registry_verification_evidence_valid"]
|
|
341
370
|
: ["registry_verification_evidence_invalid"],
|
|
371
|
+
asserted_obligation_ids: assertedObligationIds,
|
|
342
372
|
violations,
|
|
343
373
|
};
|
|
344
374
|
}
|
|
345
375
|
export async function writeRegistryVerificationEvidenceArtifact(args) {
|
|
376
|
+
// Registry verification is the gate that proves the on-disk registry is
|
|
377
|
+
// well-formed, so it always loads from `registryPath` itself rather than
|
|
378
|
+
// accepting a threaded in-memory registry that could belong to another path.
|
|
346
379
|
const contractRegistry = await loadReconstructContractRegistry({
|
|
347
380
|
registryPath: args.registryPath,
|
|
348
381
|
});
|
|
@@ -355,6 +388,9 @@ export async function writeRegistryVerificationEvidenceArtifact(args) {
|
|
|
355
388
|
return artifact;
|
|
356
389
|
}
|
|
357
390
|
export async function writeRegistryVerificationEvidenceValidationArtifact(args) {
|
|
391
|
+
// Loads the registry from `registryPath` itself (never a threaded object):
|
|
392
|
+
// this gate hashes the on-disk file and compares it against the evidence, so
|
|
393
|
+
// the parsed IDs must come from the same path being hashed.
|
|
358
394
|
const [evidence, contractRegistry] = await Promise.all([
|
|
359
395
|
readYamlDocument(args.evidencePath),
|
|
360
396
|
loadReconstructContractRegistry({ registryPath: args.registryPath }),
|