onto-mcp 0.3.2 → 0.4.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.
- package/.onto/processes/reconstruct/actionable-ontology-seed-recomposition-design.md +447 -0
- package/.onto/processes/reconstruct/foundry-style-ontology-seed-contract.md +934 -0
- package/.onto/processes/reconstruct/reconstruct-boundary-contract.md +303 -725
- package/.onto/processes/reconstruct/reconstruct-contract-registry.yaml +1645 -0
- package/.onto/processes/reconstruct/reconstruct-execution-ux-contract.md +26 -22
- package/.onto/processes/reconstruct/source-profile-contract.md +49 -23
- package/.onto/processes/reconstruct/source-profiles/code.md +6 -3
- package/.onto/processes/reconstruct/source-profiles/database.md +5 -2
- package/.onto/processes/reconstruct/source-profiles/document.md +5 -2
- package/.onto/processes/reconstruct/source-profiles/spreadsheet.md +5 -4
- package/.onto/processes/review/review-execution-ux-contract.md +40 -0
- package/.onto/processes/shared/pipeline-execution-ledger-contract.md +26 -10
- package/.onto/processes/shared/target-material-kind-contract.md +29 -16
- package/AGENTS.md +6 -4
- package/README.md +135 -76
- package/dist/cli.js +8 -8
- package/dist/core-api/reconstruct-api.js +117 -31
- package/dist/core-api/review-api.js +47 -0
- package/dist/core-runtime/cli/codex-review-unit-executor.js +39 -2
- package/dist/core-runtime/cli/complete-review-session.js +2 -2
- package/dist/core-runtime/cli/mock-review-unit-executor.js +1 -1
- package/dist/core-runtime/cli/review-invoke.js +9 -9
- package/dist/core-runtime/cli/run-review-prompt-execution.js +39 -5
- package/dist/core-runtime/cli/spawn-watcher.js +266 -47
- package/dist/core-runtime/cli/start-review-session.js +3 -3
- package/dist/core-runtime/llm/llm-caller.js +11 -0
- package/dist/core-runtime/llm/llm-tool-loop.js +2 -0
- package/dist/core-runtime/observability/runtime-stream-observation.js +118 -0
- package/dist/core-runtime/onboard/cli-host.js +149 -0
- package/dist/core-runtime/onboard/host-target.js +22 -0
- package/dist/core-runtime/onboard/json-config-host.js +122 -0
- package/dist/core-runtime/onboard/path-scan.js +26 -0
- package/dist/core-runtime/onboard/prompt.js +51 -0
- package/dist/core-runtime/onboard/register.js +207 -0
- package/dist/core-runtime/onboard/types.js +27 -0
- package/dist/core-runtime/reconstruct/actionable-seed-validation.js +1777 -0
- package/dist/core-runtime/reconstruct/artifact-types.js +10 -4
- package/dist/core-runtime/reconstruct/contract-registry.js +623 -0
- package/dist/core-runtime/reconstruct/domain-id.js +10 -0
- package/dist/core-runtime/reconstruct/governing-snapshot.js +716 -0
- package/dist/core-runtime/reconstruct/material-profile-validation.js +191 -0
- package/dist/core-runtime/reconstruct/materialize-preparation.js +49 -11
- package/dist/core-runtime/reconstruct/pipeline-execution-ledger.js +269 -79
- package/dist/core-runtime/reconstruct/post-seed-validation.js +1194 -51
- package/dist/core-runtime/reconstruct/record.js +104 -20
- package/dist/core-runtime/reconstruct/run.js +2107 -413
- package/dist/core-runtime/reconstruct/seed-claim-projections.js +268 -0
- package/dist/core-runtime/reconstruct/source-profiles.js +93 -4
- package/dist/core-runtime/reconstruct/terminal-validation.js +807 -0
- package/dist/core-runtime/review/review-invocation-runner.js +4 -4
- package/dist/mcp/server.js +110 -38
- package/dist/mcp/tool-schemas.js +20 -6
- package/package.json +8 -17
- package/scripts/onto-review-watch.sh +486 -0
- package/scripts/onto-runtime-watch.sh +122 -0
- package/scripts/postinstall-hint.js +22 -0
- package/.onto/processes/reconstruct/top-level-concept-discovery-contract.md +0 -387
- package/dist/core-runtime/cli/bootstrap-review-binding.js +0 -186
- package/dist/core-runtime/cli/codex-nested-dispatch.test.js +0 -390
- package/dist/core-runtime/cli/codex-nested-teamlead-executor.test.js +0 -335
- package/dist/core-runtime/cli/coordinator-helpers.js +0 -583
- package/dist/core-runtime/cli/coordinator-state-machine-deliberation.test.js +0 -167
- package/dist/core-runtime/cli/coordinator-state-machine.js +0 -794
- package/dist/core-runtime/cli/e2e-codex-multi-agent-fixes.test.js +0 -615
- package/dist/core-runtime/cli/e2e-start-review-session.test.js +0 -312
- package/dist/core-runtime/cli/health.js +0 -44
- package/dist/core-runtime/cli/inline-http-review-unit-executor.test.js +0 -567
- package/dist/core-runtime/cli/materialize-review-execution-preparation.js +0 -104
- package/dist/core-runtime/cli/migrate-session-roots.js +0 -118
- package/dist/core-runtime/cli/repo-layout-migration-replace.smoke.test.js +0 -106
- package/dist/core-runtime/cli/review-invoke-auto-resolution.test.js +0 -268
- package/dist/core-runtime/cli/review-invoke-coordinator-topology.test.js +0 -136
- package/dist/core-runtime/cli/review-invoke-resolver-caching.test.js +0 -201
- package/dist/core-runtime/cli/review-invoke-topology-dispatch.test.js +0 -192
- package/dist/core-runtime/cli/session-root-guard.js +0 -168
- package/dist/core-runtime/cli/spawn-watcher.test.js +0 -457
- package/dist/core-runtime/cli/strip-wrapping-code-fence.test.js +0 -79
- package/dist/core-runtime/cli/teamcreate-lens-deliberation-executor.js +0 -412
- package/dist/core-runtime/cli/teamcreate-lens-deliberation-executor.test.js +0 -351
- package/dist/core-runtime/cli/topology-executor-mapping.js +0 -139
- package/dist/core-runtime/cli/topology-executor-mapping.test.js +0 -173
- package/dist/core-runtime/cli/write-review-interpretation.js +0 -81
- package/dist/core-runtime/config/onto-config-cli.js +0 -278
- package/dist/core-runtime/config/onto-config-key-path.js +0 -288
- package/dist/core-runtime/config/onto-config-key-path.test.js +0 -195
- package/dist/core-runtime/config/onto-config-preview.js +0 -108
- package/dist/core-runtime/config/onto-config-preview.test.js +0 -132
- package/dist/core-runtime/discovery/config-chain.js +0 -118
- package/dist/core-runtime/discovery/config-chain.test.js +0 -103
- package/dist/core-runtime/discovery/config-profile.js +0 -199
- package/dist/core-runtime/discovery/config-profile.test.js +0 -233
- package/dist/core-runtime/discovery/host-detection.test.js +0 -186
- package/dist/core-runtime/discovery/installation-paths.test.js +0 -65
- package/dist/core-runtime/discovery/lens-registry.test.js +0 -81
- package/dist/core-runtime/discovery/path-normalization.test.js +0 -22
- package/dist/core-runtime/discovery/plugin-path.js +0 -72
- package/dist/core-runtime/discovery/plugin-path.test.js +0 -95
- package/dist/core-runtime/evolve/adapters/code-product/compile/compile-defense.js +0 -344
- package/dist/core-runtime/evolve/adapters/code-product/compile/compile-defense.test.js +0 -915
- package/dist/core-runtime/evolve/adapters/code-product/compile/compile.js +0 -564
- package/dist/core-runtime/evolve/adapters/code-product/compile/compile.test.js +0 -708
- package/dist/core-runtime/evolve/adapters/code-product/parsers/brief-parser.js +0 -165
- package/dist/core-runtime/evolve/adapters/code-product/parsers/brief-parser.test.js +0 -227
- package/dist/core-runtime/evolve/adapters/code-product/validators/validate.js +0 -59
- package/dist/core-runtime/evolve/adapters/code-product/validators/validate.test.js +0 -205
- package/dist/core-runtime/evolve/adapters/methodology/adapter.js +0 -16
- package/dist/core-runtime/evolve/adapters/methodology/adapter.test.js +0 -9
- package/dist/core-runtime/evolve/adapters/methodology/perspectives/authority-consistency.js +0 -298
- package/dist/core-runtime/evolve/adapters/methodology/perspectives/authority-consistency.test.js +0 -70
- package/dist/core-runtime/evolve/adapters/methodology/scope-types/process.js +0 -46
- package/dist/core-runtime/evolve/adapters/methodology/scope-types/process.test.js +0 -73
- package/dist/core-runtime/evolve/adapters/registry.js +0 -47
- package/dist/core-runtime/evolve/adapters/registry.test.js +0 -67
- package/dist/core-runtime/evolve/cli.js +0 -256
- package/dist/core-runtime/evolve/commands/align.js +0 -194
- package/dist/core-runtime/evolve/commands/align.test.js +0 -82
- package/dist/core-runtime/evolve/commands/apply.js +0 -161
- package/dist/core-runtime/evolve/commands/apply.test.js +0 -138
- package/dist/core-runtime/evolve/commands/close.js +0 -39
- package/dist/core-runtime/evolve/commands/close.test.js +0 -99
- package/dist/core-runtime/evolve/commands/defer.js +0 -40
- package/dist/core-runtime/evolve/commands/defer.test.js +0 -134
- package/dist/core-runtime/evolve/commands/draft.js +0 -323
- package/dist/core-runtime/evolve/commands/draft.test.js +0 -178
- package/dist/core-runtime/evolve/commands/e2e-evolve-full-cycle.test.js +0 -208
- package/dist/core-runtime/evolve/commands/error-messages.js +0 -125
- package/dist/core-runtime/evolve/commands/error-messages.test.js +0 -167
- package/dist/core-runtime/evolve/commands/propose-align.js +0 -222
- package/dist/core-runtime/evolve/commands/propose-align.test.js +0 -136
- package/dist/core-runtime/evolve/commands/reconstruct.js +0 -330
- package/dist/core-runtime/evolve/commands/reconstruct.test.js +0 -278
- package/dist/core-runtime/evolve/commands/shared.js +0 -22
- package/dist/core-runtime/evolve/commands/stale-check.js +0 -103
- package/dist/core-runtime/evolve/commands/stale-check.test.js +0 -84
- package/dist/core-runtime/evolve/commands/start.js +0 -887
- package/dist/core-runtime/evolve/commands/start.test.js +0 -396
- package/dist/core-runtime/evolve/config/project-config.js +0 -99
- package/dist/core-runtime/evolve/config/project-config.test.js +0 -170
- package/dist/core-runtime/evolve/renderers/align-packet.js +0 -280
- package/dist/core-runtime/evolve/renderers/align-packet.test.js +0 -332
- package/dist/core-runtime/evolve/renderers/draft-packet.js +0 -303
- package/dist/core-runtime/evolve/renderers/draft-packet.test.js +0 -377
- package/dist/core-runtime/evolve/renderers/format.js +0 -5
- package/dist/core-runtime/evolve/renderers/scope-md.js +0 -237
- package/dist/core-runtime/evolve/renderers/scope-md.test.js +0 -306
- package/dist/core-runtime/govern/cli.js +0 -369
- package/dist/core-runtime/govern/cli.test.js +0 -314
- package/dist/core-runtime/govern/drift-engine.js +0 -103
- package/dist/core-runtime/govern/drift-engine.test.js +0 -319
- package/dist/core-runtime/govern/promote-principle.js +0 -206
- package/dist/core-runtime/govern/promote-principle.test.js +0 -368
- package/dist/core-runtime/govern/queue.js +0 -81
- package/dist/core-runtime/govern/types.js +0 -16
- package/dist/core-runtime/install/cli.js +0 -530
- package/dist/core-runtime/install/detect.js +0 -128
- package/dist/core-runtime/install/detect.test.js +0 -155
- package/dist/core-runtime/install/gitignore-update.js +0 -74
- package/dist/core-runtime/install/gitignore-update.test.js +0 -64
- package/dist/core-runtime/install/install-integration.test.js +0 -373
- package/dist/core-runtime/install/prompts.js +0 -389
- package/dist/core-runtime/install/prompts.test.js +0 -293
- package/dist/core-runtime/install/types.js +0 -26
- package/dist/core-runtime/install/validation.js +0 -295
- package/dist/core-runtime/install/validation.test.js +0 -313
- package/dist/core-runtime/install/writer.js +0 -254
- package/dist/core-runtime/install/writer.test.js +0 -218
- package/dist/core-runtime/learning/extractor.js +0 -461
- package/dist/core-runtime/learning/feedback.js +0 -179
- package/dist/core-runtime/learning/health-report.js +0 -165
- package/dist/core-runtime/learning/health-report.test.js +0 -169
- package/dist/core-runtime/learning/loader.js +0 -388
- package/dist/core-runtime/learning/loader.test.js +0 -102
- package/dist/core-runtime/learning/promote/apply-state.js +0 -240
- package/dist/core-runtime/learning/promote/audit-obligation.js +0 -195
- package/dist/core-runtime/learning/promote/collector.js +0 -432
- package/dist/core-runtime/learning/promote/degraded-state.js +0 -125
- package/dist/core-runtime/learning/promote/domain-doc-proposer.js +0 -166
- package/dist/core-runtime/learning/promote/e2e-promote.test.js +0 -6385
- package/dist/core-runtime/learning/promote/health-snapshot.js +0 -150
- package/dist/core-runtime/learning/promote/insight-reclassifier.js +0 -544
- package/dist/core-runtime/learning/promote/judgment-auditor.js +0 -517
- package/dist/core-runtime/learning/promote/panel-reviewer.js +0 -1158
- package/dist/core-runtime/learning/promote/promote-executor.js +0 -1675
- package/dist/core-runtime/learning/promote/promoter.js +0 -307
- package/dist/core-runtime/learning/promote/retirement.js +0 -122
- package/dist/core-runtime/learning/promote/types.js +0 -23
- package/dist/core-runtime/learning/prompt-sections.js +0 -51
- package/dist/core-runtime/learning/shared/artifact-registry-init.js +0 -45
- package/dist/core-runtime/learning/shared/artifact-registry.js +0 -254
- package/dist/core-runtime/learning/shared/audit-obligation-kernel.js +0 -73
- package/dist/core-runtime/learning/shared/audit-state.js +0 -99
- package/dist/core-runtime/learning/shared/duplicate-check.js +0 -28
- package/dist/core-runtime/learning/shared/llm-caller.js +0 -831
- package/dist/core-runtime/learning/shared/llm-caller.test.js +0 -601
- package/dist/core-runtime/learning/shared/llm-tool-loop.js +0 -393
- package/dist/core-runtime/learning/shared/mode.js +0 -25
- package/dist/core-runtime/learning/shared/paths.js +0 -84
- package/dist/core-runtime/learning/shared/paths.test.js +0 -79
- package/dist/core-runtime/learning/shared/patterns.js +0 -37
- package/dist/core-runtime/learning/shared/recoverability.js +0 -355
- package/dist/core-runtime/learning/shared/recovery-context.js +0 -374
- package/dist/core-runtime/learning/shared/scope.js +0 -1
- package/dist/core-runtime/learning/shared/semantic-classifier.js +0 -94
- package/dist/core-runtime/learning/shared/specs/apply-execution-state-spec.js +0 -42
- package/dist/core-runtime/learning/shared/specs/audit-state-spec.js +0 -37
- package/dist/core-runtime/learning/shared/specs/backup-metadata-spec.js +0 -39
- package/dist/core-runtime/learning/shared/specs/emergency-log-spec.js +0 -41
- package/dist/core-runtime/learning/shared/specs/layout-version-spec.js +0 -38
- package/dist/core-runtime/learning/shared/specs/promote-decisions-spec.js +0 -43
- package/dist/core-runtime/learning/shared/specs/promote-report-spec.js +0 -113
- package/dist/core-runtime/learning/shared/specs/prune-log-spec.js +0 -36
- package/dist/core-runtime/learning/shared/specs/recovery-resolution-spec.js +0 -48
- package/dist/core-runtime/learning/shared/specs/restore-manifest-spec.js +0 -43
- package/dist/core-runtime/learning/shared/specs/spec-helpers.js +0 -64
- package/dist/core-runtime/learning/usage-tracker.js +0 -190
- package/dist/core-runtime/learning/usage-tracker.test.js +0 -176
- package/dist/core-runtime/onboard/detect-review-axes.js +0 -122
- package/dist/core-runtime/onboard/detect-review-axes.test.js +0 -127
- package/dist/core-runtime/onboard/write-review-block.js +0 -188
- package/dist/core-runtime/onboard/write-review-block.test.js +0 -240
- package/dist/core-runtime/readers/brownfield-builder.js +0 -150
- package/dist/core-runtime/readers/brownfield-builder.test.js +0 -136
- package/dist/core-runtime/readers/code-chunk-collector.js +0 -53
- package/dist/core-runtime/readers/code-chunk-collector.test.js +0 -136
- package/dist/core-runtime/readers/file-utils.js +0 -240
- package/dist/core-runtime/readers/file-utils.test.js +0 -146
- package/dist/core-runtime/readers/lexicon-citation-check.js +0 -93
- package/dist/core-runtime/readers/lexicon-citation-check.test.js +0 -77
- package/dist/core-runtime/readers/mcp-figma.js +0 -30
- package/dist/core-runtime/readers/mcp-figma.test.js +0 -82
- package/dist/core-runtime/readers/mcp-generic.js +0 -31
- package/dist/core-runtime/readers/mcp-generic.test.js +0 -76
- package/dist/core-runtime/readers/ontology-index.js +0 -148
- package/dist/core-runtime/readers/ontology-index.test.js +0 -245
- package/dist/core-runtime/readers/ontology-query.js +0 -168
- package/dist/core-runtime/readers/ontology-query.test.js +0 -311
- package/dist/core-runtime/readers/ontology-resolve.js +0 -48
- package/dist/core-runtime/readers/ontology-resolve.test.js +0 -48
- package/dist/core-runtime/readers/patterns/index.js +0 -7
- package/dist/core-runtime/readers/review-log.js +0 -213
- package/dist/core-runtime/readers/review-log.test.js +0 -313
- package/dist/core-runtime/readers/scan-local.js +0 -102
- package/dist/core-runtime/readers/scan-local.test.js +0 -102
- package/dist/core-runtime/readers/scan-tarball.js +0 -121
- package/dist/core-runtime/readers/scan-tarball.test.js +0 -283
- package/dist/core-runtime/readers/scan-vault.js +0 -34
- package/dist/core-runtime/readers/scan-vault.test.js +0 -81
- package/dist/core-runtime/readers/types.js +0 -42
- package/dist/core-runtime/readers/types.test.js +0 -94
- package/dist/core-runtime/readers/viewpoint-collectors.js +0 -229
- package/dist/core-runtime/reconstruct/seed-candidate-validation.js +0 -385
- package/dist/core-runtime/review/citation-audit.test.js +0 -165
- package/dist/core-runtime/review/execution-plan-resolver.js +0 -247
- package/dist/core-runtime/review/execution-plan-resolver.test.js +0 -243
- package/dist/core-runtime/review/execution-topology-resolver-axis-first.test.js +0 -246
- package/dist/core-runtime/review/execution-topology-resolver.js +0 -401
- package/dist/core-runtime/review/execution-topology-resolver.test.js +0 -315
- package/dist/core-runtime/review/inline-context-embedder.test.js +0 -154
- package/dist/core-runtime/review/legacy-mode-policy.js +0 -88
- package/dist/core-runtime/review/materializers-effort-persist.test.js +0 -79
- package/dist/core-runtime/review/ontology-path-classifier.js +0 -179
- package/dist/core-runtime/review/ontology-path-classifier.test.js +0 -216
- package/dist/core-runtime/review/packet-boundary-policy.test.js +0 -107
- package/dist/core-runtime/review/participating-lens-paths.test.js +0 -73
- package/dist/core-runtime/review/review-config-legacy-translate.js +0 -244
- package/dist/core-runtime/review/review-config-legacy-translate.test.js +0 -161
- package/dist/core-runtime/review/review-config-validator.js +0 -289
- package/dist/core-runtime/review/review-config-validator.test.js +0 -236
- package/dist/core-runtime/review/shape-pipeline-audit.test.js +0 -311
- package/dist/core-runtime/review/shape-to-topology-id.js +0 -117
- package/dist/core-runtime/review/shape-to-topology-id.test.js +0 -132
- package/dist/core-runtime/review/topology-shape-derivation.js +0 -155
- package/dist/core-runtime/review/topology-shape-derivation.test.js +0 -195
- package/dist/core-runtime/scope-runtime/constants.js +0 -12
- package/dist/core-runtime/scope-runtime/constraint-pool.js +0 -166
- package/dist/core-runtime/scope-runtime/constraint-pool.test.js +0 -674
- package/dist/core-runtime/scope-runtime/domain-validation-log.js +0 -135
- package/dist/core-runtime/scope-runtime/domain-validation-log.test.js +0 -156
- package/dist/core-runtime/scope-runtime/eval-persistence.js +0 -65
- package/dist/core-runtime/scope-runtime/eval-persistence.test.js +0 -84
- package/dist/core-runtime/scope-runtime/event-pipeline.js +0 -64
- package/dist/core-runtime/scope-runtime/event-pipeline.test.js +0 -450
- package/dist/core-runtime/scope-runtime/event-store.js +0 -39
- package/dist/core-runtime/scope-runtime/event-store.test.js +0 -95
- package/dist/core-runtime/scope-runtime/gate-guard.js +0 -348
- package/dist/core-runtime/scope-runtime/gate-guard.test.js +0 -1047
- package/dist/core-runtime/scope-runtime/hash.js +0 -4
- package/dist/core-runtime/scope-runtime/hash.test.js +0 -33
- package/dist/core-runtime/scope-runtime/id.js +0 -4
- package/dist/core-runtime/scope-runtime/id.test.js +0 -17
- package/dist/core-runtime/scope-runtime/reducer.js +0 -297
- package/dist/core-runtime/scope-runtime/reducer.test.js +0 -759
- package/dist/core-runtime/scope-runtime/scope-manager.js +0 -161
- package/dist/core-runtime/scope-runtime/state-machine.js +0 -309
- package/dist/core-runtime/scope-runtime/state-machine.test.js +0 -704
- package/dist/core-runtime/scope-runtime/types.js +0 -116
- package/dist/core-runtime/scope-runtime/types.test.js +0 -69
- package/dist/core-runtime/translate/render-for-user.js +0 -169
- package/dist/core-runtime/translate/render-for-user.test.js +0 -122
- package/dist/providers/capability-contract.js +0 -1
|
@@ -422,9 +422,9 @@ export async function runReviewInvocationArgv(argv, observer) {
|
|
|
422
422
|
async function projectLegacyReviewInvocationOutput(args) {
|
|
423
423
|
const reviewSummary = await readOptionalReviewSummary(args.sessionRoot);
|
|
424
424
|
const boundedInvokeSteps = [
|
|
425
|
-
"
|
|
426
|
-
"
|
|
427
|
-
"
|
|
425
|
+
"start_review_session",
|
|
426
|
+
"run_review_prompt_execution",
|
|
427
|
+
"complete_review_session",
|
|
428
428
|
];
|
|
429
429
|
const effectiveReviewExecutionProfile = args.setup.executionProfile.review_execution_profile;
|
|
430
430
|
const finalRoute = buildReviewExecutionRoute(effectiveReviewExecutionProfile);
|
|
@@ -435,7 +435,7 @@ async function projectLegacyReviewInvocationOutput(args) {
|
|
|
435
435
|
review_execution_profile: effectiveReviewExecutionProfile,
|
|
436
436
|
};
|
|
437
437
|
const routeSummary = {
|
|
438
|
-
combined_entrypoint: "
|
|
438
|
+
combined_entrypoint: "review_invocation",
|
|
439
439
|
bounded_invoke_steps: [...boundedInvokeSteps],
|
|
440
440
|
execution_realization: routeProfile.execution_realization,
|
|
441
441
|
host_runtime: routeProfile.host_runtime,
|
package/dist/mcp/server.js
CHANGED
|
@@ -3,6 +3,7 @@ import path from "node:path";
|
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
4
|
import { createOntoReviewCoreApi, ReviewContinuationError, } from "../core-api/review-api.js";
|
|
5
5
|
import { createOntoReconstructCoreApi, } from "../core-api/reconstruct-api.js";
|
|
6
|
+
import { RECONSTRUCT_DOMAIN_ID_GRAMMAR_DESCRIPTION, RECONSTRUCT_DOMAIN_ID_PATTERN, } from "../core-runtime/reconstruct/domain-id.js";
|
|
6
7
|
import { OntoSettingsValidationError, UnsupportedOntoConfigFilesError, } from "../core-runtime/discovery/settings-chain.js";
|
|
7
8
|
import { readOntoVersion } from "../core-runtime/release-channel/release-channel.js";
|
|
8
9
|
import { createStructuredFailureRecord, ReviewStructuredFailureError, } from "../core-runtime/review/failure-records.js";
|
|
@@ -288,6 +289,16 @@ const RECONSTRUCT_INPUT_SCHEMA = {
|
|
|
288
289
|
type: "string",
|
|
289
290
|
description: "Declared reconstruction purpose. The runner passes this to the directive author and does not infer ontology meaning itself.",
|
|
290
291
|
},
|
|
292
|
+
domain: {
|
|
293
|
+
type: "string",
|
|
294
|
+
pattern: RECONSTRUCT_DOMAIN_ID_PATTERN.source,
|
|
295
|
+
description: `Optional domain id whose competency_qs.md is admitted into the reconstruct run governing snapshot. Must use ${RECONSTRUCT_DOMAIN_ID_GRAMMAR_DESCRIPTION}.`,
|
|
296
|
+
},
|
|
297
|
+
resumeMode: {
|
|
298
|
+
type: "string",
|
|
299
|
+
enum: ["fresh", "reuse_existing_authored_artifacts"],
|
|
300
|
+
description: "Optional explicit same-session resume mode. fresh fails before rewriting authored semantic artifacts; reuse_existing_authored_artifacts reuses existing authored YAML artifacts and reruns downstream runtime validation gates.",
|
|
301
|
+
},
|
|
291
302
|
semanticAuthorRealization: {
|
|
292
303
|
type: "string",
|
|
293
304
|
enum: ["mock", "direct_call"],
|
|
@@ -319,11 +330,42 @@ const VALIDATE_RECONSTRUCT_DIRECTIVE_INPUT_SCHEMA = {
|
|
|
319
330
|
type: "object",
|
|
320
331
|
additionalProperties: false,
|
|
321
332
|
required: ["directiveKind", "sourceObservationsPath"],
|
|
333
|
+
allOf: [
|
|
334
|
+
{
|
|
335
|
+
if: {
|
|
336
|
+
properties: { directiveKind: { const: "source_observation" } },
|
|
337
|
+
required: ["directiveKind"],
|
|
338
|
+
},
|
|
339
|
+
then: { required: ["directivePath"] },
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
if: {
|
|
343
|
+
properties: { directiveKind: { const: "candidate_disposition" } },
|
|
344
|
+
required: ["directiveKind"],
|
|
345
|
+
},
|
|
346
|
+
then: {
|
|
347
|
+
required: ["candidateInventoryPath", "candidateDispositionPath"],
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
if: {
|
|
352
|
+
properties: { directiveKind: { const: "ontology_seed" } },
|
|
353
|
+
required: ["directiveKind"],
|
|
354
|
+
},
|
|
355
|
+
then: {
|
|
356
|
+
required: ["ontologySeedPath", "candidateDispositionPath"],
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
],
|
|
322
360
|
properties: {
|
|
323
361
|
directiveKind: {
|
|
324
362
|
type: "string",
|
|
325
|
-
enum: [
|
|
326
|
-
|
|
363
|
+
enum: [
|
|
364
|
+
"source_observation",
|
|
365
|
+
"candidate_disposition",
|
|
366
|
+
"ontology_seed",
|
|
367
|
+
],
|
|
368
|
+
description: "Which LLM-authored reconstruct artifact shape to validate.",
|
|
327
369
|
},
|
|
328
370
|
projectRoot: {
|
|
329
371
|
type: "string",
|
|
@@ -333,21 +375,25 @@ const VALIDATE_RECONSTRUCT_DIRECTIVE_INPUT_SCHEMA = {
|
|
|
333
375
|
type: "string",
|
|
334
376
|
description: "Path to source-observation-directive.yaml when directiveKind=source_observation.",
|
|
335
377
|
},
|
|
336
|
-
|
|
378
|
+
candidateInventoryPath: {
|
|
337
379
|
type: "string",
|
|
338
|
-
description: "Path to
|
|
380
|
+
description: "Path to candidate-inventory.yaml when directiveKind=candidate_disposition.",
|
|
339
381
|
},
|
|
340
|
-
|
|
382
|
+
candidateDispositionPath: {
|
|
341
383
|
type: "string",
|
|
342
|
-
description: "Path to
|
|
384
|
+
description: "Path to candidate-disposition.yaml when directiveKind=candidate_disposition or ontology_seed.",
|
|
343
385
|
},
|
|
344
|
-
|
|
386
|
+
ontologySeedPath: {
|
|
345
387
|
type: "string",
|
|
346
|
-
description: "
|
|
388
|
+
description: "Path to ontology-seed.yaml when directiveKind=ontology_seed.",
|
|
347
389
|
},
|
|
348
|
-
|
|
390
|
+
sourceObservationsPath: {
|
|
349
391
|
type: "string",
|
|
350
|
-
description: "
|
|
392
|
+
description: "Path to source-observations.yaml.",
|
|
393
|
+
},
|
|
394
|
+
registryPath: {
|
|
395
|
+
type: "string",
|
|
396
|
+
description: "Optional path to reconstruct-contract-registry.yaml for registry-backed validators.",
|
|
351
397
|
},
|
|
352
398
|
outputPath: {
|
|
353
399
|
type: "string",
|
|
@@ -408,7 +454,7 @@ const TOOL_DEFINITIONS = [
|
|
|
408
454
|
},
|
|
409
455
|
{
|
|
410
456
|
name: "onto.validate_reconstruct_directive",
|
|
411
|
-
description: "Validate LLM-authored reconstruct
|
|
457
|
+
description: "Validate LLM-authored reconstruct artifacts against runtime observations, registry enums, and evidence refs without repairing or rewriting them.",
|
|
412
458
|
inputSchema: VALIDATE_RECONSTRUCT_DIRECTIVE_INPUT_SCHEMA,
|
|
413
459
|
},
|
|
414
460
|
{
|
|
@@ -981,33 +1027,57 @@ async function callTool(name, args, options = {}) {
|
|
|
981
1027
|
...(outputPath ? { outputPath } : {}),
|
|
982
1028
|
}));
|
|
983
1029
|
}
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1030
|
+
if (parsed.directiveKind === "candidate_disposition") {
|
|
1031
|
+
return formatToolResult(await reconstructApi.validateCandidateDisposition({
|
|
1032
|
+
candidateInventoryPath: resolveInsideProject({
|
|
1033
|
+
projectRoot,
|
|
1034
|
+
ref: parsed.candidateInventoryPath,
|
|
1035
|
+
label: "candidateInventoryPath",
|
|
1036
|
+
}),
|
|
1037
|
+
candidateDispositionPath: resolveInsideProject({
|
|
1038
|
+
projectRoot,
|
|
1039
|
+
ref: parsed.candidateDispositionPath,
|
|
1040
|
+
label: "candidateDispositionPath",
|
|
1041
|
+
}),
|
|
1042
|
+
sourceObservationsPath,
|
|
1043
|
+
...(parsed.registryPath
|
|
1044
|
+
? {
|
|
1045
|
+
registryPath: resolveInsideProject({
|
|
1046
|
+
projectRoot,
|
|
1047
|
+
ref: parsed.registryPath,
|
|
1048
|
+
label: "registryPath",
|
|
1049
|
+
}),
|
|
1050
|
+
}
|
|
1051
|
+
: {}),
|
|
1052
|
+
...(outputPath ? { outputPath } : {}),
|
|
1053
|
+
}));
|
|
1054
|
+
}
|
|
1055
|
+
if (parsed.directiveKind === "ontology_seed") {
|
|
1056
|
+
return formatToolResult(await reconstructApi.validateActionableOntologySeed({
|
|
1057
|
+
ontologySeedPath: resolveInsideProject({
|
|
1058
|
+
projectRoot,
|
|
1059
|
+
ref: parsed.ontologySeedPath,
|
|
1060
|
+
label: "ontologySeedPath",
|
|
1061
|
+
}),
|
|
1062
|
+
candidateDispositionPath: resolveInsideProject({
|
|
1063
|
+
projectRoot,
|
|
1064
|
+
ref: parsed.candidateDispositionPath,
|
|
1065
|
+
label: "candidateDispositionPath",
|
|
1066
|
+
}),
|
|
1067
|
+
sourceObservationsPath,
|
|
1068
|
+
...(parsed.registryPath
|
|
1069
|
+
? {
|
|
1070
|
+
registryPath: resolveInsideProject({
|
|
1071
|
+
projectRoot,
|
|
1072
|
+
ref: parsed.registryPath,
|
|
1073
|
+
label: "registryPath",
|
|
1074
|
+
}),
|
|
1075
|
+
}
|
|
1076
|
+
: {}),
|
|
1077
|
+
...(outputPath ? { outputPath } : {}),
|
|
1078
|
+
}));
|
|
1079
|
+
}
|
|
1080
|
+
throw new Error("Unsupported reconstruct directive kind.");
|
|
1011
1081
|
}
|
|
1012
1082
|
case "onto.reconstruct": {
|
|
1013
1083
|
const parsed = OntoReconstructToolInputSchema.parse(args);
|
|
@@ -1037,6 +1107,8 @@ async function callTool(name, args, options = {}) {
|
|
|
1037
1107
|
projectRoot,
|
|
1038
1108
|
targetRefs,
|
|
1039
1109
|
intent: parsed.intent,
|
|
1110
|
+
...(parsed.domain !== undefined ? { domain: parsed.domain } : {}),
|
|
1111
|
+
...(parsed.resumeMode !== undefined ? { resumeMode: parsed.resumeMode } : {}),
|
|
1040
1112
|
semanticAuthorRealization: parsed.semanticAuthorRealization,
|
|
1041
1113
|
confirmationProviderRealization: parsed.confirmationProviderRealization,
|
|
1042
1114
|
...(sessionRoot ? { sessionRoot } : {}),
|
package/dist/mcp/tool-schemas.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { RECONSTRUCT_DOMAIN_ID_GRAMMAR_DESCRIPTION, RECONSTRUCT_DOMAIN_ID_PATTERN, } from "../core-runtime/reconstruct/domain-id.js";
|
|
2
3
|
const ReviewModeSchema = z.enum(["core-axis", "full"]);
|
|
3
4
|
const ReviewTargetScopeKindSchema = z.enum(["file", "directory", "bundle"]);
|
|
4
5
|
const ExecutorRealizationSchema = z.enum(["codex", "mock", "ts_inline_http"]);
|
|
@@ -6,6 +7,7 @@ const ReviewResultProjectionLevelSchema = z.enum(["compact", "standard", "full"]
|
|
|
6
7
|
const DeliberationModeSchema = z.enum([
|
|
7
8
|
"controlled_lens_deliberation",
|
|
8
9
|
]);
|
|
10
|
+
const ReconstructDomainIdSchema = z.string().regex(RECONSTRUCT_DOMAIN_ID_PATTERN, `domain must use ${RECONSTRUCT_DOMAIN_ID_GRAMMAR_DESCRIPTION}`);
|
|
9
11
|
const OntoReviewToolInputBaseSchema = z.object({
|
|
10
12
|
target: z.string().min(1),
|
|
11
13
|
intent: z.string().min(1),
|
|
@@ -74,6 +76,8 @@ export const OntoObserveSourceToolInputSchema = z.object({
|
|
|
74
76
|
}).strict();
|
|
75
77
|
export const OntoReconstructToolInputSchema = OntoObserveSourceToolInputSchema.extend({
|
|
76
78
|
intent: z.string().min(1),
|
|
79
|
+
domain: ReconstructDomainIdSchema.optional(),
|
|
80
|
+
resumeMode: z.enum(["fresh", "reuse_existing_authored_artifacts"]).optional(),
|
|
77
81
|
semanticAuthorRealization: z.enum(["mock", "direct_call"]).default("direct_call"),
|
|
78
82
|
confirmationProviderRealization: z.enum(["mock", "direct_call"]).default("direct_call"),
|
|
79
83
|
}).strict();
|
|
@@ -88,18 +92,28 @@ const OntoValidateSourceObservationDirectiveToolInputSchema = z.object({
|
|
|
88
92
|
outputPath: z.string().min(1).optional(),
|
|
89
93
|
projectRoot: z.string().min(1).optional(),
|
|
90
94
|
}).strict();
|
|
91
|
-
const
|
|
92
|
-
directiveKind: z.literal("
|
|
93
|
-
|
|
95
|
+
const OntoValidateCandidateDispositionToolInputSchema = z.object({
|
|
96
|
+
directiveKind: z.literal("candidate_disposition"),
|
|
97
|
+
candidateInventoryPath: z.string().min(1),
|
|
98
|
+
candidateDispositionPath: z.string().min(1),
|
|
94
99
|
sourceObservationsPath: z.string().min(1),
|
|
95
|
-
|
|
96
|
-
|
|
100
|
+
registryPath: z.string().min(1).optional(),
|
|
101
|
+
outputPath: z.string().min(1).optional(),
|
|
102
|
+
projectRoot: z.string().min(1).optional(),
|
|
103
|
+
}).strict();
|
|
104
|
+
const OntoValidateOntologySeedToolInputSchema = z.object({
|
|
105
|
+
directiveKind: z.literal("ontology_seed"),
|
|
106
|
+
ontologySeedPath: z.string().min(1),
|
|
107
|
+
candidateDispositionPath: z.string().min(1),
|
|
108
|
+
sourceObservationsPath: z.string().min(1),
|
|
109
|
+
registryPath: z.string().min(1).optional(),
|
|
97
110
|
outputPath: z.string().min(1).optional(),
|
|
98
111
|
projectRoot: z.string().min(1).optional(),
|
|
99
112
|
}).strict();
|
|
100
113
|
export const OntoValidateReconstructDirectiveToolInputSchema = z.discriminatedUnion("directiveKind", [
|
|
101
114
|
OntoValidateSourceObservationDirectiveToolInputSchema,
|
|
102
|
-
|
|
115
|
+
OntoValidateCandidateDispositionToolInputSchema,
|
|
116
|
+
OntoValidateOntologySeedToolInputSchema,
|
|
103
117
|
]);
|
|
104
118
|
export const OntoToolNames = [
|
|
105
119
|
"onto.review",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "onto-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "MCP-native ontology review runtime with context-isolated lenses and controlled deliberation",
|
|
5
5
|
"homepage": "https://github.com/kangminlee-maker/onto-mcp#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
"files": [
|
|
20
20
|
"bin/",
|
|
21
21
|
"dist/",
|
|
22
|
+
"scripts/onto-runtime-watch.sh",
|
|
23
|
+
"scripts/onto-review-watch.sh",
|
|
24
|
+
"scripts/postinstall-hint.js",
|
|
22
25
|
".onto/roles/",
|
|
23
26
|
".onto/domains/",
|
|
24
27
|
".onto/authority/",
|
|
@@ -30,27 +33,15 @@
|
|
|
30
33
|
],
|
|
31
34
|
"scripts": {
|
|
32
35
|
"prepare": "npm run build:ts-core",
|
|
33
|
-
"
|
|
36
|
+
"postinstall": "node scripts/postinstall-hint.js",
|
|
37
|
+
"clean:ts-core": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
38
|
+
"build:ts-core": "npm run clean:ts-core && tsc -p tsconfig.json",
|
|
34
39
|
"check:ts-core": "tsc -p tsconfig.json --noEmit",
|
|
35
40
|
"test:review:invocation-runner": "tsx scripts/review-invocation-runner-conformance.ts",
|
|
36
41
|
"test:mcp:review": "tsx scripts/mcp-review-conformance.ts",
|
|
37
42
|
"test:review:hardening": "tsx scripts/review-runtime-hardening.ts",
|
|
38
43
|
"test:e2e": "bash src/core-runtime/cli/e2e-review-invoke.test.sh",
|
|
39
|
-
"test:e2e:codex-multi-agent-fixes": "vitest run src/core-runtime/cli/e2e-codex-multi-agent-fixes.test.ts"
|
|
40
|
-
"review:prepare-session": "tsx src/core-runtime/cli/prepare-review-session.ts",
|
|
41
|
-
"review:materialize-prompt-packets": "tsx src/core-runtime/cli/materialize-review-prompt-packets.ts",
|
|
42
|
-
"review:start-session": "tsx src/core-runtime/cli/start-review-session.ts",
|
|
43
|
-
"review:run-prompt-execution": "tsx src/core-runtime/cli/run-review-prompt-execution.ts",
|
|
44
|
-
"review:mock-unit-executor": "tsx src/core-runtime/cli/mock-review-unit-executor.ts",
|
|
45
|
-
"review:codex-unit-executor": "tsx src/core-runtime/cli/codex-review-unit-executor.ts",
|
|
46
|
-
"review:inline-http-unit-executor": "tsx src/core-runtime/cli/inline-http-review-unit-executor.ts",
|
|
47
|
-
"review:invoke": "tsx src/core-runtime/cli/review-invoke.ts",
|
|
48
|
-
"review:watch": "bash scripts/onto-review-watch.sh",
|
|
49
|
-
"mcp:server": "tsx src/mcp/server.ts",
|
|
50
|
-
"review:render-final-output": "tsx src/core-runtime/cli/render-review-final-output.ts",
|
|
51
|
-
"review:finalize-session": "tsx src/core-runtime/cli/assemble-review-record.ts",
|
|
52
|
-
"review:complete-session": "tsx src/core-runtime/cli/complete-review-session.ts",
|
|
53
|
-
"review:assemble-record": "tsx src/core-runtime/cli/assemble-review-record.ts"
|
|
44
|
+
"test:e2e:codex-multi-agent-fixes": "vitest run src/core-runtime/cli/e2e-codex-multi-agent-fixes.test.ts"
|
|
54
45
|
},
|
|
55
46
|
"dependencies": {
|
|
56
47
|
"@anthropic-ai/sdk": "^0.99.0",
|