@prodero/curator 0.0.0-stage → 0.1.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/ARCHITECTURE.md +298 -0
- package/CHANGELOG.md +16 -0
- package/CONTRIBUTING.md +9 -0
- package/LICENSE +21 -0
- package/README.md +94 -2
- package/SECURITY.md +7 -0
- package/bin/prodero +7 -0
- package/dist/cli.js +228 -0
- package/dist/context-instructions.js +2 -0
- package/dist/contracts.js +50 -0
- package/dist/conversation-presentation.js +262 -0
- package/dist/core/agent-instructions.js +39 -0
- package/dist/core/applicability-label.js +11 -0
- package/dist/core/applicability.js +143 -0
- package/dist/core/bootstrap.js +129 -0
- package/dist/core/consolidation.js +315 -0
- package/dist/core/constants.js +21 -0
- package/dist/core/context-allocation.js +54 -0
- package/dist/core/context-snapshot.js +12 -0
- package/dist/core/context.js +489 -0
- package/dist/core/curation-clauses.js +68 -0
- package/dist/core/curation-evidence.js +98 -0
- package/dist/core/curation-graphical.js +105 -0
- package/dist/core/curation-review-presentation.js +4 -0
- package/dist/core/curation-review-state.js +62 -0
- package/dist/core/curation-review.js +573 -0
- package/dist/core/curation-revision.js +106 -0
- package/dist/core/curation-semantic-contract.js +239 -0
- package/dist/core/curation-semantic-jobs.js +280 -0
- package/dist/core/diagnostics.js +17 -0
- package/dist/core/format.js +114 -0
- package/dist/core/ids.js +6 -0
- package/dist/core/imports.js +169 -0
- package/dist/core/index.js +93 -0
- package/dist/core/instruction-review.js +86 -0
- package/dist/core/integrity-files.js +174 -0
- package/dist/core/intelligence.js +95 -0
- package/dist/core/knowledge-analysis.js +46 -0
- package/dist/core/knowledge-authority.js +143 -0
- package/dist/core/knowledge-curation.js +316 -0
- package/dist/core/knowledge-engine.js +475 -0
- package/dist/core/knowledge-graph.js +191 -0
- package/dist/core/knowledge-lifecycle.js +212 -0
- package/dist/core/knowledge-management.js +113 -0
- package/dist/core/knowledge-migration.js +84 -0
- package/dist/core/knowledge-policy.js +38 -0
- package/dist/core/knowledge-provenance.js +90 -0
- package/dist/core/knowledge-write-policy.js +85 -0
- package/dist/core/language.js +14 -0
- package/dist/core/matching.js +6 -0
- package/dist/core/memory-index.js +239 -0
- package/dist/core/memory-intelligence.js +288 -0
- package/dist/core/memory-link-repair.js +66 -0
- package/dist/core/memory-operations.js +122 -0
- package/dist/core/memory-pressure.js +212 -0
- package/dist/core/memory-sync-curator.js +62 -0
- package/dist/core/memory-sync.js +463 -0
- package/dist/core/memory-transformation-bundle.js +163 -0
- package/dist/core/memory-transformation-proposal.js +135 -0
- package/dist/core/memory-transformation.js +108 -0
- package/dist/core/memory.js +186 -0
- package/dist/core/migrations.js +569 -0
- package/dist/core/path-scope.js +27 -0
- package/dist/core/plugin-files.js +116 -0
- package/dist/core/project-root.js +39 -0
- package/dist/core/project.js +634 -0
- package/dist/core/promotion.js +279 -0
- package/dist/core/reconciliation.js +61 -0
- package/dist/core/secrets.js +67 -0
- package/dist/core/semantic-safety.js +33 -0
- package/dist/core/session-index.js +112 -0
- package/dist/core/session-review.js +150 -0
- package/dist/core/sessions.js +289 -0
- package/dist/core/settings.js +76 -0
- package/dist/core/skill-curation.js +239 -0
- package/dist/core/skill-polish.js +41 -0
- package/dist/core/skills.js +368 -0
- package/dist/core/storage.js +408 -0
- package/dist/core/sync-transaction.js +254 -0
- package/dist/core/telemetry.js +64 -0
- package/dist/core/templates.js +53 -0
- package/dist/core/types.js +2 -0
- package/dist/core/update.js +320 -0
- package/dist/curation-review-adapter.js +92 -0
- package/dist/diagnostic-boundary.js +54 -0
- package/dist/filesystem/permissions.js +39 -0
- package/dist/hosts/adapters.js +119 -0
- package/dist/hosts/files.js +133 -0
- package/dist/hosts/manager.js +150 -0
- package/dist/hosts/public-entry.js +47 -0
- package/dist/hosts/runtime-command.js +66 -0
- package/dist/hosts/runtime.js +139 -0
- package/dist/hosts/wizard.js +114 -0
- package/dist/knowledge-table.js +38 -0
- package/dist/mcp-development.js +69 -0
- package/dist/mcp-workspace.js +141 -0
- package/dist/memory-presentation.js +172 -0
- package/dist/plugins/api.js +2 -0
- package/dist/plugins/context.js +20 -0
- package/dist/plugins/mcp.js +72 -0
- package/dist/plugins/registry.js +106 -0
- package/dist/presentation-cards.js +32 -0
- package/dist/presentation-server.js +79 -0
- package/dist/presentation-trace.js +174 -0
- package/dist/presentation.js +412 -0
- package/dist/providers/mcp-sampling.js +45 -0
- package/dist/server.js +656 -0
- package/dist/settings-definition.js +22 -0
- package/dist/skill-instructions.js +2 -0
- package/dist-ui/index.html +214 -0
- package/docs/APPLICABILITY.md +151 -0
- package/docs/COMPATIBILITY.md +49 -0
- package/docs/CONTEXT-SELECTION-V2.md +61 -0
- package/docs/CURATION-APP-REVIEW.md +156 -0
- package/docs/CURATION-CLAUSE-REFINEMENT.md +45 -0
- package/docs/IMPORTER-CURATION.md +142 -0
- package/docs/KNOWLEDGE-AUTHORITY.md +165 -0
- package/docs/KNOWLEDGE-SCHEMA-V2.md +150 -0
- package/docs/MIGRATIONS.md +99 -0
- package/docs/PRIVACY.md +28 -0
- package/docs/RECOVERY.md +56 -0
- package/docs/RELEASING.md +40 -0
- package/docs/hosts.md +134 -0
- package/docs/plugins.md +83 -0
- package/docs/ui-themes.md +43 -0
- package/instructions/AGENTS.md +33 -0
- package/package.json +88 -4
- package/plugins/migrate_ai_studio/README.md +101 -0
- package/plugins/migrate_ai_studio/index.cjs +396 -0
- package/plugins/migrate_ai_studio/instructions/audit.md +25 -0
- package/plugins/migrate_ai_studio/instructions/classify.md +41 -0
- package/plugins/migrate_ai_studio/instructions/migrate.md +34 -0
- package/plugins/migrate_ai_studio/instructions/verify.md +20 -0
- package/plugins/migrate_ai_studio/plugin.json +11 -0
- package/plugins/migrate_ai_studio/schema.cjs +20 -0
- package/plugins/migrate_ai_studio/ui/dist/index.html +77 -0
- package/prodero.release.json +5 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Applicability and task context
|
|
2
|
+
|
|
3
|
+
## 1. Previous scope model audit
|
|
4
|
+
|
|
5
|
+
The audit preceded implementation. The existing scope mechanism is extended; canonical knowledge, catalog, context engine and authority boundary remain the same.
|
|
6
|
+
|
|
7
|
+
| Area | Previous behavior and distinction | Implementation reference |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| Markdown | `scope` (`global`, `module`, `task`), nullable `scope_ref` and optional `scope_kind` persisted. The public `project`/`path` names were adapters, not additional canonical scopes. | `src/core/memory.ts:29` |
|
|
10
|
+
| Paths | `scope_kind: path` made even a bare name such as `docs` a path. An untagged module reference containing `/` or `.` was interpreted as a path. Other module references were topics. Exact/descendant matching used relative paths; a bare directory in prose was not path evidence. | `src/core/path-scope.ts:4` |
|
|
11
|
+
| Required | Global was always applicable. Module topics used exact/prefix query matching; task scopes used token overlap. Paths used the path matcher. Policy, not category, already selected required records after explicit context policy was introduced. | `src/core/bootstrap.ts:18`; historical behavior now in `applicability.ts:123` |
|
|
12
|
+
| Relevant | Non-path scope used lexical ranking; path mismatch excluded records. Thus Required and Relevant did not have identical scope semantics. | `src/core/context.ts:108` |
|
|
13
|
+
| Remember | Public project/global both mapped to canonical global, but used priority to distinguish topic retrieval from global guidance. Path mapped to module + explicit path kind. | `src/core/project.ts:519` |
|
|
14
|
+
| Observations / Sync | Scope hints and section defaults supplied candidate boundaries. Deterministic consolidation, assisted validation and catalog neighbor discovery compared legacy scope fields. | `src/core/sessions.ts:165`, `consolidation.ts`, `knowledge-engine.ts:35`, `memory-index.ts` |
|
|
15
|
+
| Other writers | Imports mapped source scope; transformations and replacements inherited source metadata; publication copied canonical records. Maintenance exposed legacy scope fields. Their authority ceiling came from the knowledge authority transaction gate. | `imports.ts:100`, `knowledge-lifecycle.ts:167`, `promotion.ts`, `knowledge-management.ts`, `knowledge-write-policy.ts` |
|
|
16
|
+
| Presentation / cache | Catalog summaries carried scope fields. Prepare snapshots retained the result, Open had its own bootstrap selector, UI/text showed scope labels. | `memory-index.ts`, `context-snapshot.ts`, `bootstrap.ts:90`, `src/presentation.ts`, `src/ui/main.ts` |
|
|
17
|
+
|
|
18
|
+
The hidden conventions were path-shaped references, task token matching, topic matching that differed by retrieval bucket, and the public project/global priority mapping. `scope_kind` was optional canonical metadata, not evidence of user authorization.
|
|
19
|
+
|
|
20
|
+
## 2. Final canonical model and version decision
|
|
21
|
+
|
|
22
|
+
Knowledge Schema **3**, project schema **8** (see `prodero.release.json`). Knowledge applicability was introduced with the schema-6 migration foundation. The bump is necessary: a v2 reader/writer cannot preserve or enforce structured applicability. The existing Migration Foundation provides the compatibility barrier, planner, approval, staging, backup, validation, history and recovery. No parallel migration path exists.
|
|
23
|
+
|
|
24
|
+
The independent dimensions are:
|
|
25
|
+
|
|
26
|
+
- category: the kind of knowledge;
|
|
27
|
+
- context_policy: required or relevance-driven delivery;
|
|
28
|
+
- authority: provenance classification, not a capability;
|
|
29
|
+
- applicability: the conditions under which this knowledge applies;
|
|
30
|
+
- priority: importance, independent of scope;
|
|
31
|
+
- relevance: runtime task usefulness, not persisted policy.
|
|
32
|
+
|
|
33
|
+
Canonical frontmatter example:
|
|
34
|
+
|
|
35
|
+
```yaml
|
|
36
|
+
version: 3
|
|
37
|
+
context_policy: required
|
|
38
|
+
authority: legacy_inherited
|
|
39
|
+
applicability: {"kind":"scoped","subsystems":["ExampleAPI"],"taskKinds":["testing"]}
|
|
40
|
+
scope: module
|
|
41
|
+
scope_ref: ExampleAPI
|
|
42
|
+
scope_kind: topic
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Supported applicability forms:
|
|
46
|
+
|
|
47
|
+
| Form | Meaning |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| `{kind: "project"}` | Applies throughout the project. |
|
|
50
|
+
| `{kind: "scoped", paths?, subsystems?, taskKinds?}` | At least one non-empty restriction. |
|
|
51
|
+
| `{kind: "unresolved"}` | Insufficient evidence to assign a work boundary. Ordinary relevant knowledge remains retrievable. No invented global assertion. Valid only for relevant records; required records must state a boundary. |
|
|
52
|
+
| `{kind: "legacy"}` | Preserve the exact existing scope/ref/kind behavior, including the old difference between Required and Relevant. Used by mechanical migration and compatibility adapters. |
|
|
53
|
+
|
|
54
|
+
For structured forms, scope/ref/kind are a deterministic compatibility projection, validated on read. They are not an independent second applicability source. Project projects to global; scoped uses its first path, otherwise first subsystem, otherwise task kinds. Legacy retains the original fields verbatim. Empty scoped metadata, missing v3 applicability, invalid paths or conflicting projection fail validation.
|
|
55
|
+
|
|
56
|
+
## 3. Combination and path semantics
|
|
57
|
+
|
|
58
|
+
Dimensions combine with **AND**; alternatives inside each array combine with **OR**. ExampleAPI + testing means both conditions, not either one. Multiple paths provide explicit alternative targets. Task kinds are implementation, testing, migration, deployment, documentation, review and debugging.
|
|
59
|
+
|
|
60
|
+
Paths are case-sensitive repository-relative exact/descendant boundaries. An optional terminal `/**` is supported; arbitrary wildcard expressions, absolute paths and parent traversal are not. There are no nested boolean expressions, negation or general policy language. Topics are case-insensitive subsystem labels.
|
|
61
|
+
|
|
62
|
+
## 4. Task Context and evidence
|
|
63
|
+
|
|
64
|
+
`buildTaskContext` runs once per context resolution. It carries task text, paths, subsystems, task kinds, a documentation-only focus and signal provenance. Optional MCP/Core `taskContext` accepts paths, subsystems, taskKinds and explicitTopics; agents supply these when known, not through user forms.
|
|
65
|
+
|
|
66
|
+
Evidence includes explicit arguments, quoted/path-shaped references, activity wording, known canonical subsystem labels, and technical identifiers. A known bare path supplied as the whole task is recognized. An incidental unfamiliar CamelCase identifier is only a hint: it cannot by itself prove that a different subsystem is excluded. An explicit or known-vocabulary subsystem can establish a different task focus. README/documentation wording does not count as implementation merely because it says “update”.
|
|
67
|
+
|
|
68
|
+
Prepare stores this context in its session. Observations may supply stronger work signals later. Explicitly retrying Prepare with the same session refreshes the context for future observations; already returned context snapshots are not mutated. No filesystem watcher, automatic repository-wide scan or hidden mid-turn context delivery is introduced.
|
|
69
|
+
|
|
70
|
+
## 5. Tri-state applicability and unknown required policies
|
|
71
|
+
|
|
72
|
+
The evaluator returns `applicable`, `not_applicable` or `unknown`, with reasons and matched dimensions. A known mismatch makes an AND expression not applicable; otherwise an unresolved dimension makes it unknown.
|
|
73
|
+
|
|
74
|
+
Required selection is policy → applicability → existing ranking/budget selection. Relevance cannot make a known applicable required policy optional. Existing token budgets, overflow behavior and item ceilings are unchanged.
|
|
75
|
+
|
|
76
|
+
For **structured required** knowledge:
|
|
77
|
+
|
|
78
|
+
- applicable enters Required candidates;
|
|
79
|
+
- not applicable is excluded from both delivery buckets;
|
|
80
|
+
- unknown does not silently disappear or become global. It produces `policyReadiness: {state: "context-needed", blocking: true}` and bounded diagnostic metadata. The agent enriches taskContext from actual work evidence and retries Prepare, preferably with the same session ID.
|
|
81
|
+
|
|
82
|
+
This readiness interruption is **not policy review or an approval request**. Required bodies are not all loaded to resolve uncertainty. If evidence genuinely remains unavailable, Core does not claim that work is ready; a host cannot safely guarantee automatic continuation. Unknown disputed required records receive the same protection. Explicit required conflicts keep the distinct existing `review-required` state.
|
|
83
|
+
|
|
84
|
+
Legacy records retain their old bucket behavior. In particular, a legacy scoped instruction that did not enter Required can still be retrieved through the historical relevant path. The migration does not reinterpret that behavior.
|
|
85
|
+
|
|
86
|
+
## 6. Relevant retrieval and explainability
|
|
87
|
+
|
|
88
|
+
Known unrelated paths/subsystems/activity exclude structured records. Matching dimensions contribute a relevance signal. Unknown relevant records can still match lexical evidence; a graph edge alone cannot admit unknown *restricted* scope with no lexical match. Unresolved ordinary knowledge can use normal lexical/graph retrieval because no specific boundary was asserted.
|
|
89
|
+
|
|
90
|
+
Selection metadata and snapshots retain applicability decisions. Knowledge Details can evaluate a supplied task. UI View Context and text Details show the human label and decision reasons: matched subsystem/task kind, paths outside a boundary, or missing signals with the expected boundary. Diagnostics are bounded; records outside that window remain inspectable through paginated Knowledge details. No permanent scope-management section was added to Open.
|
|
91
|
+
|
|
92
|
+
Open without a task loads project-wide required records and legacy global records. Scoped policies remain available to Prepare; bootstrap metrics include their count, without dumping their bodies or adding recurring controls.
|
|
93
|
+
|
|
94
|
+
## 7. Automatic creation and authority ceiling
|
|
95
|
+
|
|
96
|
+
Remember and ordinary session observations infer applicability from their content and producing task context. Paths and subsystem identifiers take precedence when present; otherwise session activity/context is used. With no justified restriction, relevant knowledge gets unresolved applicability. Explicit project/global input is still supported but no longer sets priority. Explicit path input produces structured path applicability.
|
|
97
|
+
|
|
98
|
+
The in-process invocation-local grant binds an exact operation; it does not authenticate a person. The current chat adapter can create that grant from model-supplied `required:true`, `kind:rule` and `userInstruction`, and the App adapter from validated review state. These are workflow safeguards under the [v0.1 trust model](PRIVACY.md). Ordinary inferred observations cannot directly set protected policy. Ambiguous inferred rules remain relevant/inferred.
|
|
99
|
+
|
|
100
|
+
Legacy scope hints on existing clients/observations remain compatibility inputs. They are not permission to widen protected knowledge. Global instruction candidates remain pending, and skill candidates keep their separate existing scope model.
|
|
101
|
+
|
|
102
|
+
`evaluateKnowledgeTransition` remains the central gate. Applicable boundary identity is now part of its trusted operation binding, protected-clause equivalence, source ceilings and replacement checks:
|
|
103
|
+
|
|
104
|
+
- inferred relevant records can narrow to a provable subset with existing provenance;
|
|
105
|
+
- path → project, subsystem → project, dropping a task restriction, or changing an authoritative boundary cannot happen through inference;
|
|
106
|
+
- authoritative narrowing is also protected against accidental de-escalation;
|
|
107
|
+
- invalid/ambiguous mutations preserve the original and use the existing safe-fallback/deferred-review behavior;
|
|
108
|
+
- a new inferred replacement cannot union incomparable source boundaries, and an uncovered source is not retired.
|
|
109
|
+
|
|
110
|
+
The subset proof is structural, not a claim that an LLM proved semantic equivalence. No new authorization mechanism or automatic promotions are introduced.
|
|
111
|
+
|
|
112
|
+
## 8. Writer and lifecycle coverage
|
|
113
|
+
|
|
114
|
+
| Path | Applicability behavior |
|
|
115
|
+
| --- | --- |
|
|
116
|
+
| Remember | Structured applicability or silent inference; replacement defaults to source applicability; policy remains governed by knowledge authority. |
|
|
117
|
+
| Session recording | Persists inferred applicability with each ordinary observation and keeps its existing session/observation provenance. Later explicit work signals can narrow new observations. |
|
|
118
|
+
| Session review | Preserves structured applicability on prose edits; legacy projection edits cannot silently change structured boundaries. Instruction/skill candidate transitions retain their separate lifecycle. |
|
|
119
|
+
| Deterministic Sync | Exact applicability is part of matching. Same content/same boundary deduplicates; overlapping or disjoint different boundaries stay separate. |
|
|
120
|
+
| Assisted Sync/audit | Canonical validation compares applicability with source boundaries after model output. Omitted optional fields inherit source metadata. Incompatible merges are rejected before canonical mutation. |
|
|
121
|
+
| Memory Transformation/lifecycle | Source applicability is inherited; proposals can carry structured metadata. Mixed-boundary consolidation preserves originals instead of creating a broader aggregate. Clean local operations remain automatic. |
|
|
122
|
+
| Imports | Explicit structural applicability or path/topic source metadata is preserved. Otherwise ordinary inference/unresolved fallback. New imported instructions remain relevant/imported. The keyword classifier is unchanged. |
|
|
123
|
+
| Replacement/supersession | Source ceiling and protected-clause checks include applicability. Incompatible retirement cannot erase the original boundary. |
|
|
124
|
+
| Publication | Canonical applicability is copied; matching/merge checks include it. Publication approval confers no policy/applicability authority. |
|
|
125
|
+
| Maintenance/optimization | Prose edits preserve applicability. Structured changes use the same central gate. Duplicate optimization groups include applicability, not only the first projected path/topic. |
|
|
126
|
+
|
|
127
|
+
## 9. Compatibility, migration, cache and presentation
|
|
128
|
+
|
|
129
|
+
Production registry step `knowledge-applicability-2-3` mechanically adds `{kind:"legacy"}` and changes record version. It preserves content, category, context policy, authority, lifecycle status, original scope, priority, provenance and relationships in both active and archive stores, Local and Versioned. It does not inspect bodies to infer a subsystem or task kind. Existing global records therefore retain their scope.
|
|
130
|
+
|
|
131
|
+
The Foundation performs read-only planning, explicit approved execution, backup, staged transform/validation, commit and derived rebuild with recovery/history. Schema advancement follows validated canonical migration. Open/Prepare automatically surface the existing migration card/text flow only when needed. Migration resume now carries taskContext as well as the original task and session. Older runtime capability blocks mutation before an old serializer can strip v3 metadata.
|
|
132
|
+
|
|
133
|
+
MemoryIndex format **10** stores applicability. Missing, malformed or projection-inconsistent v3 cache entries rebuild from canonical Markdown. Even the trusted low-level writer refuses unmigrated projects and incomplete explicit v3 records; it cannot silently substitute legacy applicability. Knowledge schema/version mismatches cannot be masked by a warm cache. Snapshots retain the resolved task and decision metadata. No independent index inference exists.
|
|
134
|
+
|
|
135
|
+
Normal UI still says Required, Relevant and Applies to. Scope details stay in View Context/Knowledge Details. Text mode uses the same Core state and migration actions. There are no new per-record review prompts or persistent pending-scope controls.
|
|
136
|
+
|
|
137
|
+
## 10. Acceptance fixtures and validation
|
|
138
|
+
|
|
139
|
+
Tests use synthetic records in temporary repositories, including scoped rules for documentation, implementation and testing.
|
|
140
|
+
|
|
141
|
+
Focused tests cover tri-state/AND/OR/multiple paths, strict round-trips, no-widening, inferred narrowing, same-session enrichment, required readiness/retry, unknown relevant retrieval, Open, Details, index rebuilding, silent ten-observation Sync, trusted rules, assisted Sync, imports, disjoint consolidation, mechanical migration/rollback/interruption, older-runtime mutation barriers and MCP UI/text parity. Existing tests additionally cover publication, maintenance, archive migration, backup failures, multi-step planning and UI migration/resume.
|
|
142
|
+
|
|
143
|
+
## 11. Limits and deferred work
|
|
144
|
+
|
|
145
|
+
- Inference is deterministic and deliberately limited. Subsystem aliases, repository ownership maps, multilingual classification and richer trusted touched-file integrations are not a general semantic classifier.
|
|
146
|
+
- Explicit/recognized task focus is treated as the work boundary. A host must enrich incomplete context honestly; simply inventing another subsystem to clear readiness is not supported use.
|
|
147
|
+
- A genuinely unknown required policy can block readiness until the agent resolves context. This is not a recurring approval workflow; perfect automatic resolution from arbitrary prose is not promised.
|
|
148
|
+
- The system conservatively keeps differing overlapping scopes separate rather than proving semantic union/equivalence.
|
|
149
|
+
- No nested predicates, negative clauses, arbitrary globs or task-kind hierarchy.
|
|
150
|
+
- Legacy compatibility behavior intentionally remains coarse. Current curation/import behavior is described in [Importer and curation](IMPORTER-CURATION.md); allocation is described in [Context Selection v2](CONTEXT-SELECTION-V2.md).
|
|
151
|
+
- Existing skills retain their own model; this phase versions knowledge only.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# v0.1 compatibility
|
|
2
|
+
|
|
3
|
+
> v0.1 contract: Local/Versioned describe Git storage and sharing, not a security boundary against the connected agent. Review and approval are workflow safeguards, not authenticated human consent. The agent may create, promote and maintain Versioned files. Curator does not commit or push; users review repository changes before doing so. See [Privacy](PRIVACY.md).
|
|
4
|
+
|
|
5
|
+
Supported runtime target: **Node 22.14.0–22.x**, npm and Git. Node 22.14.0 is the tested minimum; the package rejects other Node majors through its engine contract (npm may only warn unless engine-strict is enabled). `import.meta.dirname` and modern Node filesystem/runtime APIs are used. Earlier Node 20 declarations were not a verified compatibility promise.
|
|
6
|
+
|
|
7
|
+
| Environment | Status |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| macOS ARM64, Node 22.14.0 | Tested locally: full tests and isolated release gate |
|
|
10
|
+
| macOS / Ubuntu, Node 22.14.0 and latest 22.x | CI release-gate matrix; support certification requires green runs on the exact RC commit |
|
|
11
|
+
| Native Windows | Not supported in v0.1; filesystem/Git fixtures and process behavior are not verified |
|
|
12
|
+
| Node 20, 24 or other majors; WSL | Not verified / outside the initial runtime contract |
|
|
13
|
+
|
|
14
|
+
CI configuration is not evidence that a remote run has passed. Record actual runs before publication.
|
|
15
|
+
|
|
16
|
+
## Hosts
|
|
17
|
+
|
|
18
|
+
| Host | Status / boundary |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| Codex CLI | Tested: Codex CLI 0.144.4 on macOS ARM64 with an isolated v0.1.0 artifact. Text lifecycle, knowledge maintenance and promotion preview; no Apps rendering claim from a CLI test. |
|
|
21
|
+
| Codex desktop | Used during development with Apps; artifact-host UI interaction has not yet been independently verified. |
|
|
22
|
+
| Claude Code | Experimental adapter: native 2.1.52 user MCP registration and stdio connection verified in isolated HOME. Bare-word model flow stopped at login; not certified as supported. |
|
|
23
|
+
| Claude Desktop | No installer adapter; not verified. |
|
|
24
|
+
| Cursor | Not yet verified against this RC. Workspace and Apps behavior must be checked before claiming support. |
|
|
25
|
+
| Other MCP hosts | Experimental; require standard stdio tools, optional roots and optional Apps/sampling. |
|
|
26
|
+
|
|
27
|
+
Use `prodero install` for one global machine integration. New workspaces initialize directly through MCP. Negotiated host roots authorize project selection; Claude's captured host project directory selects the primary root, and supported local Codex stdio launches supply the workspace through their launch directory. `projectRoot` is a checked selector, not authority. Missing supported context fails closed; no manual allowlist, per-project registration or CLI initialization is required. Explicit `--root` remains an optional hard boundary. Both integrations use the absolute public `prodero` executable: `mcp` for the installed package and `mcp --dev` for the saved Curator checkout. The public executable captures workspace context before loading development code. Update old global integration once and reconnect; `npm --prefix` is not a supported outer launcher. Managed PATH resolves the shebang to the verified Node installation. See [host integration](hosts.md) and [workspace trust contract](PRIVACY.md).
|
|
28
|
+
|
|
29
|
+
Apps-capable hosts can render bundled main/lifecycle/plugin resources. Others receive text and structured content; knowledge actions and explicit text approval remain available. Serving an HTML resource in a protocol smoke test does not verify host rendering. Sampling is optional and host-controlled; deterministic operation works without it. Assisted inputs may be transmitted to the host/model.
|
|
30
|
+
|
|
31
|
+
Machine integration verification: Codex CLI 0.144.4 loaded the installed artifact's native configuration and global launcher in isolated HOME, received only `prodero`, and invoked `prodero_open` with the test workspace. The uninitialized project response exposed initialization and the main App resource; no project was initialized by installation. This text run does not certify desktop rendering.
|
|
32
|
+
|
|
33
|
+
Claude Code does not automatically read project `AGENTS.md`. Initialization remains unchanged; experimental Claude users need the host's documented project `CLAUDE.md` import of `@AGENTS.md` for the existing project lifecycle instructions. The installer does not create that project file or move lifecycle instructions into the global launcher. See [host integration](hosts.md). Restart hosts after package updates.
|
|
34
|
+
|
|
35
|
+
## RC evidence
|
|
36
|
+
|
|
37
|
+
The [release gate](RELEASING.md) checks a clean installed artifact, stdio lifecycle, Local storage, reviewed synthetic sharing, restart and synthetic patch upgrade preservation. Synthetic upgrades do not certify future releases or arbitrary schema downgrades. Record results for the exact release candidate.
|
|
38
|
+
|
|
39
|
+
Codex CLI 0.144.4 connected to the installed artifact with a fixed project root. It performed open/initialize/prepare/record/close/next prepare with the learned decision, conversational remember/search/inspect/Local edit and promotion preview. Noninteractive writes required invocation-scoped preapproval of only the synthetic test tools; publication was excluded. The host's sandbox kept `.git` read-only, so the outer test harness committed the initialization baseline; normal host operations then left Git clean. Interactive users should approve their own actions; do not copy test preapprovals into normal host setup.
|
|
40
|
+
|
|
41
|
+
The host correctly rejected an incomplete edit without a title, then accepted the corrected request. Apps UI rendering and host sampling were not verified by this text run. Actual publication is covered by the separate deterministic synthetic protocol fixture, not claimed as human UI approval.
|
|
42
|
+
|
|
43
|
+
Passing configured remote CI jobs on the final RC commit remains required before publication. Local protocol checks do not certify other Node/OS combinations or host App rendering.
|
|
44
|
+
|
|
45
|
+
Codex setup and per-tool configuration reference: [official configuration reference](https://developers.openai.com/codex/config-reference).
|
|
46
|
+
|
|
47
|
+
## Project and knowledge compatibility
|
|
48
|
+
|
|
49
|
+
Project schema 8 and Knowledge Schema 3 are the current targets. Schema 3 adds explicit applicability with a mechanical legacy-scope migration; see [Applicability](APPLICABILITY.md). Missing knowledge version means legacy format 1; its approved migration preserves instruction behavior with explicit context policy and legacy authority. Both versions live in the project config; moving or cloning a project requires no machine registry. Newer project or knowledge formats fail closed at the storage boundary. Open/Prepare can present update instructions without interpreting unsupported records. See [Migration Foundation](MIGRATIONS.md) for approval, recovery and future format transitions.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Context Selection v2
|
|
2
|
+
|
|
3
|
+
Context Selection v2 changes runtime allocation only. Knowledge Schema remains v3. Applicability, authority, canonical writers, migration and curation authorization are unchanged. Open/Bootstrap keeps its existing compact allocation.
|
|
4
|
+
|
|
5
|
+
## One resource ledger
|
|
6
|
+
|
|
7
|
+
Prepare uses `ContextAllocation` as its single capacity ledger. Existing applicability and ranking identify candidates before allocation. Delivery is whole-record and deterministic; no model calls occur in selection.
|
|
8
|
+
|
|
9
|
+
Order:
|
|
10
|
+
|
|
11
|
+
1. Applicable Required, using existing criticality/relevance ordering.
|
|
12
|
+
2. Strong matching active Skills (existing skill score at least 14).
|
|
13
|
+
3. Relevant, using existing lexical/applicability/graph ranking and scope/category diversity.
|
|
14
|
+
4. Remaining matching Skills if capacity permits.
|
|
15
|
+
|
|
16
|
+
Required takes precedence over Skills. A skill with strong domain evidence gets capacity before optional knowledge. Four skills and 1,500 skill tokens remain safety limits. The score 14 threshold uses accumulated domain evidence in the existing scoring model (for example, title plus scope, or multiple trigger matches), rather than introducing new skill semantics. Skills omitted by total/token/item constraints are diagnosed individually.
|
|
17
|
+
|
|
18
|
+
## Required reserve and safety
|
|
19
|
+
|
|
20
|
+
The default total remains 6,000 estimated tokens. The existing 2,000 Required setting is a reserve, not a ceiling. Required may borrow all unused total capacity; an unused reserve is released to Skills/Relevant. With default total, Required is bounded by 6,000; independent hard ceilings of 16,000 tokens and 128 records protect projects configured with much larger totals. Hard ceilings are runtime safeguards, not new required user configuration.
|
|
21
|
+
|
|
22
|
+
No record is split. An oversized record can be omitted while later fitting Required records are delivered, but the result is explicitly incomplete. No required record is reclassified as Relevant to evade a ceiling.
|
|
23
|
+
|
|
24
|
+
`policyReadiness` precedence remains conflict (`review-required`), unknown applicability (`context-needed`), then delivery failure (`required-incomplete`), then `ready`. All first three states block safe continuation. Allocation completeness and omission diagnostics remain available even when another readiness state takes precedence. Incomplete delivery is not ordinary optimization; inspect omissions and retry after providing an appropriate task boundary or explicitly changing total capacity. The allocator never changes policy or scope itself.
|
|
25
|
+
|
|
26
|
+
## Relevant marginal continuation
|
|
27
|
+
|
|
28
|
+
Existing `context.max_items` (default 8) is the initial soft retrieval target. It remains a bounded graph-seed target too. Eligible records are ranked with existing signals; beyond that target a candidate must satisfy all of:
|
|
29
|
+
|
|
30
|
+
- diversity-adjusted score at least 12 and at least 30% of the best candidate's base score;
|
|
31
|
+
- at least three previously unsupplied non-query, non-numeric terms;
|
|
32
|
+
- novel terms at least 20% of its non-query content vocabulary;
|
|
33
|
+
- whole-record token capacity and the 128-record safety ceiling.
|
|
34
|
+
|
|
35
|
+
Novelty is measured against delivered Required and previously selected Relevant. It is an approximate redundancy signal, not semantic equivalence or authority. A rejection does not prevent a later valuable/fitting record from being considered. Traversal can stop when all remaining records are below the monotonic score floor or none can fit. Ranking uses sorted scope/category queues, preserving diversity ordering without sorting the whole candidate set on each step.
|
|
36
|
+
|
|
37
|
+
This deliberately leaves spare capacity when the next information is weak or redundant. The first target is still governed by existing retrieval eligibility; it is not a guarantee that eight records exist. Settings retain compatibility names (`maxRelevantItems`, `requiredContextBudgetTokens`) in existing contracts; `allocation` gives their unambiguous target/reserve meaning.
|
|
38
|
+
|
|
39
|
+
## Diagnostics and compatibility
|
|
40
|
+
|
|
41
|
+
`ContextResult.allocation.version = 2` reports demand, delivery, borrowed tokens, completeness, hard ceilings, beyond-target selection, capacity/safety/marginal omissions, skill allocation, and unused total capacity. Existing metrics remain for compatibility. Required pressure relative to the reserve can be high while delivery is complete; readiness/completeness, not that ratio, decides whether work can continue.
|
|
42
|
+
|
|
43
|
+
Omitted records retain legacy `reason` plus precise `constraint` where applicable. Retrieval evidence adds `marginal-value`; snapshots retain the actual allocation rather than rerunning retrieval. View Context exposes allocation Details and omitted-record causes; text presentation uses the same Core result. Normal UI remains counts and readiness.
|
|
44
|
+
|
|
45
|
+
Legacy `budgetTokens`/`requiredBudgetTokens` config aliases remain supported. No config edit or knowledge migration is required for this allocator.
|
|
46
|
+
|
|
47
|
+
Skill curation previously simulated a one-token Required ceiling to retrieve those records as optional evidence. It now consumes delivered Required and Relevant explicitly; no escape hatch can bypass the Required safety ceiling.
|
|
48
|
+
|
|
49
|
+
## Stable acceptance fixtures
|
|
50
|
+
|
|
51
|
+
`test/helpers/context-v2-fixture.mjs` creates synthetic temporary projects with explicit v3 policies/applicability. Fixed token demands exercise Required borrowing, Relevant novelty and skill competition using the actual estimator, catalog and selector. These fixtures are not a copy of a private project.
|
|
52
|
+
|
|
53
|
+
## Limitations
|
|
54
|
+
|
|
55
|
+
Token counts remain byte-based estimates of knowledge/skill payload, not a tokenizer count of the entire MCP/JSON envelope or host prompt. Marginal novelty cannot prove semantic redundancy; synonymous notes or incidental vocabulary may be misestimated. Thresholds are deterministic heuristics, tested against synthetic workloads, not a guarantee for arbitrary live project corpora. The first target uses existing retrieval quality. Large genuinely mandatory corpora can still produce incomplete context; the allocator does not silently relax protection.
|
|
56
|
+
|
|
57
|
+
## Validation
|
|
58
|
+
|
|
59
|
+
- Server TypeScript build and MCP Apps UI/plugin builds: passed through `npm test` pretest.
|
|
60
|
+
- `git diff --check`: passed.
|
|
61
|
+
- Ten focused allocator regressions cover actual selector fixtures, Required borrowing/completeness and hard ceilings, oversized whole records, strong/weak Relevant, Skill competition, readiness precedence, MCP/text serialization and View Context diagnostics. Existing budget, pressure, curation simulation and instruction-review tests now exercise real total-capacity failures rather than the retired ordinary item stops.
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# App-first knowledge review
|
|
2
|
+
|
|
3
|
+
> v0.1 contract: Local/Versioned describe Git storage and sharing, not a security boundary against the connected agent. Review and approval are workflow safeguards, not authenticated human consent. The agent may create, promote and maintain Versioned files. Curator does not commit or push; users review repository changes before doing so. See [Privacy](PRIVACY.md).
|
|
4
|
+
|
|
5
|
+
The review workflow separates analysis, dispositions, clarification and execution state.
|
|
6
|
+
See [Review lifecycle](#review-lifecycle) for the current journal,
|
|
7
|
+
projection, deferral and legacy compatibility contract. The protected Apply
|
|
8
|
+
protocol below remains authoritative.
|
|
9
|
+
|
|
10
|
+
## Architecture and protocol
|
|
11
|
+
|
|
12
|
+
The graphical workflow is Analyze → Review knowledge → Current / Suggested /
|
|
13
|
+
Decide later → review summary → Apply changes → result. Only the final Apply
|
|
14
|
+
handler invokes `prodero_curation_apply`. Rendering, navigation, refresh, analysis,
|
|
15
|
+
simulation and staged decisions do not apply knowledge changes.
|
|
16
|
+
|
|
17
|
+
`reviewCuration` is no longer a startup requirement. Previously its trusted
|
|
18
|
+
embedding callback authenticated review and supplied the exact-batch grant; normal
|
|
19
|
+
MCP startup did not supply it. Now the server adapter validates saved review
|
|
20
|
+
state before granting the existing invocation-local `withTrustedKnowledgeBatch`.
|
|
21
|
+
Core retains the same policy gate and exact-record authorization, without MCP or
|
|
22
|
+
host-specific dependencies.
|
|
23
|
+
|
|
24
|
+
1. `prodero_curation` exposes plan, simulate and defer, including in text mode.
|
|
25
|
+
2. App-only `prodero_curation_review` exposes create, inspect, decide and preview, plus analysis, answers, deferral/reopening and retry actions.
|
|
26
|
+
Creation seals the server's current plan; the UI displays that saved plan.
|
|
27
|
+
3. Decisions are `current | suggested | deferred`, keyed by server-defined review
|
|
28
|
+
items. Absence means not reviewed, never implicit acceptance. Linked merge
|
|
29
|
+
proposals form one review item. Unsafe/conflicting items cannot be Suggested.
|
|
30
|
+
4. Each staging request supplies the expected decision revision. Conflicting
|
|
31
|
+
edits return `review_changed` and require reloading the saved decisions.
|
|
32
|
+
5. The final App-only `prodero_curation_apply` request contains `reviewId`,
|
|
33
|
+
`planHash`, `decisionRevision`, `selectedIds`, and optionally `projectRoot`.
|
|
34
|
+
Replacement records, output text and approval booleans are not accepted.
|
|
35
|
+
6. The adapter derives selection from the saved decisions and immutable plan,
|
|
36
|
+
compares it exactly with the request, checks dependency closure, and executes
|
|
37
|
+
only those entries through Core.
|
|
38
|
+
|
|
39
|
+
Both App-only tools declare `_meta.ui.visibility: ["app"]` and are deliberately
|
|
40
|
+
outside the `prodero_text` gateway. Their handlers also require the standard MCP
|
|
41
|
+
Apps MIME capability on the connection; non-App clients fail closed even if they
|
|
42
|
+
ignore visibility metadata. Capability negotiation is not proof of user intent. The old `action:"apply"`, including with
|
|
43
|
+
`approved:true`, fails validation. The external callback has been removed; an old
|
|
44
|
+
runtime embedding must migrate to the App flow. Unrelated Sync Memory routes and
|
|
45
|
+
authorization remain unchanged.
|
|
46
|
+
|
|
47
|
+
## Review lifecycle
|
|
48
|
+
|
|
49
|
+
`.prodero/local/curation-reviews/<reviewId>.json` holds the immutable snapshot:
|
|
50
|
+
project path and canonical real path, plan hash, engine version, complete catalog
|
|
51
|
+
fingerprint, source revisions/preimages, exact outputs, evidence revisions,
|
|
52
|
+
dependency groups, creation time and integrity hash. The paired `.state.json`
|
|
53
|
+
now holds the version-2 decision journal: snapshot/project binding, a legacy-compatible baseline and append-only revisioned user events. Version-1 state remains readable.
|
|
54
|
+
Writes are atomic and staging uses the common writer lock. No lock is held during
|
|
55
|
+
human review. Reopening resumes the newest valid review matching the current plan;
|
|
56
|
+
MCP restart does not discard it.
|
|
57
|
+
|
|
58
|
+
Snapshots expire for Apply after seven days and are bounded to 32 per project,
|
|
59
|
+
with an 8 MiB per-file limit. Decision-bearing snapshot/journal pairs remain pinned
|
|
60
|
+
and inspectable past expiry. Creation prunes only abandoned decision-free pairs;
|
|
61
|
+
if saved decisions fill the capacity, creation fails visibly without deleting them.
|
|
62
|
+
Journals additionally cap events at 2,048. Cleanup is opportunistic.
|
|
63
|
+
Checkpoint receipts have independent existing history retention and are not
|
|
64
|
+
removed with reviews. Pending transactions prevent creating a new review rather
|
|
65
|
+
than making analysis recover a partially applied mutation.
|
|
66
|
+
|
|
67
|
+
## Validation, transactions and replay
|
|
68
|
+
|
|
69
|
+
Apply acquires the existing writer lock, recovers unfinished transactions, then
|
|
70
|
+
checks for a completed receipt **before** stale validation. Operation identity is
|
|
71
|
+
a hash of review ID and the sorted exact selection; order does not affect it.
|
|
72
|
+
The completed receipt is bound to project identity and plan hash. An identical
|
|
73
|
+
retry returns its checkpoint, even after review expiry/removal or a lost response.
|
|
74
|
+
It does not execute a second mutation or fail because the successful operation
|
|
75
|
+
made its own source plan stale.
|
|
76
|
+
|
|
77
|
+
For a new operation the server validates snapshot integrity, project, engine,
|
|
78
|
+
plan hash, decision revision, exact selection and complete dependency groups.
|
|
79
|
+
It replans the full relevant catalog/evidence under the lock and compares plan
|
|
80
|
+
hash and catalog fingerprint. Core also checks selected source/evidence revisions
|
|
81
|
+
and transaction preimage hashes. Any stale plan applies nothing and returns
|
|
82
|
+
`stale_review`; changing the selection on an already applied review requires a
|
|
83
|
+
fresh review. Cooperative project writers share this lock. Arbitrary external
|
|
84
|
+
filesystem edits are not a serialized writer and remain subject to the existing
|
|
85
|
+
transaction conflict/recovery contract.
|
|
86
|
+
|
|
87
|
+
The existing exact-mode transaction writes outputs/retirements and checkpoint,
|
|
88
|
+
with checkpoint completion last, then rebuilds the index. Recovery rolls forward;
|
|
89
|
+
there is no new Undo implementation. History includes review and operation IDs,
|
|
90
|
+
plan/engine, exact selection, staged decisions, preimages and complete proposed
|
|
91
|
+
outputs. Results identify applied, unselected and unresolved proposals, checkpoint
|
|
92
|
+
ID/location and whether the response is a replay.
|
|
93
|
+
|
|
94
|
+
## Human review
|
|
95
|
+
|
|
96
|
+
All surfaces consume a shared server projection, including persisted deferrals.
|
|
97
|
+
The default entry focuses on decisions needing attention; Review all includes
|
|
98
|
+
all knowledge. Cards compare current/suggested text, policy, applicability and
|
|
99
|
+
scope. Clicking a card stages its choice and advances; Previous and per-item
|
|
100
|
+
summary links allow corrections. Left/Right select Current/Suggested, L defers,
|
|
101
|
+
and Backspace returns. Keyboard navigation has no Apply shortcut.
|
|
102
|
+
|
|
103
|
+
Straightforward suggestions can be selected together through an explicit action;
|
|
104
|
+
existing Current/Later choices are preserved. Nothing is preselected because it
|
|
105
|
+
is high-confidence. Unresolved recommendations remain unavailable for application.
|
|
106
|
+
The summary distinguishes current attention, deferred issues, deferred changes,
|
|
107
|
+
unchanged records and included proposals and can preview context
|
|
108
|
+
impact for the staged selection. Technical identifiers and results are in Details.
|
|
109
|
+
Stale review displays “Knowledge changed since this review” with a fresh-review
|
|
110
|
+
action. Successful completion shows counts and history availability.
|
|
111
|
+
|
|
112
|
+
## Workflow safeguards and host compatibility
|
|
113
|
+
|
|
114
|
+
The first-party App and a compliant MCP Apps host provide the intended review workflow, not authenticated human authorization.
|
|
115
|
+
The host must hide App-only tools from the model and route App tool calls. An App
|
|
116
|
+
can invoke tools through `App.callServerTool`; a server receives a normal tool
|
|
117
|
+
request, not a cryptographic attestation of a physical click. Visibility metadata
|
|
118
|
+
is **not** authentication against a malicious raw MCP client, modified App, or
|
|
119
|
+
host that exposes all tools to its model. No `approved` boolean or client-provided
|
|
120
|
+
proposal can substitute for the validated server snapshot and Core grant.
|
|
121
|
+
|
|
122
|
+
This uses the standard [MCP Apps interaction model](https://modelcontextprotocol.io/extensions/apps/overview)
|
|
123
|
+
and [tool visibility metadata](https://github.com/modelcontextprotocol/ext-apps/blob/main/specification/2026-01-26/apps.mdx).
|
|
124
|
+
Codex and Claude use the same adapter where the host supports these capabilities;
|
|
125
|
+
there is no host-name branching. Actual visibility enforcement, App permissions,
|
|
126
|
+
reload behavior and rendering must be verified for each host/version. A host
|
|
127
|
+
without Apps uses preview-only text. This phase implements no MCP elicitation.
|
|
128
|
+
No trusted-host authorization or elicitation system is required for the accepted v0.1 contract. Existing App-only curation and preview-only text routing remain workflow restrictions; other agent-callable Versioned writers remain available.
|
|
129
|
+
|
|
130
|
+
## Verification and host acceptance
|
|
131
|
+
|
|
132
|
+
Automated tests cover snapshot persistence/retention, selection and merge groups,
|
|
133
|
+
unresolved rejection, source/evidence/dependency/catalog staleness, identity and
|
|
134
|
+
payload rejection, non-App connection rejection, writer serialization, recovery before validation, replay after
|
|
135
|
+
lost response and snapshot removal, alternate selections, legacy/text rejection,
|
|
136
|
+
and App-only metadata. Production UI handlers run against the actual server over
|
|
137
|
+
an MCP in-memory transport: rendering, cards, backtracking, bulk decisions,
|
|
138
|
+
preview/reload, keyboard, final Apply, completion and stale recovery are exercised.
|
|
139
|
+
These tests do not establish host-side filtering or visual appearance.
|
|
140
|
+
|
|
141
|
+
For host acceptance, after `npm run build` in the repository, use
|
|
142
|
+
`node scripts/curation-review-fixture.mjs` to create a
|
|
143
|
+
throwaway project, open its Curator App, and verify:
|
|
144
|
+
|
|
145
|
+
1. Review renders; opening/reopening, refresh and preview preserve knowledge bytes.
|
|
146
|
+
2. Current/Suggested/Later stage only decisions; only Apply sends
|
|
147
|
+
`prodero_curation_apply` and creates a curation checkpoint.
|
|
148
|
+
3. Details' checkpoint matches the reviewed outputs and source preimages.
|
|
149
|
+
4. Repeating the same captured Apply request through the App bridge returns the
|
|
150
|
+
same checkpoint with `replayed:true` (including after a lost response).
|
|
151
|
+
5. Edit a fixture source after review; Apply returns `stale_review`, changes
|
|
152
|
+
nothing else and offers Review updated changes.
|
|
153
|
+
6. Inspect the host's model-facing catalog: neither App-only tool is exposed;
|
|
154
|
+
model-visible curation and text paths cannot apply.
|
|
155
|
+
|
|
156
|
+
Do not substitute a raw SDK client for the host checks in steps 1, 2 and 6.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Required clauses and attention evidence
|
|
2
|
+
|
|
3
|
+
## Previous behavior
|
|
4
|
+
|
|
5
|
+
`planKnowledgeCuration` previously inherited Required for every analyzed fragment except transient text and a fragment beginning `Workflow Note:`. It forced each inherited fragment to category instruction. The import analyzer also joined Impact and many Constraint fields to their Decision. Consequently commands, test-quality notes, implementation observations and explanations could become independently mandatory. This was a proposal rule, not an automatic canonical mutation.
|
|
6
|
+
|
|
7
|
+
## Current analysis
|
|
8
|
+
|
|
9
|
+
`curation-clauses.ts` is a curation-only refinement of the existing evidence-first analyzer. Importer v2 behavior is unchanged. Internal roles are constraint, invariant, convention, procedure, command, lesson, history, rationale and unresolved. These roles are not new canonical categories or authority values. Knowledge Schema remains v3.
|
|
10
|
+
|
|
11
|
+
Labeled source fields and complete sentences establish exact source ranges. Required is inherited only by identified normative constraints, invariants and conventions. Explicit supporting fields do not acquire mandatory policy through imperative grammar. An explicitly mandatory command can remain normative. A historical observation does not weaken a separate conditional constraint. Unstructured authored rules remain intact rather than being speculatively demoted.
|
|
12
|
+
|
|
13
|
+
Adjacent compatible clauses coalesce. Nonadjacent normative clauses from the same source and applicability are grouped into one output, while supporting text remains in coherent role groups. Outputs retain original text; mappings cover every source range and validate reconstructed content. This deliberately avoids creative compression. Supporting records retain source provenance, lifecycle, priority, relationships and legacy authority while receiving Relevant delivery policy. Every semantic change still needs exact trusted batch review.
|
|
14
|
+
|
|
15
|
+
This deterministic role classifier is conservative proposal analysis, not a general natural-language proof. Inseparable or conflicting normative meaning remains review work. Token savings never decide a role.
|
|
16
|
+
|
|
17
|
+
## Consolidation
|
|
18
|
+
|
|
19
|
+
The planner can consolidate source-identical normative cores only with identical applicability, scope, authority, priority and storage layer. Shared outputs union provenance and relationships. Every participating source must be selected in the same exact review batch; source retirement and output creation use the existing journal transaction. Different clauses, different scopes, or mere shared vocabulary do not establish equivalence. Paraphrase-based consolidation is intentionally not claimed as proven.
|
|
20
|
+
|
|
21
|
+
## Read-only evidence
|
|
22
|
+
|
|
23
|
+
`curation-evidence.ts` scans bounded test, handler, documentation, build and deployment directories. It reads source text only: no test execution, shell evaluation, configuration loading or project lifecycle calls. Vendor trees, caches, canonical memory, assets and symlinks are excluded. Each excerpt includes relative path, line and SHA-256. File count/depth/size ceilings bound work; truncated inspection is explicit in the plan.
|
|
24
|
+
|
|
25
|
+
Current tests can resolve a helper label into the actual API testing boundary. Named source domains plus matching implementation evidence can replace incidental DB/PHP/SKU labels. Historical observations can remain traceable Relevant history without asserting they are still true. Static test definitions do not establish a passing runtime or deployed production state. A current export test allowing fake queries/dispatch is evidence of architecture beyond an old blanket refusal; it does not authorize real integrations.
|
|
26
|
+
|
|
27
|
+
Evidence classifications distinguish resolved proposal, reduced ambiguity, genuine decision and historical-only. The original normative meaning remains protected even when implementation disagrees. Mirroring conflicts compare active Required knowledge, excluding historical lessons that merely mention failed mirror fixes.
|
|
28
|
+
|
|
29
|
+
Plans include evidence root, truncation status and source revisions. Apply rechecks referenced evidence bytes, in addition to canonical source revisions and the existing exact-plan trusted capability. Neither evidence, confidence, plan possession nor a boolean approval bypasses the exact-record Core policy checks. These internal checks do not authenticate human consent; the App adapter can issue the grant from a validated caller request. See [the v0.1 trust model](PRIVACY.md).
|
|
30
|
+
|
|
31
|
+
## Presentation and simulation
|
|
32
|
+
|
|
33
|
+
Shared UI/text presentation puts unresolved decisions before grouped suggestions. Evidence excerpts, hashes and full source/output content are in Details. No permanent panel or new Prepare interruption is introduced. Deferral uses the existing revision-bound recommendation lifecycle.
|
|
34
|
+
|
|
35
|
+
Simulation writes only disposable canonical copies and invokes the unchanged real context selector. Metrics now also include applicability decisions/reasons. Simulation uses the current [Context Selection v2](CONTEXT-SELECTION-V2.md) allocator: a default 6,000-token total, a 2,000-token Required reserve, 128-item / 16,000-token Required safety ceilings and a soft Relevant target of 8.
|
|
36
|
+
|
|
37
|
+
## Boundaries
|
|
38
|
+
|
|
39
|
+
- Static evidence cannot prove a historical PHPUnit error is resolved or production rollout completed.
|
|
40
|
+
- No new host-specific trusted review adapter is introduced. The existing trusted Core/embedding batch boundary is required for application.
|
|
41
|
+
- Exact repeated normative cores consolidate; differing fail-closed/harness/DB/export requirements are not merged merely to fit a budget.
|
|
42
|
+
|
|
43
|
+
## Validation
|
|
44
|
+
|
|
45
|
+
Synthetic clause/evidence/consolidation tests exercise the actual planner and context selector in temporary projects.
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Importer v2 and legacy curation
|
|
2
|
+
|
|
3
|
+
> v0.1 contract: Local/Versioned describe Git storage and sharing, not a security boundary against the connected agent. Review and approval are workflow safeguards, not authenticated human consent. The agent may create, promote and maintain Versioned files. Curator does not commit or push; users review repository changes before doing so. See [Privacy](PRIVACY.md).
|
|
4
|
+
|
|
5
|
+
## Existing architecture and root cause
|
|
6
|
+
|
|
7
|
+
The optional `plugins/migrate_ai_studio/index.cjs` importer gathers bounded source
|
|
8
|
+
and repository evidence, seals a project-bound plan, reviews inclusion as one batch,
|
|
9
|
+
then delegates canonical writes to Core `imports.ts`. Checkpoint receipts provide
|
|
10
|
+
exact replay, before-state fingerprints, and verification. Source files are never
|
|
11
|
+
rewritten. Semantic mode already has bounded evidence validation and exclusions.
|
|
12
|
+
|
|
13
|
+
Previously `durableSections` concatenated Decision, Impact, Constraint and Workflow
|
|
14
|
+
Note, matched must/should/never/always/required/keep/use/run/do not/cannot in Decision,
|
|
15
|
+
and assigned instruction/global. Before explicit policy this implied Required.
|
|
16
|
+
After Phase 1B Core prevents required/imported creation, but the plugin still had
|
|
17
|
+
poor category/granularity and global projections. Titles used the first sentence
|
|
18
|
+
of Decision. Literal portable-prose sanitization replaces task IDs and legacy
|
|
19
|
+
workspace paths; source evidence must retain the original reference.
|
|
20
|
+
|
|
21
|
+
## Importer implementation
|
|
22
|
+
|
|
23
|
+
`knowledge-analysis.ts` is a deterministic proposal service exposed through the
|
|
24
|
+
existing plugin context. It uses the Phase 2 Task Context/applicability APIs, not a
|
|
25
|
+
new evaluator. Explicit source labels, normative meaning, transient-state markers,
|
|
26
|
+
paths, leading named topics and activity evidence guide classification. Decision
|
|
27
|
+
labels do not override clear normative meaning; imperative words never authorize
|
|
28
|
+
mandatory delivery. It supports existing canonical categories only. Decision and
|
|
29
|
+
Impact remain cohesive; compatible normative Constraint stays attached. Workflow,
|
|
30
|
+
State and Lesson sections can split where lifecycle differs. Exact source slices
|
|
31
|
+
remain traceable. Oversized sections fail instead of being silently truncated.
|
|
32
|
+
|
|
33
|
+
All historical knowledge still passes Core import validation and the transaction
|
|
34
|
+
authority gate: Relevant/Imported, normal priority. The plugin cannot request
|
|
35
|
+
Required or explicit_user/reviewed. Source-derived scopes are unresolved or scoped;
|
|
36
|
+
there is no project-wide fallback. Historical state is retained. Prompt text is
|
|
37
|
+
additional guidance, never authorization.
|
|
38
|
+
|
|
39
|
+
The existing wire plan/receipt version remains compatible. The analysis engine is
|
|
40
|
+
versioned independently (`evidence-2`); existing plugin protocol identifiers remain
|
|
41
|
+
unchanged. New receipts retain source evidence. Re-audit checks original source
|
|
42
|
+
entry keys as well as decomposed child keys, so old receipts prevent unchanged
|
|
43
|
+
source re-import even after canonical editing or changed classification. New
|
|
44
|
+
receipt source ranges detect source updates and leave them excluded for review.
|
|
45
|
+
Old receipts without source positions cannot establish that an arbitrarily edited
|
|
46
|
+
or moved source entry is the same entry: that remains a limitation. Normal import
|
|
47
|
+
never rewrites legacy canonical knowledge. Exact content/applicability dedup still
|
|
48
|
+
runs in Core. Preview summarizes categories, Relevant/Required, scoped/unresolved
|
|
49
|
+
and per-record source details; selection is batch-oriented.
|
|
50
|
+
|
|
51
|
+
## Curation is not migration
|
|
52
|
+
|
|
53
|
+
`knowledge-curation.ts` uses a read-only MemoryCatalog (`persistCache:false`). It
|
|
54
|
+
analyzes active/disputed legacy Required records, excluding already curated
|
|
55
|
+
outputs, and returns a deterministic project/revision/engine/schema-bound plan.
|
|
56
|
+
No plan creation writes canonical files, indexes, archives, schema or history.
|
|
57
|
+
Current explicit_user/reviewed records are not cleanup targets, though their
|
|
58
|
+
conflicting evidence can place legacy sources in attention. Other authority and
|
|
59
|
+
relevant-only maintenance targets are deferred.
|
|
60
|
+
|
|
61
|
+
Proposals distinguish applicability narrowing, policy/category changes and
|
|
62
|
+
content decomposition. Legacy mandatory meaning is deliberately preserved unless
|
|
63
|
+
a separately identified workflow/history component is proposed as relevant.
|
|
64
|
+
Time-sensitive state, known contradiction relations, disputed records and possible
|
|
65
|
+
artifact-mirroring conflicts are attention items. Content alone does not establish
|
|
66
|
+
that a rule is obsolete. There is no LLM winner and no timestamp winner.
|
|
67
|
+
|
|
68
|
+
Every selected source is accounted for. Decomposition maps character ranges to
|
|
69
|
+
output IDs, retains source sessions/evidence and adds revision-qualified derivation.
|
|
70
|
+
No lexical paraphrase is considered a proof of clause preservation. Different or
|
|
71
|
+
incomparable applicability is not merged. The deterministic base analyzer keeps non-equivalent related records separate;
|
|
72
|
+
current bounded reasoning and clarification can refine review proposals.
|
|
73
|
+
This intentionally avoids conflating similar wording with equivalent protection.
|
|
74
|
+
|
|
75
|
+
## Review and application
|
|
76
|
+
|
|
77
|
+
A plan is not permission. `withTrustedKnowledgeBatch` extends the existing central
|
|
78
|
+
Phase 1B gate with invocation-local, exact-record/preimage/project authorization.
|
|
79
|
+
`curationReviewEntries` exposes the exact batch to a trusted adapter; serialized
|
|
80
|
+
plan IDs, confidence and approved booleans cannot mint the capability.
|
|
81
|
+
|
|
82
|
+
`applyKnowledgeCuration` supports selected safe groups, validates the plan and
|
|
83
|
+
selected source revisions, takes the existing writer lock, recovers a pending
|
|
84
|
+
journal and uses `commitSyncTransaction` in exact mode. New decomposition outputs
|
|
85
|
+
precede source retirement. Original bytes, exact plan/selection, unchanged IDs and
|
|
86
|
+
engine version are retained in the final checkpoint. Canonical parser validation
|
|
87
|
+
precedes commit; the existing journal supplies deterministic roll-forward after
|
|
88
|
+
interruption. Index rebuild follows commit and is retried after completed replay.
|
|
89
|
+
There is no new rollback engine: checkpoint preimages support diagnosis/restoration,
|
|
90
|
+
while automatic recovery uses the existing roll-forward contract. Unselected
|
|
91
|
+
attention records remain byte-for-byte unchanged. No source file is silently erased.
|
|
92
|
+
|
|
93
|
+
Stale selected sources fail with their ID. Core can apply an unaffected selected
|
|
94
|
+
group using its original plan; the MCP UI currently refreshes the whole fingerprint
|
|
95
|
+
and conservatively rejects stale plans. Core replay of the same reviewed selection
|
|
96
|
+
is idempotent. Review grants expire when their invocation completes.
|
|
97
|
+
|
|
98
|
+
## MCP, UI and text
|
|
99
|
+
|
|
100
|
+
`prodero_curation` provides plan/simulate/defer and remains available through
|
|
101
|
+
`prodero_text`. Graphical review now uses persistent server-owned snapshots,
|
|
102
|
+
staged Current/Suggested/Later decisions and a separate App-only apply tool.
|
|
103
|
+
The external `reviewCuration` startup callback is no longer required. The adapter
|
|
104
|
+
validates the entire plan under the writer lock before granting Core's exact-batch
|
|
105
|
+
permission. Text mode remains preview-only; legacy model-visible apply is closed.
|
|
106
|
+
See [App-first knowledge review](CURATION-APP-REVIEW.md) for protocol, retention,
|
|
107
|
+
replay, trust boundaries, compatibility and verification status.
|
|
108
|
+
|
|
109
|
+
Open may offer a non-blocking cleanup card; Prepare has no curation dependency.
|
|
110
|
+
Later persists a checkpoint tied to the exact recommendation, not a knowledge
|
|
111
|
+
record or policy rejection. Repeated Open suppresses unchanged deferred cards;
|
|
112
|
+
material canonical changes or a new analysis version can resurface them. Details
|
|
113
|
+
retain access. Analysis errors are caught by Open and do not block ordinary work.
|
|
114
|
+
No new recurring approval interaction is introduced.
|
|
115
|
+
|
|
116
|
+
## Simulation and metrics
|
|
117
|
+
|
|
118
|
+
Simulation copies canonical memory and skills plus the current config into an
|
|
119
|
+
isolated temporary repository, writes actual proposed Markdown, and runs the real
|
|
120
|
+
`prepareContext` entry point before and after. It does not call lifecycle Prepare,
|
|
121
|
+
Sync, simplify ranking or adjust budgets. Temporary stores are removed in finally.
|
|
122
|
+
Metrics include real estimated candidate/selected/omitted tokens and counts,
|
|
123
|
+
relevant item-limit omissions, total tokens, unknown required and readiness.
|
|
124
|
+
|
|
125
|
+
Two explicit modes distinguish **safe batch** (attention unchanged) from a
|
|
126
|
+
conditional **all proposals** scenario (attention outputs included for measurement
|
|
127
|
+
only, still requiring further review). The default UI simulates the safe batch.
|
|
128
|
+
The latter is not a prediction that attention has been resolved or approved.
|
|
129
|
+
|
|
130
|
+
Current targets are Knowledge Schema v3 and Project Schema v8; curation itself does not advance schema versions. Retrieval,
|
|
131
|
+
required/relevant item limits, skill limits and token budgets are unchanged.
|
|
132
|
+
|
|
133
|
+
## Limitations and scaling
|
|
134
|
+
|
|
135
|
+
Deterministic analysis makes zero model calls. Parsing/classification is linear in
|
|
136
|
+
source text; catalog/evidence grouping is in memory. Conflict cross-checking can
|
|
137
|
+
be quadratic in candidate count; optional expensive semantic work is not required
|
|
138
|
+
for project usability. This is not a complete semantic oracle: leading identifiers,
|
|
139
|
+
path-vs-domain boundaries, stale validity and complex conflicts can need refinement.
|
|
140
|
+
Current review supports bounded reasoning, clarification answers, deferral/reopening
|
|
141
|
+
and retry through the existing curation tools. This is not autonomous organization
|
|
142
|
+
cleanup, arbitrary rewriting or a new rollback UI.
|