onto-mcp 0.3.1 → 0.3.2

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 (52) hide show
  1. package/.onto/authority/core-lexicon.yaml +1 -0
  2. package/.onto/domains/software-engineering/competency_qs.md +192 -63
  3. package/.onto/domains/software-engineering/concepts.md +67 -5
  4. package/.onto/domains/software-engineering/conciseness_rules.md +22 -2
  5. package/.onto/domains/software-engineering/dependency_rules.md +78 -8
  6. package/.onto/domains/software-engineering/domain_scope.md +181 -150
  7. package/.onto/domains/software-engineering/extension_cases.md +318 -542
  8. package/.onto/domains/software-engineering/logic_rules.md +75 -3
  9. package/.onto/domains/software-engineering/problem_framing_profile.md +29 -2
  10. package/.onto/domains/software-engineering/prompt_interface.md +122 -0
  11. package/.onto/domains/software-engineering/structure_spec.md +53 -4
  12. package/.onto/principles/llm-native-development-guideline.md +20 -0
  13. package/.onto/principles/productization-charter.md +6 -0
  14. package/.onto/processes/reconstruct/reconstruct-boundary-contract.md +278 -91
  15. package/.onto/processes/reconstruct/reconstruct-execution-ux-contract.md +45 -12
  16. package/.onto/processes/reconstruct/source-profile-contract.md +39 -6
  17. package/.onto/processes/reconstruct/top-level-concept-discovery-contract.md +387 -0
  18. package/.onto/processes/review/lens-registry.md +16 -0
  19. package/.onto/processes/shared/target-material-kind-contract.md +18 -2
  20. package/.onto/roles/axiology.md +7 -2
  21. package/AGENTS.md +3 -2
  22. package/README.md +39 -33
  23. package/dist/core-api/reconstruct-api.js +22 -5
  24. package/dist/core-api/review-api.js +1288 -533
  25. package/dist/core-runtime/cli/mock-review-unit-executor.js +17 -0
  26. package/dist/core-runtime/cli/review-invoke.js +23 -48
  27. package/dist/core-runtime/cli/run-review-prompt-execution.js +122 -0
  28. package/dist/core-runtime/path-boundary.js +58 -0
  29. package/dist/core-runtime/reconstruct/artifact-types.js +5 -0
  30. package/dist/core-runtime/reconstruct/materialize-preparation.js +54 -4
  31. package/dist/core-runtime/reconstruct/pipeline-execution-ledger.js +38 -2
  32. package/dist/core-runtime/reconstruct/post-seed-validation.js +13 -0
  33. package/dist/core-runtime/reconstruct/record.js +11 -0
  34. package/dist/core-runtime/reconstruct/run.js +1133 -26
  35. package/dist/core-runtime/reconstruct/seed-candidate-validation.js +29 -0
  36. package/dist/core-runtime/review/execution-plan-boundary.js +123 -0
  37. package/dist/core-runtime/review/materializers.js +8 -3
  38. package/dist/core-runtime/review/review-artifact-utils.js +15 -2
  39. package/dist/core-runtime/review/review-invocation-runner.js +604 -0
  40. package/dist/core-runtime/target-material-kind.js +43 -5
  41. package/dist/mcp/server.js +158 -39
  42. package/dist/mcp/tool-schemas.js +22 -2
  43. package/package.json +3 -1
  44. package/.onto/domains/llm-native-development/competency_qs.md +0 -430
  45. package/.onto/domains/llm-native-development/concepts.md +0 -242
  46. package/.onto/domains/llm-native-development/conciseness_rules.md +0 -163
  47. package/.onto/domains/llm-native-development/dependency_rules.md +0 -216
  48. package/.onto/domains/llm-native-development/domain_scope.md +0 -197
  49. package/.onto/domains/llm-native-development/extension_cases.md +0 -474
  50. package/.onto/domains/llm-native-development/logic_rules.md +0 -123
  51. package/.onto/domains/llm-native-development/prompt_interface.md +0 -49
  52. package/.onto/domains/llm-native-development/structure_spec.md +0 -245
@@ -56,7 +56,7 @@ Allowed values:
56
56
  | `spreadsheet` | Workbook, sheet, CSV, accounting schedule, formula model, report, or tabular calculation artifact. |
57
57
  | `document` | Prose, requirements, policy, guide, report, contract, PDF, DOCX, Markdown, or similar textual artifact. |
58
58
  | `database` | Database connection, schema, migration, SQL file, warehouse model, table, view, or query artifact. |
59
- | `mixed` | Bundle containing more than one material kind. Each member needs its own material classification. |
59
+ | `mixed` | Bundle containing more than one material kind. Each member needs its own material classification; `mixed` itself is not an adapter target. |
60
60
  | `unknown` | Runtime cannot classify the material safely. Adapter execution must halt or ask for clarification. |
61
61
 
62
62
  The axis is separate from:
@@ -77,6 +77,21 @@ The axis is separate from:
77
77
  | `reconstruct` | Source profiles, source adapters, source observations, and directive validation must be keyed by `target_material_kind`. |
78
78
  | `evolve` | Future adapters must not assume code-product inputs; adapter selection should start from `target_material_kind` as defined in `.onto/processes/evolve/material-kind-adapter-contract.md`. |
79
79
 
80
+ ### 4.1 Mixed Support Semantics
81
+
82
+ Because `mixed` is an allowed public value, every process that exposes it must
83
+ also expose one of these support states:
84
+
85
+ | Support state | Runtime behavior |
86
+ |---|---|
87
+ | `supported_composite` | Classify every member, dispatch only member-specific supported adapters, and preserve cross-material refs as structural refs. |
88
+ | `partial_composite` | Classify every member, observe supported members, record unsupported members and downstream authority impact. |
89
+ | `unsupported` | Halt or ask for clarification before adapter dispatch with a stable unsupported reason. |
90
+ | `reserved_future` | Treat `mixed` as non-executable vocabulary and do not expose it as a runnable path. |
91
+
92
+ No process may dispatch a single generic `mixed` adapter. Semantic
93
+ cross-material interpretation belongs to the LLM after runtime observation.
94
+
80
95
  ## 5. Artifact Contract Additions
81
96
 
82
97
  | Artifact | Required change |
@@ -120,7 +135,8 @@ Runtime must validate:
120
135
 
121
136
  - `target_material_kind` is one of the allowed values
122
137
  - `unknown` does not dispatch a material adapter
123
- - `mixed` records per-member material kinds
138
+ - `mixed` records per-member material kinds and one of the support states in
139
+ section 4.1 before adapter dispatch
124
140
  - unsupported formats halt or degrade explicitly
125
141
  - source observations do not claim ontology facts such as entity, relation,
126
142
  business rule, aggregate root, or policy meaning
@@ -61,12 +61,17 @@
61
61
 
62
62
  현재 lens set 에 빠진 purpose-critical 관점을 이 lens 가 발견하면 여기서 직접 제안한다. `synthesize` 는 이 제안을 보존할 수 있으나 독자적으로 발명할 수 없다. 이 slot 은 axiology 만 사용할 수 있는 의도적 canonical asymmetry 이다.
63
63
 
64
+ 이 slot 은 domain concern 을 active lens 로 승격하는 장치가 아니다. domain 문서의 concern
65
+ tag, CQ, case evidence 는 원칙적으로 기존 lens/CQ/domain-rule 경로로 소비된다.
66
+ New Perspectives 는 "현재 domain 이 새 lens 를 원한다"는 뜻이 아니라, review process
67
+ governance 에서 별도로 검토할 수 있는 목적상 미커버 관찰을 보존하는 출력이다.
68
+
64
69
  New Perspectives 제안 시 최소 필수 필드:
65
70
 
66
71
  1. **trigger condition** — 제안을 촉발한 증거 (대상 · 관찰 · authority 미커버 영역)
67
72
  2. **proposed perspective** — 무엇을 평가할 것인가 (1~2 문장 perspective 요약)
68
- 3. **insufficiency argument** — 기존 9 lens 각각이관점을 왜 커버하지 못하는지 명시
69
- 4. **intended receiving seat** — 제안이 착지해야 할 위치 (현재 review 의 `synthesize` 보존 / 후속 lens governance / axiology 내부 sub-check 등). 착지 seat 미지정 제안은 orphaned 로 간주하여 `synthesize` 가 거부할 수 있다
73
+ 3. **insufficiency argument** — 기존 9 lens, CQ, domain rule 경로가 관찰을충분히 커버하지 못하는지 명시
74
+ 4. **intended receiving seat** — 제안이 착지해야 할 위치 (현재 review 의 `synthesize` 보존 / 기존 lens·CQ·domain rule 보강 / 후속 lens governance / axiology 내부 sub-check 등). 착지 seat 미지정 제안은 orphaned 로 간주하여 `synthesize` 가 거부할 수 있다
70
75
 
71
76
  New Perspectives 제안은 현재 리뷰 실행의 active lens set 을 변경하지 않는다. 실제 lens set 확장은 별도 governance 경로를 통한다.
72
77
 
package/AGENTS.md CHANGED
@@ -61,8 +61,9 @@ target material 관련 작업 시 추가로 읽을 문서:
61
61
 
62
62
  1. [reconstruct-boundary-contract.md](/Users/kangmin/cowork/onto-mcp/.onto/processes/reconstruct/reconstruct-boundary-contract.md)
63
63
  2. [reconstruct-execution-ux-contract.md](/Users/kangmin/cowork/onto-mcp/.onto/processes/reconstruct/reconstruct-execution-ux-contract.md)
64
- 3. [source-profile-contract.md](/Users/kangmin/cowork/onto-mcp/.onto/processes/reconstruct/source-profile-contract.md)
65
- 4. selected source profile under `.onto/processes/reconstruct/source-profiles/`
64
+ 3. [top-level-concept-discovery-contract.md](/Users/kangmin/cowork/onto-mcp/.onto/processes/reconstruct/top-level-concept-discovery-contract.md)
65
+ 4. [source-profile-contract.md](/Users/kangmin/cowork/onto-mcp/.onto/processes/reconstruct/source-profile-contract.md)
66
+ 5. selected source profile under `.onto/processes/reconstruct/source-profiles/`
66
67
 
67
68
  ---
68
69
 
package/README.md CHANGED
@@ -36,17 +36,17 @@ cross-process goal contract lives at
36
36
 
37
37
  `reconstruct` now has a current design contract under
38
38
  `.onto/processes/reconstruct/`, material-aware runtime helpers, and a bounded
39
- happy-path runner. The runner classifies target material, writes source
40
- observations, accepts pluggable LLM-owned directive authors and confirmation
41
- providers, validates evidence refs, computes deterministic metrics, and writes
39
+ direct-call integral runner. The runner classifies target material, expands
40
+ directory targets into per-member source observations, writes the initial source
41
+ frontier, runs reconstruct lens judgments and exploration synthesis through a
42
+ configured LLM provider, validates evidence refs, computes deterministic metrics, and writes
42
43
  `final-output.md`, `reconstruct-run-manifest.yaml`, and the primary
43
44
  `reconstruct-record.yaml`. Code is the first fixture; the runner path is shared
44
45
  with spreadsheet/document/database material through source profiles and
45
- material-specific observers. The current public run path is an explicit mock
46
- semantic/confirmation post-Seed artifact loop. It implements claim realization,
47
- confirmation validation, competency-question assessment, failure classification,
48
- revision proposal, metrics/status projection, and artifact-tethered final
49
- output; domain context selection remains deferred.
46
+ material-specific observers. The current public run path defaults to
47
+ `direct_call` semantic authoring and host-mediated confirmation. It fails loud
48
+ when provider/model/credentials, LLM-authored artifact shape, or runtime gates
49
+ are invalid; domain context selection remains deferred.
50
50
  `evolve` has a future material-kind adapter contract at
51
51
  `.onto/processes/evolve/material-kind-adapter-contract.md`, but no active
52
52
  runtime or MCP tool. `learn` and `govern` remain separate design slices.
@@ -87,7 +87,7 @@ Available MCP tools:
87
87
  | `onto.list_source_profiles` | List reconstruct source profiles |
88
88
  | `onto.observe_source` | Materialize reconstruct material profile, inventory, source observations, and initial record |
89
89
  | `onto.validate_reconstruct_directive` | Validate LLM-authored reconstruct directive files |
90
- | `onto.reconstruct` | Run the material-aware reconstruct post-Seed loop with explicit mock semantic/confirmation realization |
90
+ | `onto.reconstruct` | Run the material-aware direct-call reconstruct path with runtime validation gates |
91
91
  | `onto.reconstruct_status` | Read reconstruct session status, progress, counts, and artifact refs |
92
92
  | `onto.reconstruct_result` | Read `reconstruct-record.yaml`, run manifest, progress projection, and final output |
93
93
 
@@ -104,18 +104,15 @@ Minimal reconstruct MCP call shape:
104
104
  "projectRoot": "/path/to/project",
105
105
  "targetRefs": ["src/example.ts"],
106
106
  "intent": "Create a bounded reconstruct Seed from this target.",
107
- "sessionRoot": ".onto/reconstruct/example-run",
108
- "semanticAuthorRealization": "mock",
109
- "confirmationProviderRealization": "mock"
107
+ "sessionRoot": ".onto/reconstruct/example-run"
110
108
  }
111
109
  }
112
110
  ```
113
111
 
114
- `semanticAuthorRealization` and `confirmationProviderRealization` are required
115
- so completed reconstruct runs are explicit about their current mock semantics.
116
- Today this proves the material-aware post-Seed artifact loop, runtime gates, and
117
- MCP surface. It does not claim live host-LLM semantic authorship or live
118
- user-mediated confirmation.
112
+ `semanticAuthorRealization` and `confirmationProviderRealization` default to
113
+ `direct_call`. Configure `.onto/settings.json` or user `~/.onto/settings.json`
114
+ with an `llm` provider/model before running. Test-only mock helpers are not
115
+ product completion evidence.
119
116
 
120
117
  Repository-local development harness:
121
118
 
@@ -238,44 +235,53 @@ Primary outputs:
238
235
 
239
236
  A reconstruct session writes artifacts under `.onto/reconstruct/<session-id>/`.
240
237
 
241
- Implemented mock-authored, runtime-gated outputs:
238
+ Implemented direct-call, runtime-gated outputs:
242
239
 
243
240
  | Artifact | Owner | Purpose |
244
241
  |---|---|---|
245
242
  | `target-material-profile.yaml` | runtime | detected `target_material_kind`, support status, and selected source profiles |
246
243
  | `source-inventory.yaml` | runtime | material-specific inventory units and scan boundary |
244
+ | `initial-source-frontier.yaml` | runtime | first observation frontier derived from inventory |
247
245
  | `source-observations.yaml` | runtime | structural observations with stable evidence ids |
248
- | `source-observation-directive.yaml` | mock/host author | selected observations for evidence use |
246
+ | `source-observation-directive.yaml` | host LLM author | selected observations for evidence use |
249
247
  | `source-observation-directive-validation.yaml` | runtime | validation of selected observation refs |
250
- | `seed-candidate.yaml` | mock/host author | evidence-backed Seed candidate |
251
- | `seed-candidate-validation.yaml` | runtime | Seed claim and evidence-ref validation |
252
- | `claim-realization-map.yaml` | mock/host author | claim-level evidence stance |
248
+ | `rounds/<round-id>/lens-judgments/*.yaml` | host LLM author | reconstruct lens judgments over trusted observations |
249
+ | `rounds/<round-id>/exploration-synthesis.yaml` | host LLM author | integrated gaps and next-source needs |
250
+ | `rounds/<round-id>/source-frontier.yaml` | host LLM author | requested next source refs or no-next-frontier rationale |
251
+ | `rounds/<round-id>/source-frontier-validation.yaml` | runtime | boundary, duplicate, and inventory validation for the frontier |
252
+ | `seed-candidate.yaml` | host LLM author | evidence-backed Seed candidate with separate `claim_id` and user-facing `name` |
253
+ | `seed-candidate-validation.yaml` | runtime | Seed claim name, shape, and evidence-ref validation |
254
+ | `claim-realization-map.yaml` | host LLM author | claim-level evidence stance |
253
255
  | `claim-realization-map-validation.yaml` | runtime | claim id, stance enum, and evidence linkage validation |
254
- | `seed-confirmation.yaml` | mock/host/user mediated | accepted, rejected, partial, or deferred Seed confirmation |
256
+ | `seed-confirmation.yaml` | host/user mediated | accepted, rejected, partial, or deferred Seed confirmation |
255
257
  | `seed-confirmation-validation.yaml` | runtime | confirmation transition validation and derived claim sets |
256
- | `competency-questions.yaml` | mock/host author | questions linked to confirmed claims |
257
- | `competency-questions-validation.yaml` | runtime | CQ id, claim-link, and evidence validation |
258
- | `competency-question-assessment.yaml` | mock/host author | answer status for every authoritative CQ |
258
+ | `competency-questions.yaml` | host LLM author | questions linked to confirmed claims |
259
+ | `competency-questions-validation.yaml` | runtime | CQ id, eligible-claim coverage, claim-link, and evidence validation |
260
+ | `competency-question-assessment.yaml` | host LLM author | answer status for every authoritative CQ |
259
261
  | `competency-question-assessment-validation.yaml` | runtime | exactly-once CQ assessment validation |
260
- | `failure-classification.yaml` | mock/host author | material failure and gap classification |
262
+ | `failure-classification.yaml` | host LLM author | material failure and gap classification |
261
263
  | `failure-classification-validation.yaml` | runtime | failure enum, linkage, and materiality validation |
262
- | `revision-proposal.yaml` | mock/host author | bounded revision/deferral proposals |
264
+ | `revision-proposal.yaml` | host LLM author | bounded revision/deferral proposals |
263
265
  | `revision-proposal-validation.yaml` | runtime | proposal id, target, action, and regression guard validation |
264
266
  | `reconstruct-metrics.yaml` | runtime | deterministic counts, unresolved/deferred counts, and pass rate |
265
- | `stop-decision.yaml` | mock/host author | stop, continue, or ask-user decision based on metrics |
266
- | `final-output.md` | mock/host author | user-facing result grounded in artifacts and provenance-checked by runtime |
267
+ | `stop-decision.yaml` | host LLM author | stop, continue, or ask-user decision based on metrics |
268
+ | `final-output.md` | host LLM author | user-facing result grounded in artifacts and provenance-checked by runtime |
267
269
  | `reconstruct-run-manifest.yaml` | runtime | step refs, `performed_by` provenance, execution profile, and happy-path scope |
268
270
  | `reconstruct-record.yaml` | runtime | primary structured reconstruct artifact |
269
271
 
270
272
  Current deferred reconstruct artifacts are recorded in
271
273
  `reconstruct-run-manifest.yaml` under `happy_path_scope.deferred_artifacts`:
272
274
  `domain_context_selection` and `domain_context_selection_validation`. Those
273
- require additional domain selection semantics and are outside the current mock
274
- path.
275
+ require additional domain selection semantics and are outside the current
276
+ direct-call path.
275
277
 
276
- The post-Seed design contract also defines validation artifacts for those
278
+ The reconstruct design contract also defines validation artifacts for those
277
279
  stages, stable reconstruct stage ids, cross-artifact id authority, and progress
278
280
  UX expectations in `.onto/processes/reconstruct/reconstruct-execution-ux-contract.md`.
281
+ Seed discovery is further constrained by
282
+ `.onto/processes/reconstruct/top-level-concept-discovery-contract.md`, which
283
+ defines the Seed as a purpose-relative top-level concept discovery artifact
284
+ rather than a full ontology or broad claim ledger.
279
285
 
280
286
  ## Repository Map
281
287
 
@@ -5,7 +5,9 @@ import { parse as parseYaml } from "yaml";
5
5
  import { RECONSTRUCT_STAGE_IDS, } from "../core-runtime/reconstruct/artifact-types.js";
6
6
  import { materializeReconstructPreparationArtifacts, } from "../core-runtime/reconstruct/materialize-preparation.js";
7
7
  import { assembleReconstructRecord, } from "../core-runtime/reconstruct/record.js";
8
- import { createAutoAcceptReconstructConfirmationProvider, createMockReconstructDirectiveAuthor, runReconstruct, } from "../core-runtime/reconstruct/run.js";
8
+ import { createAutoAcceptReconstructConfirmationProvider, createDirectCallReconstructConfirmationProvider, createDirectCallReconstructDirectiveAuthor, createMockReconstructDirectiveAuthor, runReconstruct, } from "../core-runtime/reconstruct/run.js";
9
+ import { resolveSettingsChain, } from "../core-runtime/discovery/settings-chain.js";
10
+ import { resolveLlmProviderConfig, } from "../core-runtime/llm/llm-caller.js";
9
11
  import { writeSeedCandidateValidationArtifact, } from "../core-runtime/reconstruct/seed-candidate-validation.js";
10
12
  import { writeSourceObservationDirectiveValidationArtifact, } from "../core-runtime/reconstruct/directive-validation.js";
11
13
  import { loadReconstructSourceProfiles, } from "../core-runtime/reconstruct/source-profiles.js";
@@ -92,11 +94,14 @@ function deriveReconstructProgress(args) {
92
94
  : "pending",
93
95
  owner: step?.owner ?? null,
94
96
  artifactRefs: step?.artifact_refs ?? [],
97
+ reason: step?.reason ?? null,
98
+ authorityImpact: step?.authority_impact ?? null,
95
99
  };
96
100
  });
97
101
  const lastReachedStage = [...stages].reverse().find((stage) => stage.state !== "pending") ??
98
102
  stages[0];
99
103
  return {
104
+ executionProfile: args.runManifest?.execution_profile ?? null,
100
105
  currentStageId: lastReachedStage.stageId,
101
106
  stageCount: RECONSTRUCT_STAGE_IDS.length,
102
107
  liveness: {
@@ -133,6 +138,7 @@ function recordArtifactRefsFromPreparation(refs) {
133
138
  return {
134
139
  target_material_profile: refs.target_material_profile,
135
140
  source_inventory: refs.source_inventory,
141
+ initial_source_frontier: refs.initial_source_frontier,
136
142
  source_observations: refs.source_observations,
137
143
  };
138
144
  }
@@ -197,16 +203,27 @@ export function createOntoReconstructCoreApi(options = {}) {
197
203
  ...(ontoHome ? { ontoHome } : {}),
198
204
  });
199
205
  const targetRefs = request.targetRefs.map((targetRef) => resolveFromBase(projectRoot, targetRef));
206
+ const settings = await resolveSettingsChain(ontoHome ?? projectRoot, projectRoot);
207
+ const llmConfig = resolveLlmProviderConfig({ config: settings });
208
+ const semanticAuthorRealization = request.semanticAuthorRealization ?? "direct_call";
209
+ const confirmationProviderRealization = request.confirmationProviderRealization ?? "direct_call";
210
+ const directiveAuthor = semanticAuthorRealization === "mock"
211
+ ? createMockReconstructDirectiveAuthor()
212
+ : createDirectCallReconstructDirectiveAuthor({ llmConfig });
213
+ const confirmationProvider = confirmationProviderRealization === "mock"
214
+ ? createAutoAcceptReconstructConfirmationProvider()
215
+ : createDirectCallReconstructConfirmationProvider({ llmConfig });
200
216
  return runReconstruct({
201
217
  projectRoot,
202
218
  targetRefs,
203
219
  intent: request.intent,
204
220
  sessionRoot,
205
221
  profilesRoot,
206
- semanticAuthorRealization: request.semanticAuthorRealization,
207
- confirmationProviderRealization: request.confirmationProviderRealization,
208
- directiveAuthor: createMockReconstructDirectiveAuthor(),
209
- confirmationProvider: createAutoAcceptReconstructConfirmationProvider(),
222
+ semanticAuthorRealization,
223
+ confirmationProviderRealization,
224
+ directiveAuthor,
225
+ confirmationProvider,
226
+ llmConfig,
210
227
  filesystemAllowedRoots: request.filesystemAllowedRoots?.map((root) => resolveFromBase(projectRoot, root)) ??
211
228
  [projectRoot],
212
229
  });