docs: define modular local agent contracts

This commit is contained in:
Ajasra committed 2026-10-13 13:59:24 +08:00
1 parent 7fb257095f
commit dd359642ff
12 files changed
+412 -27

No files matched your search

+8
View File
@@ -14,3 +14,11 @@ The pack is source material for a dedicated research workspace. Keep the complet
| [kb-synthesize](skills/kb-synthesize/SKILL.md) | Build a synthesis with revision-bound dependencies. | | [kb-synthesize](skills/kb-synthesize/SKILL.md) | Build a synthesis with revision-bound dependencies. |
The [manifest](manifest.json) records versions and explicit compatibility status. Pending service compatibility means no connected workflow is claimed. Until tools exist, requested local drafts stay under the selected workspace's `Drafts/` and remain unaccepted; no canonical writes or fabricated receipts are permitted. The [manifest](manifest.json) records versions and explicit compatibility status. Pending service compatibility means no connected workflow is claimed. Until tools exist, requested local drafts stay under the selected workspace's `Drafts/` and remain unaccepted; no canonical writes or fabricated receipts are permitted.
The manifest's `modules` array is the authoritative descriptor registry for the profile, protocols, skills and pipelines. Each entry identifies its implementation, provided/required instruction contracts, compatible checkpoint contract and exact file hash. Its snapshot digest covers that array using the declared canonical serialization. Recompute hashes and the snapshot after changing a module; any published pack change requires a new pack version. The entry lists above are discovery indexes and must agree with the registry.
For portable Markdown hashing, decode UTF-8, remove an optional BOM and normalize CRLF/CR line endings to LF, then hash the UTF-8 bytes with SHA-256. Preserve every other character and the final newline. This keeps Windows checkout conversion from changing instruction identity; it is not a signature or proof of trusted origin.
Checkpoint contract `gewu.local-checkpoint@0.1.0` requires run identity, explicit scope/objective, snapshot digest, resolved module contract IDs and file hashes, host/model metadata where available, input/output hashes, stage, coverage, budgets, pending operation identities and last service receipt. Unavailable service fields are explicitly absent; they are never fabricated. This is a draft instruction contract, not an executable checkpoint validator. Resume must verify the saved snapshot and hashes before using saved stages. A successor run requires explicit contract compatibility and downstream revalidation.
Empty service-capability lists mean schema binding is pending, as declared by `service_capability_status`; they do not mean connected workflows need no capabilities. Bind and test those requirements when the service schemas exist. Host-adapter descriptors belong to a future installer/configuration implementation and are not supplied by this pack.
+321 -5
View File
@@ -18,9 +18,325 @@
"contributions": "protocols/CONTRIBUTIONS.md" "contributions": "protocols/CONTRIBUTIONS.md"
}, },
"skills": [ "skills": [
{"id": "kb-ingest", "version": "0.1.0", "entry": "skills/kb-ingest/SKILL.md", "pipeline": "pipelines/ingest.md", "pipeline_version": "0.1.0"}, {
{"id": "kb-query", "version": "0.1.0", "entry": "skills/kb-query/SKILL.md", "pipeline": "pipelines/query.md", "pipeline_version": "0.1.0"}, "id": "kb-ingest",
{"id": "kb-curate", "version": "0.1.0", "entry": "skills/kb-curate/SKILL.md", "pipeline": "pipelines/curate.md", "pipeline_version": "0.1.0"}, "version": "0.1.0",
{"id": "kb-synthesize", "version": "0.1.0", "entry": "skills/kb-synthesize/SKILL.md", "pipeline": "pipelines/synthesize.md", "pipeline_version": "0.1.0"} "entry": "skills/kb-ingest/SKILL.md",
] "pipeline": "pipelines/ingest.md",
"pipeline_version": "0.1.0"
},
{
"id": "kb-query",
"version": "0.1.0",
"entry": "skills/kb-query/SKILL.md",
"pipeline": "pipelines/query.md",
"pipeline_version": "0.1.0"
},
{
"id": "kb-curate",
"version": "0.1.0",
"entry": "skills/kb-curate/SKILL.md",
"pipeline": "pipelines/curate.md",
"pipeline_version": "0.1.0"
},
{
"id": "kb-synthesize",
"version": "0.1.0",
"entry": "skills/kb-synthesize/SKILL.md",
"pipeline": "pipelines/synthesize.md",
"pipeline_version": "0.1.0"
}
],
"checkpoint_contract": {
"id": "gewu.local-checkpoint",
"version": "0.1.0",
"status": "draft-instruction-contract"
},
"modules": [
{
"module_id": "profile",
"kind": "profile",
"entry": "AGENTS.md",
"implementation_version": "0.1.0",
"provided_contract": {
"id": "gewu.profile.profile",
"version": "0.1.0"
},
"requires_contracts": [
"gewu.protocol.evidence@0.1.0",
"gewu.protocol.scope@0.1.0",
"gewu.protocol.contributions@0.1.0",
"gewu.skill.kb-ingest@0.1.0",
"gewu.skill.kb-query@0.1.0",
"gewu.skill.kb-curate@0.1.0",
"gewu.skill.kb-synthesize@0.1.0"
],
"required_service_capabilities": [],
"service_capability_status": "unbound-service-schema-pending",
"compatible_checkpoint_contracts": [
"gewu.local-checkpoint@0.1.0"
],
"sha256": "2bb326e760704bb555238f2d3e04e7cc238f01f6f281f21824f8196e700a30ef",
"hash_encoding": "utf8-no-bom-lf"
},
{
"module_id": "evidence",
"kind": "protocol",
"entry": "protocols/EVIDENCE.md",
"implementation_version": "0.1.0",
"provided_contract": {
"id": "gewu.protocol.evidence",
"version": "0.1.0"
},
"requires_contracts": [],
"required_service_capabilities": [],
"service_capability_status": "unbound-service-schema-pending",
"compatible_checkpoint_contracts": [
"gewu.local-checkpoint@0.1.0"
],
"sha256": "9b7316c02d82608c34d24d1d69f24016c33ba966373cb57e9b90b70ba76ac865",
"hash_encoding": "utf8-no-bom-lf"
},
{
"module_id": "scope",
"kind": "protocol",
"entry": "protocols/SCOPE.md",
"implementation_version": "0.1.0",
"provided_contract": {
"id": "gewu.protocol.scope",
"version": "0.1.0"
},
"requires_contracts": [],
"required_service_capabilities": [],
"service_capability_status": "unbound-service-schema-pending",
"compatible_checkpoint_contracts": [
"gewu.local-checkpoint@0.1.0"
],
"sha256": "521691d9739829b6ed64b8259a2768385c52e6a5f396bcd0b7800d33d5e8cd83",
"hash_encoding": "utf8-no-bom-lf"
},
{
"module_id": "contributions",
"kind": "protocol",
"entry": "protocols/CONTRIBUTIONS.md",
"implementation_version": "0.1.0",
"provided_contract": {
"id": "gewu.protocol.contributions",
"version": "0.1.0"
},
"requires_contracts": [
"gewu.local-checkpoint@0.1.0"
],
"required_service_capabilities": [],
"service_capability_status": "unbound-service-schema-pending",
"compatible_checkpoint_contracts": [
"gewu.local-checkpoint@0.1.0"
],
"sha256": "f66e7c97036c85f0ceeaba69caf54720ea8d98021fda73bc4a7c9667775d8387",
"hash_encoding": "utf8-no-bom-lf"
},
{
"module_id": "kb-ingest",
"kind": "skill",
"entry": "skills/kb-ingest/SKILL.md",
"implementation_version": "0.1.0",
"provided_contract": {
"id": "gewu.skill.kb-ingest",
"version": "0.1.0"
},
"requires_contracts": [
"gewu.protocol.evidence@0.1.0",
"gewu.protocol.scope@0.1.0",
"gewu.protocol.contributions@0.1.0",
"gewu.pipeline.kb-ingest-pipeline@0.1.0"
],
"required_service_capabilities": [],
"service_capability_status": "unbound-service-schema-pending",
"compatible_checkpoint_contracts": [
"gewu.local-checkpoint@0.1.0"
],
"sha256": "b0abe4d6db8020f16e86789fa409a19fda1e7385882172d84e3cc430ed4e7b6d",
"hash_encoding": "utf8-no-bom-lf"
},
{
"module_id": "kb-ingest-pipeline",
"kind": "pipeline",
"entry": "pipelines/ingest.md",
"implementation_version": "0.1.0",
"provided_contract": {
"id": "gewu.pipeline.kb-ingest-pipeline",
"version": "0.1.0"
},
"requires_contracts": [
"gewu.protocol.evidence@0.1.0",
"gewu.protocol.scope@0.1.0",
"gewu.protocol.contributions@0.1.0"
],
"required_service_capabilities": [],
"service_capability_status": "unbound-service-schema-pending",
"compatible_checkpoint_contracts": [
"gewu.local-checkpoint@0.1.0"
],
"sha256": "ebdb65bfdb331eae1c5d0618caebac4585287c5057d64307b57b1ae7bd404962",
"hash_encoding": "utf8-no-bom-lf"
},
{
"module_id": "kb-query",
"kind": "skill",
"entry": "skills/kb-query/SKILL.md",
"implementation_version": "0.1.0",
"provided_contract": {
"id": "gewu.skill.kb-query",
"version": "0.1.0"
},
"requires_contracts": [
"gewu.protocol.evidence@0.1.0",
"gewu.protocol.scope@0.1.0",
"gewu.protocol.contributions@0.1.0",
"gewu.pipeline.kb-query-pipeline@0.1.0"
],
"required_service_capabilities": [],
"service_capability_status": "unbound-service-schema-pending",
"compatible_checkpoint_contracts": [
"gewu.local-checkpoint@0.1.0"
],
"sha256": "e2e1986d0c4ffc76982e76a9976f290e6eed18e469fc682acbeed898ef30775c",
"hash_encoding": "utf8-no-bom-lf"
},
{
"module_id": "kb-query-pipeline",
"kind": "pipeline",
"entry": "pipelines/query.md",
"implementation_version": "0.1.0",
"provided_contract": {
"id": "gewu.pipeline.kb-query-pipeline",
"version": "0.1.0"
},
"requires_contracts": [
"gewu.protocol.evidence@0.1.0",
"gewu.protocol.scope@0.1.0",
"gewu.protocol.contributions@0.1.0"
],
"required_service_capabilities": [],
"service_capability_status": "unbound-service-schema-pending",
"compatible_checkpoint_contracts": [
"gewu.local-checkpoint@0.1.0"
],
"sha256": "d78cbb2e5cb691704a7b5300856d053801b1aeaa06e6b45cb442959413735d64",
"hash_encoding": "utf8-no-bom-lf"
},
{
"module_id": "kb-curate",
"kind": "skill",
"entry": "skills/kb-curate/SKILL.md",
"implementation_version": "0.1.0",
"provided_contract": {
"id": "gewu.skill.kb-curate",
"version": "0.1.0"
},
"requires_contracts": [
"gewu.protocol.evidence@0.1.0",
"gewu.protocol.scope@0.1.0",
"gewu.protocol.contributions@0.1.0",
"gewu.pipeline.kb-curate-pipeline@0.1.0"
],
"required_service_capabilities": [],
"service_capability_status": "unbound-service-schema-pending",
"compatible_checkpoint_contracts": [
"gewu.local-checkpoint@0.1.0"
],
"sha256": "ed49d08d581c92c26755944e931665e197074f32c33f44b462208398ec50e515",
"hash_encoding": "utf8-no-bom-lf"
},
{
"module_id": "kb-curate-pipeline",
"kind": "pipeline",
"entry": "pipelines/curate.md",
"implementation_version": "0.1.0",
"provided_contract": {
"id": "gewu.pipeline.kb-curate-pipeline",
"version": "0.1.0"
},
"requires_contracts": [
"gewu.protocol.evidence@0.1.0",
"gewu.protocol.scope@0.1.0",
"gewu.protocol.contributions@0.1.0"
],
"required_service_capabilities": [],
"service_capability_status": "unbound-service-schema-pending",
"compatible_checkpoint_contracts": [
"gewu.local-checkpoint@0.1.0"
],
"sha256": "665a51f5c42a81cf37aaccfc7791b494f487fc3aa70cf8d6cfd9437dc8bfcff1",
"hash_encoding": "utf8-no-bom-lf"
},
{
"module_id": "kb-synthesize",
"kind": "skill",
"entry": "skills/kb-synthesize/SKILL.md",
"implementation_version": "0.1.0",
"provided_contract": {
"id": "gewu.skill.kb-synthesize",
"version": "0.1.0"
},
"requires_contracts": [
"gewu.protocol.evidence@0.1.0",
"gewu.protocol.scope@0.1.0",
"gewu.protocol.contributions@0.1.0",
"gewu.pipeline.kb-synthesize-pipeline@0.1.0"
],
"required_service_capabilities": [],
"service_capability_status": "unbound-service-schema-pending",
"compatible_checkpoint_contracts": [
"gewu.local-checkpoint@0.1.0"
],
"sha256": "444433c4c5dc4f22183a4987edc38982868b6bf70e578b59303eb8c4fcf26b9c",
"hash_encoding": "utf8-no-bom-lf"
},
{
"module_id": "kb-synthesize-pipeline",
"kind": "pipeline",
"entry": "pipelines/synthesize.md",
"implementation_version": "0.1.0",
"provided_contract": {
"id": "gewu.pipeline.kb-synthesize-pipeline",
"version": "0.1.0"
},
"requires_contracts": [
"gewu.protocol.evidence@0.1.0",
"gewu.protocol.scope@0.1.0",
"gewu.protocol.contributions@0.1.0"
],
"required_service_capabilities": [],
"service_capability_status": "unbound-service-schema-pending",
"compatible_checkpoint_contracts": [
"gewu.local-checkpoint@0.1.0"
],
"sha256": "d8fdd640d4d2bfa2556eb676274f2bae9e6e70e6a760bac586e17f870be501cb",
"hash_encoding": "utf8-no-bom-lf"
},
{
"module_id": "checkpoint-guide",
"kind": "guide",
"entry": "README.md",
"implementation_version": "0.1.0",
"provided_contract": {
"id": "gewu.local-checkpoint",
"version": "0.1.0"
},
"requires_contracts": [],
"required_service_capabilities": [],
"service_capability_status": "unbound-service-schema-pending",
"compatible_checkpoint_contracts": [
"gewu.local-checkpoint@0.1.0"
],
"sha256": "3557c41c1db1892eeaa1f5bd3b8061e8c13b828bc6c608273836448ec2842fe4",
"hash_encoding": "utf8-no-bom-lf"
}
],
"snapshot": {
"algorithm": "sha256",
"scope": "modules array serialized as UTF-8 JSON with sorted keys and compact separators",
"digest": "d968ab13ec3492452842f88feba763b928ece50464dddea0e2cadb91425ca6c4"
}
} }
+2
View File
@@ -6,6 +6,8 @@ Use read tools for retrieval and typed MCP proposals for contributions. Source u
Before a connected operation, persist run/operation identity and input digest in a local checkpoint, then associate service run/proposal IDs as returned. Checkpoints include pack/skill/pipeline versions and hashes, scope, source/extraction references, stage, output hashes, coverage, pending side effects and last receipt. Exclude secrets. Use the host's available safe file tools; these instructions alone do not establish atomic journaling or a durable scheduler. Before a connected operation, persist run/operation identity and input digest in a local checkpoint, then associate service run/proposal IDs as returned. Checkpoints include pack/skill/pipeline versions and hashes, scope, source/extraction references, stage, output hashes, coverage, pending side effects and last receipt. Exclude secrets. Use the host's available safe file tools; these instructions alone do not establish atomic journaling or a durable scheduler.
Use the checkpoint contract in the [pack README](../README.md) and resolve the module registry in the manifest. Record its snapshot digest and every applicable module's contract ID/version and file hash, including the profile and shared protocols. Verify those hashes before resuming; a mismatch requires the original snapshot or an explicitly revalidated successor run.
When a result is uncertain, query upload/proposal/run status using the same operation identity before retrying. Never generate a fresh proposal ID to hide network uncertainty. Resume from preserved artifacts and service receipts; changed content requires a new revision. Do not rerun a model and assume it reproduces the same output. When a result is uncertain, query upload/proposal/run status using the same operation identity before retrying. Never generate a fresh proposal ID to hide network uncertainty. Resume from preserved artifacts and service receipts; changed content requires a new revision. Do not rerun a model and assume it reproduces the same output.
Bound work by source/batch size, stage/model budget and correction attempts. After two unchanged validation failures, stop for diagnosis and report findings. Coverage/skips remain explicit at any stop. Cancellation cannot undo an accepted proposal; check status when a call may have completed. Bound work by source/batch size, stage/model budget and correction attempts. After two unchanged validation failures, stop for diagnosis and report findings. Coverage/skips remain explicit at any stop. Cancellation cannot undo an accepted proposal; check status when a call may have completed.
+2 -2
View File
@@ -8,9 +8,9 @@ GEWU is a local-first, multi-project knowledge base for people and AI agents. It
## Core Mission ## Core Mission
Help project teams find and reuse trustworthy knowledge without losing its source, scope, freshness, or uncertainty. People search, explore and read knowledge through a read-only web UI. Local agents running in Codex, Claude, Antigravity and OpenCode retrieve cited, budgeted results and contribute exclusively through typed MCP proposals. The service validates and automatically accepts eligible proposals under owner-defined policy; humans do not approve every knowledge change. Development runs locally first, with the shared service deployed to the owner’s VPS afterward. Help project teams find and reuse trustworthy knowledge without losing its source, scope, freshness, or uncertainty. People search, explore and read knowledge through a read-only web UI. Local agents running in Codex, Claude, Antigravity and OpenCode retrieve cited, budgeted results and contribute exclusively through typed MCP proposals. GEWU includes a custom local workspace-agent profile with modular skills and pipelines, following the RESEARCH workspace pattern; the selected host supplies its model/runtime. The service validates and automatically accepts eligible proposals under owner-defined policy; humans do not approve every knowledge change. Development runs locally first, with the shared service deployed to the owner’s VPS afterward.
Initially GEWU contains no reasoning agent. It stores original source artifacts or explicit reference-only records, exposes traceable citations, and lets people navigate problems, approaches, concepts and their connections without an agent running. Local agents perform interpretation and propose new knowledge and relationships. Tags support filtering; typed links explain how nodes relate. The GEWU knowledge service contains no reasoning agent. It stores original source artifacts or explicit reference-only records, exposes traceable citations, and lets people navigate problems, approaches, concepts and their connections without an agent running. The custom local agent and other compatible local agents perform interpretation and propose new knowledge and relationships. Tags support filtering; typed links explain how nodes relate.
The initial pilot serves up to five people across 'Dome interactive content' and an 'Interactive Video Platform/Service'. Start with a smaller pilot while retaining the full v1 requirements. Human roles are admin, editor and viewer; editing uses MCP proposals under the read-only web target. Each local agent has its own revocable API key and stable identifier for attribution. Same-agent extraction and support assessment are allowed with recorded assessments and quality sampling. All team members initially read all projects; restricted project access is a later phase. The initial pilot serves up to five people across 'Dome interactive content' and an 'Interactive Video Platform/Service'. Start with a smaller pilot while retaining the full v1 requirements. Human roles are admin, editor and viewer; editing uses MCP proposals under the read-only web target. Each local agent has its own revocable API key and stable identifier for attribution. Same-agent extraction and support assessment are allowed with recorded assessments and quality sampling. All team members initially read all projects; restricted project access is a later phase.
+17 -7
View File
@@ -4,9 +4,9 @@
**Name:** GEWU (格物) draws on *géwù zhìzhī* (格物致知), a classical phrase commonly rendered as investigating things and extending knowledge. Its interpretations vary across traditions. Here it evokes examining sources, connecting evidence-backed ideas, and preserving what teams learn for reuse. **Name:** GEWU (格物) draws on *géwù zhìzhī* (格物致知), a classical phrase commonly rendered as investigating things and extending knowledge. Its interpretations vary across traditions. Here it evokes examining sources, connecting evidence-backed ideas, and preserving what teams learn for reuse.
Version 0.7 (draft) | 12 Oct 2026 | Status: target-alignment and release-readiness review; owner decisions pending Version 0.8 (draft) | 13 Oct 2026 | Status: local workspace-agent and modularity requirements added; remaining policy/operating decisions pending
Current review: [Target alignment and release readiness](reviews/PRD_TARGET_READINESS.md). This revision clarifies acceptance and delivery gates without changing existing P0/P1 priorities. Earlier reviews below retain their historical scope. Current design: [Architecture](architecture/ARCHITECTURE.md), [local agent](architecture/LOCAL_AGENT.md) and [modularity protocol](development/MODULARITY_PROTOCOL.md). Revision 0.8 adds the owner-requested custom local workspace agent and replaceable-module requirement. Existing feature priorities remain; the agent pack does not promote P1 synthesis/advanced curation services to P0. The [target alignment and release readiness review](reviews/PRD_TARGET_READINESS.md) describes revision 0.7; earlier reviews retain their historical scope.
Owner decisions confirmed during this review: a smaller pilot precedes full v1; the pilot projects are Dome interactive content and an interactive video platform/service, for up to five people initially. Routine notes may be extracted and support-assessed by the same local agent, with recorded assessment and quality sampling. Human roles are admin, editor and viewer. Each local agent receives its own API key and stable identifier. Project-restricted access follows later; all-team read access remains the initial target. “Editor” is interpreted as MCP proposal permission under the existing read-only web target. Owner decisions confirmed during this review: a smaller pilot precedes full v1; the pilot projects are Dome interactive content and an interactive video platform/service, for up to five people initially. Routine notes may be extracted and support-assessed by the same local agent, with recorded assessment and quality sampling. Human roles are admin, editor and viewer. Each local agent receives its own API key and stable identifier. Project-restricted access follows later; all-team read access remains the initial target. “Editor” is interpreted as MCP proposal permission under the existing read-only web target.
@@ -41,7 +41,7 @@ Non-goals (v1)
- Replacing project management, CRM or code search tools. KB feeds them knowledge but does not manage tasks or deals. - Replacing project management, CRM or code search tools. KB feeds them knowledge but does not manage tasks or deals.
- A general-purpose chatbot. Agents use KB as a tool, and the UI is for search, navigation and reading. - A general-purpose chatbot. Agents use KB as a tool, and the UI is for search, navigation and reading.
- A story-map authoring editor (a canvas for drawing branching story flows) and an embedded in-UI copilot. Agents reach KB through MCP, and story authoring is a separate product. - A story-map authoring editor (a canvas for drawing branching story flows) and an embedded in-UI copilot. Agents reach KB through MCP, and story authoring is a separate product.
- An internal reasoning agent, autonomous research loop or server-hosted curator in the initial system. Ingest, interpretation, semantic linking and synthesis run in external local agents. Server parsing, indexing, retrieval and policy validation are ordinary service functions; embedding computation does not imply an agent inside KB. - A reasoning agent embedded in the knowledge service, autonomous server research loop or server-hosted curator in the initial system. Ingest, interpretation, semantic linking and synthesis run in local hosts, including the custom GEWU workspace-agent profile. A separate standalone GEWU reasoning runtime is not required. Server parsing, indexing, retrieval and policy validation are ordinary service functions; embedding computation does not imply an agent inside KB.
## Users and use cases ## Users and use cases
| User | Typical needs | Example | | User | Typical needs | Example |
@@ -265,6 +265,7 @@ Priority: P0 required for v1, P1 important, P2 later.
| FR-A8 | MCP resources (schema, project registry, node by ID) and prompts (per-project roles, for example an architecture advisor) alongside the tools. | P1 | | FR-A8 | MCP resources (schema, project registry, node by ID) and prompts (per-project roles, for example an architecture advisor) alongside the tools. | P1 |
| FR-A9 | Typed tools only. No raw query language (Cypher, SQL) is exposed to agents, and every write goes through a proposal. | P0 | | FR-A9 | Typed tools only. No raw query language (Cypher, SQL) is exposed to agents, and every write goes through a proposal. | P0 |
| FR-A10 | Expose service/connector diagnostics and compatible tool/schema/skill versions, authenticated capability, selected scope, source-transfer limits, and index status without secrets. Distinguish configured, connected and workflow-verified clients. Installers preserve unrelated client configuration and support a non-symlink fallback. | P0 | | FR-A10 | Expose service/connector diagnostics and compatible tool/schema/skill versions, authenticated capability, selected scope, source-transfer limits, and index status without secrets. Distinguish configured, connected and workflow-verified clients. Installers preserve unrelated client configuration and support a non-symlink fallback. | P0 |
| FR-A11 | Provide a custom GEWU local workspace-agent pack, following the RESEARCH workspace pattern: one canonical profile, shared protocols, replaceable ingest/query/curate/synthesize skills and coordinating pipeline procedures. Existing supported hosts supply the model/runtime. The pack discovers real MCP capabilities, preserves evidence and permissions, records versioned checkpoints and resumes using durable service receipts. Profile/skill presence alone is not integration acceptance; P1-dependent workflows report unavailable capabilities until implemented. | P0 |
### 7.5 Compilation and curation ### 7.5 Compilation and curation
@@ -293,10 +294,11 @@ Priority: P0 required for v1, P1 important, P2 later.
1. Source of truth: markdown and YAML files in git. 1. Source of truth: markdown and YAML files in git.
2. Derived index: SQLite with full text, vectors and an edges table for v1. It is disposable and rebuildable from canonical files and required source artifacts. Hosted clients use the service rather than opening the database file directly. 2. Derived index: SQLite with full text, vectors and an edges table for v1. It is disposable and rebuildable from canonical files and required source artifacts. Hosted clients use the service rather than opening the database file directly.
3. KB service: one scoped core with a typed MCP contribution/retrieval interface and a read-only HTTP API for the website. CLI utilities support diagnostics, validation, rebuild and maintenance, not knowledge authoring. Only the MCP proposal path can initiate new knowledge changes; the service validates, applies acceptance policy and commits them. 3. KB service: one scoped core with a typed MCP contribution/retrieval interface and a read-only HTTP API for the website. Service maintenance CLI utilities support diagnostics, validation, rebuild and maintenance, not knowledge authoring. A local agent host may have its own CLI, but contributions from it still enter through MCP proposals; the service validates, applies acceptance policy and commits them.
4. Skills: judgment procedures (capture, triage, digest, analyze, link, verify, compile, report), kept as one canonical set with a shared concerns to protocol mapping. 4. Local agent: a custom workspace profile and canonical skill/pipeline pack, executed by an existing local host. Judgment procedures (capture, triage, digest, analyze, link, verify, compile, report) remain modular, with shared concern-specific protocols and versioned inputs/outputs. There is no additional standalone reasoning runtime in this requirement.
5. UI: a read-only client for search, navigation and knowledge display. Its credentials and API surface cannot submit, edit or accept knowledge. 5. UI: a read-only client for search, navigation and knowledge display. Its credentials and API surface cannot submit, edit or accept knowledge.
6. Principle: deterministic strictness lives in code (validator, indexer), not in prompts, so different agents and models are held to the same floor. 6. Principle: deterministic strictness lives in code (validator, indexer), not in prompts, so different agents and models are held to the same floor.
7. Modularity: service, agent-pack, connector and UI responsibilities have public contracts and private implementations. Replacements pass shared contract/consumer tests, with explicit version/state migration and rollback. Configuration/composition selects concrete implementations; unrelated modules do not import their internals.
Reuse from existing work: Jev's contracts, tool registry, owned configuration merging, replay patterns and diagnostics; Winnow's concern-specific protocols, atomic extraction, claim audits and relational synthesis procedures. The [reference review](LOCAL_AGENT_IMPLEMENTATION_REVIEW.md) records limits: Jev's advisory verification/direct writes/character truncation and Winnow's direct vault writes/flattened extraction/prompt-only stages do not satisfy KB's gates. Reimplement those boundaries against KB contracts; no wholesale runtime import is assumed. Reuse from existing work: Jev's contracts, tool registry, owned configuration merging, replay patterns and diagnostics; Winnow's concern-specific protocols, atomic extraction, claim audits and relational synthesis procedures. The [reference review](LOCAL_AGENT_IMPLEMENTATION_REVIEW.md) records limits: Jev's advisory verification/direct writes/character truncation and Winnow's direct vault writes/flattened extraction/prompt-only stages do not satisfy KB's gates. Reimplement those boundaries against KB contracts; no wholesale runtime import is assumed.
Storage decision (v1). Files in git plus SQLite (full text, vectors and an edges table). A graph server is deferred to limit operational complexity; using one as a derived index would not inherently move the source of truth out of git. Revisit after measured graph-query or scale limits. Cloud document parsers, separate entity-tagging models and heavy entity-matching pipelines are also deferred. Agents get typed tools only, never a raw query language. Storage decision (v1). Files in git plus SQLite (full text, vectors and an edges table). A graph server is deferred to limit operational complexity; using one as a derived index would not inherently move the source of truth out of git. Revisit after measured graph-query or scale limits. Cloud document parsers, separate entity-tagging models and heavy entity-matching pipelines are also deferred. Agents get typed tools only, never a raw query language.
@@ -310,6 +312,8 @@ One versioned operation catalog declares schemas, handlers, required capabilitie
Provide a canonical, harness-neutral pack with four initial entry points: ingest, query, curate and synthesize. Skills declare concerns and load only relevant protocols (evidence, scope, relationships, proposals and synthesis). They reference service-published schemas and tool versions instead of copying validator rules. Harness setup translates discovery/connection details; it does not duplicate business logic or require lifecycle hooks. Claude requires its own verified client path rather than inheriting a claim of support from another harness. Provide a canonical, harness-neutral pack with four initial entry points: ingest, query, curate and synthesize. Skills declare concerns and load only relevant protocols (evidence, scope, relationships, proposals and synthesis). They reference service-published schemas and tool versions instead of copying validator rules. Harness setup translates discovery/connection details; it does not duplicate business logic or require lifecycle hooks. Claude requires its own verified client path rather than inheriting a claim of support from another harness.
The owner selected the workspace-agent pattern used by Winnow in SCAR and Praxis in CV. The [GEWU pack](../agents/gewu/README.md) supplies a role, protocols, skill entry points and separate pipeline instructions for an existing local host. Keep the research profile separate from application-development instructions. Model/provider execution belongs to the host; local files do not imply local-only inference. A pipeline document is not a durable scheduler: service run records and receipts, supplemented by private local checkpoints, govern resume and acceptance. Installing a newer skill cannot silently change an active run's pinned instructions.
The local agent reads authoritative project intent and scope through MCP. H1/H2 are explicit task/run context; client cwd and inferred README descriptions are not authority for project selection or H3. External ingestion stages persist source capture, extraction references, triage, bounded note proposals, support assessments and proposed links, then receive validation/acceptance receipts. Resume uses those records instead of conversation history. If lease-based stage ownership is used, an expired worker cannot publish a stale result without revalidation and the current fence. The local agent reads authoritative project intent and scope through MCP. H1/H2 are explicit task/run context; client cwd and inferred README descriptions are not authority for project selection or H3. External ingestion stages persist source capture, extraction references, triage, bounded note proposals, support assessments and proposed links, then receive validation/acceptance receipts. Resume uses those records instead of conversation history. If lease-based stage ownership is used, an expired worker cannot publish a stale result without revalidation and the current fence.
Atomization optimizes for relevant, reusable knowledge rather than maximum note count. Record source coverage and reasons for skipped/deferred portions; do not silently claim exhaustive processing after a budget limit. Curation keeps incompatible perspectives and conditions separate, uses explicit merge/redirect proposals for duplicates and derives backlinks from stored forward edges. Strong similarity or common sources alone do not establish equivalence. Atomization optimizes for relevant, reusable knowledge rather than maximum note count. Record source coverage and reasons for skipped/deferred portions; do not silently claim exhaustive processing after a budget limit. Curation keeps incompatible perspectives and conditions separate, uses explicit merge/redirect proposals for duplicates and derives backlinks from stored forward edges. Strong similarity or common sources alone do not establish equivalence.
@@ -317,7 +321,7 @@ Atomization optimizes for relevant, reusable knowledge rather than maximum note
The capability acceptance matrix records each affected OS/harness pair as PASS, FAIL, BLOCKED, NOT RUN or UNSUPPORTED, with application/connector/service versions and evidence origin. Listing tools or parsing configuration is not the v1 gate: each supported client must perform source transfer, invalid-proposal rejection, eligible automatic acceptance, retry/resume and cited retrieval on the tested deployment. Record local and VPS evidence separately. The capability acceptance matrix records each affected OS/harness pair as PASS, FAIL, BLOCKED, NOT RUN or UNSUPPORTED, with application/connector/service versions and evidence origin. Listing tools or parsing configuration is not the v1 gate: each supported client must perform source transfer, invalid-proposal rejection, eligible automatic acceptance, retry/resume and cited retrieval on the tested deployment. Record local and VPS evidence separately.
### Deployment and execution boundary ### Deployment and execution boundary
During development, the service, repository, private archives, index and web app run locally. For team operation they run on the owner’s VPS; ingestion, reasoning and synthesis agents continue to run in local Codex, Claude, Antigravity and OpenCode sessions. The VPS serves retrieval, validates submitted artifacts/proposals, applies policy, commits accepted records and maintains the derived index. Initially KB hosts no reasoning agent or autonomous curator. Semantic support assessments and proposed connections come from external agents; the server checks required records, deterministic evidence rules and policy, without claiming to independently prove semantic truth. Reading and relationship navigation work when no local agent is running; new semantic analysis and synthesis refresh wait for an external agent run. During development, the service, repository, private archives, index and web app run locally. For team operation they run on the owner’s VPS; ingestion, reasoning and synthesis agents, including the GEWU profile, continue to run in local Codex, Claude, Antigravity and OpenCode sessions. The VPS serves retrieval, validates submitted artifacts/proposals, applies policy, commits accepted records and maintains the derived index. The KB service hosts no reasoning agent or autonomous curator. Semantic support assessments and proposed connections come from local agents; the server checks required records, deterministic evidence rules and policy, without claiming to independently prove semantic truth. Reading and relationship navigation work when no local agent is running; new semantic analysis and synthesis refresh wait for a local agent run.
Migration to the VPS transfers canonical records, private source artifacts, proposal/run/audit records and configuration, then rebuilds or verifies the index. The local service stops accepting writes before the VPS becomes authoritative; v1 does not promise synchronization between independently writable local and VPS copies. Agent MCP endpoint/credential settings change without changing the contribution contract. Local operation remains supported, but remote VPS access requires connectivity. Migration to the VPS transfers canonical records, private source artifacts, proposal/run/audit records and configuration, then rebuilds or verifies the index. The local service stops accepting writes before the VPS becomes authoritative; v1 does not promise synchronization between independently writable local and VPS copies. Agent MCP endpoint/credential settings change without changing the contribution contract. Local operation remains supported, but remote VPS access requires connectivity.
@@ -372,7 +376,7 @@ The full v1 release gate covers every P0 requirement plus backup/restore of cano
| --- | --- | --- | | --- | --- | --- |
| M0 Foundations | Node schema, evidence/edge contracts, project registry, validator, proposal/review API and team capability contracts; 20 hand-guided sources across two projects, with the deep-research report as an ingest fixture once supplied (graded as a secondary, AI-synthesized source) | Validator catches seeded errors. Notes validate. Support-review fixtures distinguish quote presence from supported claims. Required pilot sources and expected answers are supplied and labeled. | | M0 Foundations | Node schema, evidence/edge contracts, project registry, validator, proposal/review API and team capability contracts; 20 hand-guided sources across two projects, with the deep-research report as an ingest fixture once supplied (graded as a secondary, AI-synthesized source) | Validator catches seeded errors. Notes validate. Support-review fixtures distinguish quote presence from supported claims. Required pilot sources and expected answers are supplied and labeled. |
| M1 Service | Index, hybrid search, scoped MCP and read-only HTTP, authentication, durable proposals and automatic acceptance policy | Agents can search, transfer source artifacts and propose from all four harnesses. An eligible proposal is accepted without human action; web writes, unauthorized mutations, scope escape and duplicate acceptance fail. Index-lag recovery is demonstrated. | | M1 Service | Index, hybrid search, scoped MCP and read-only HTTP, authentication, durable proposals and automatic acceptance policy | Agents can search, transfer source artifacts and propose from all four harnesses. An eligible proposal is accepted without human action; web writes, unauthorized mutations, scope escape and duplicate acceptance fail. Index-lag recovery is demonstrated. |
| M2 Ingest | capture, triage, digest, verify, link, run logs, task brief | Cross-agent convergence test passes. | | M2 Ingest | capture, triage, digest, verify, link, run logs, task brief; custom local profile, modular skills and coordinating pipelines | Cross-agent convergence test passes. The custom pack completes the source-to-proposal-to-read workflow, records exact versions, and resumes an uncertain operation without duplicate acceptance. Missing P1 capabilities remain explicit. |
| M3 UI | Read-only project switcher, search, node/source and problem/topic pages, evidence/history, related-node suggestions and staleness | With no agent running, a member opens a problem, explores multiple approaches and their conditions, and follows a citation to an archived source. Suggested matches remain distinguishable from accepted links. Web credentials cannot capture, edit or accept knowledge. | | M3 UI | Read-only project switcher, search, node/source and problem/topic pages, evidence/history, related-node suggestions and staleness | With no agent running, a member opens a problem, explores multiple approaches and their conditions, and follows a citation to an archived source. Suggested matches remain distinguishable from accepted links. Web credentials cannot capture, edit or accept knowledge. |
| M4 Synthesis | analyze, compile, brief, matrix, timeline, curator report | Briefs produced for each audience. | | M4 Synthesis | analyze, compile, brief, matrix, timeline, curator report | Briefs produced for each audience. |
| M5 Multi-project hardening | Promotion to shared, cross-project edge hardening, export and import; acceptance receipts extended to portability workflows | Three projects live on one base without unintended scope mixing. P0 scope enforcement and acceptance receipts already pass at M1. | | M5 Multi-project hardening | Promotion to shared, cross-project edge hardening, export and import; acceptance receipts extended to portability workflows | Three projects live on one base without unintended scope mixing. P0 scope enforcement and acceptance receipts already pass at M1. |
@@ -515,3 +519,9 @@ MCP additionally needs typed source-artifact transfer and proposal operations to
- Added M0 decision gates and a full v1 release gate; retained existing priorities and distinguished confirmed pilot domains from suggested registry IDs. - Added M0 decision gates and a full v1 release gate; retained existing priorities and distinguished confirmed pilot domains from suggested registry IDs.
- Recorded owner decisions: smaller pilot, two named projects, up to five people, same-agent support with quality sampling, admin/editor/viewer roles and per-agent API keys/identifiers. Project-restricted access remains later. - Recorded owner decisions: smaller pilot, two named projects, up to five people, same-agent support with quality sampling, admin/editor/viewer roles and per-agent API keys/identifiers. Project-restricted access remains later.
- No implementation or runtime acceptance is claimed. Exact pilot client/formats, quality-sampling rules and operating targets remain open. - No implementation or runtime acceptance is claimed. Exact pilot client/formats, quality-sampling rules and operating targets remain open.
## Revision notes (0.8)
- Added the owner-requested custom local agent as a workspace profile with skills and pipelines, matching the RESEARCH pattern. Existing local hosts provide execution; the service remains free of an embedded reasoning agent.
- Added FR-A11 and made replaceable modules a non-functional requirement across service, agent pack, connectors and UI. Public contracts, isolated implementations, replacement tests and migration/rollback are part of acceptance.
- Added an initial portable instruction pack and linked its design. Structural validation, installation, connection and live workflow acceptance are separate evidence levels; no service or harness pass is implied by these files.
+6 -3
View File
@@ -1,6 +1,6 @@
# GEWU architecture and engineering handbook # GEWU architecture and engineering handbook
Started 12 October 2026; revised 13 October 2026. Architecture proposal v0.2; implementation has not started. Started 12 October 2026; revised 13 October 2026. Architecture proposal v0.3. The initial local-agent instruction pack exists; service, connector and UI implementation has not started.
**Tagline:** Investigate. Connect. Remember. **Tagline:** Investigate. Connect. Remember.
@@ -15,8 +15,10 @@ GEWU (格物) draws on *géwù zhìzhī* (格物致知), a classical phrase comm
5. [Visual design protocol](development/VISUAL_DESIGN_PROTOCOL.md): the owner-selected editorial research direction and its review gates. 5. [Visual design protocol](development/VISUAL_DESIGN_PROTOCOL.md): the owner-selected editorial research direction and its review gates.
6. [Agent and security protocol](development/AGENT_SECURITY_PROTOCOL.md): agent workflows, permissions, untrusted inputs and client acceptance. 6. [Agent and security protocol](development/AGENT_SECURITY_PROTOCOL.md): agent workflows, permissions, untrusted inputs and client acceptance.
7. [Operations protocol](development/OPERATIONS_PROTOCOL.md): persistence, deployment, backup, migration and incident response. 7. [Operations protocol](development/OPERATIONS_PROTOCOL.md): persistence, deployment, backup, migration and incident response.
8. [Local agent](architecture/LOCAL_AGENT.md) and [source pack](../agents/gewu/README.md): RESEARCH-style workspace profile, modular skills and pipeline procedures.
9. [Module replacement protocol](development/MODULARITY_PROTOCOL.md): public contracts, dependency boundaries, replacement tests, state migration and rollback.
The [independent architecture review](reviews/ARCHITECTURE_SENIOR_REVIEW.md) records the original findings, corrections and limits of verification. The [independent architecture review](reviews/ARCHITECTURE_SENIOR_REVIEW.md) records findings and corrections for the v0.2 acceptance foundation. The [local-agent and modularity addition](reviews/LOCAL_AGENT_MODULARITY_REVIEW.md) records the v0.3 scope and verification separately.
## Decision status ## Decision status
@@ -24,6 +26,7 @@ The [independent architecture review](reviews/ARCHITECTURE_SENIOR_REVIEW.md) rec
| --- | --- | | --- | --- |
| Product requirement | Already stated in GOAL/PRD; this proposal must satisfy it. | | Product requirement | Already stated in GOAL/PRD; this proposal must satisfy it. |
| Owner-selected direction | Warm editorial research workspace, confirmed in this conversation. Exact tokens and layouts remain proposed. | | Owner-selected direction | Warm editorial research workspace, confirmed in this conversation. Exact tokens and layouts remain proposed. |
| Owner-required additions | Custom local agent in the RESEARCH workspace style; modular development across all components with tested replacement paths. |
| Architecture recommendation | Concrete engineering default for review; no implementation or measured acceptance implied. | | Architecture recommendation | Concrete engineering default for review; no implementation or measured acceptance implied. |
| Open owner decision | A policy, staffing, capacity or content choice that engineering cannot present as approved. | | Open owner decision | A policy, staffing, capacity or content choice that engineering cannot present as approved. |
@@ -35,4 +38,4 @@ Start with a disposable local vertical slice: upload an explicitly selected text
Before that boundary becomes a pilot deployment, settle the open decisions listed in the architecture. Implementing a smaller slice does not reduce the PRD's full-v1 requirements for hybrid retrieval, supported source formats, four agent harnesses and portable operation. Before that boundary becomes a pilot deployment, settle the open decisions listed in the architecture. Implementing a smaller slice does not reduce the PRD's full-v1 requirements for hybrid retrieval, supported source formats, four agent harnesses and portable operation.
Runtime versions will be pinned in lockfiles during scaffolding after compatibility checks. There are currently no application manifests, runnable service, browser implementation or deployment tests in this repository. The documents are a reviewable design, not a completion report. Runtime versions will be pinned in lockfiles during scaffolding after compatibility checks. The agent pack has an instruction/version manifest, but there are no application dependency manifests, runnable service, browser implementation or deployment tests in this repository. Skill-file validation is separate from installed discovery and live workflow acceptance.
+17 -4
View File
@@ -1,6 +1,6 @@
# GEWU architecture # GEWU architecture
Status: proposed baseline v0.2 after [independent review](../reviews/ARCHITECTURE_SENIOR_REVIEW.md). Drafted 12 October, revised 13 October 2026. Product authority: [GOAL](../GOAL.md) and [PRD](../PRD.md). Related: [acceptance contract](ACCEPTANCE_CONTRACT.md). Status: proposed baseline v0.3, 13 October 2026. The [independent review](../reviews/ARCHITECTURE_SENIOR_REVIEW.md) covers the v0.2 acceptance foundation; v0.3 adds the owner-required [local agent](LOCAL_AGENT.md) and [module replacement protocol](../development/MODULARITY_PROTOCOL.md). Product authority: [GOAL](../GOAL.md) and [PRD](../PRD.md). Related: [acceptance contract](ACCEPTANCE_CONTRACT.md).
## Decision ## Decision
@@ -8,6 +8,8 @@ Build a modular Python service and a React reading application in the GEWU code
Local agents reason about sources and submit proposals. The service validates their structure, source locations, permissions and policy eligibility, then records accepted changes. People can search and follow evidence without an agent running. The service contains no reasoning agent, autonomous research loop or general-purpose chat endpoint. Local agents reason about sources and submit proposals. The service validates their structure, source locations, permissions and policy eligibility, then records accepted changes. People can search and follow evidence without an agent running. The service contains no reasoning agent, autonomous research loop or general-purpose chat endpoint.
Provide a custom GEWU local agent in the same workspace-profile form as Winnow/Praxis in the RESEARCH folder: a role, shared protocols, modular skills and coordinating pipelines running inside an existing host. The [source pack](../../agents/gewu/README.md) is maintained separately from development instructions. Host/model and transport adaptations can change without duplicating the skill logic; no new standalone reasoning runtime is required.
The starting deployment is one host, one service instance and one canonical writer. This fits the five-person pilot and makes the acceptance boundary inspectable. Capacity remains a measurement gate; five people does not specify simultaneous agent load. The starting deployment is one host, one service instance and one canonical writer. This fits the five-person pilot and makes the acceptance boundary inspectable. Capacity remains a measurement gate; five people does not specify simultaneous agent load.
## Technology choices and reasons ## Technology choices and reasons
@@ -17,7 +19,8 @@ These are proposed baselines, not installed versions. Use Python 3.12 as the ini
| Boundary | Choice | Why for GEWU | Alternative and reconsideration trigger | | Boundary | Choice | Why for GEWU | Alternative and reconsideration trigger |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| Service | Python, FastAPI, Pydantic, Uvicorn; `uv` for environment/locking | Typed validation and the document-processing ecosystem; consistent with useful AAA/Jev patterns. | A TypeScript-only service saves a language but complicates Python parser integration. Revisit if parser requirements disappear. | | Service | Python, FastAPI, Pydantic, Uvicorn; `uv` for environment/locking | Typed validation and the document-processing ecosystem; consistent with useful AAA/Jev patterns. | A TypeScript-only service saves a language but complicates Python parser integration. Revisit if parser requirements disappear. |
| Domain core | Plain typed Python modules, explicit dependency injection | The same scope, evidence and proposal rules serve MCP, reads and maintenance. | No generic pipeline/plugin framework until distinct implementations need one. | | Domain core | Plain typed Python modules, explicit dependency injection and public ports | The same scope, evidence and proposal rules serve MCP, reads and maintenance; implementations can be replaced behind tested contracts. | No generic plugin framework or process per module. Introduce distribution mechanisms only for a demonstrated extension need. |
| Custom local agent | Canonical workspace profile, `SKILL.md` modules and versioned pipeline procedures | Matches the owner's RESEARCH workflow; reuses existing hosts/models while keeping GEWU-specific reasoning procedures portable. | A standalone agent engine adds a runtime to maintain and is outside the selected form. |
| MCP | Official Python MCP SDK; local stdio connector, service Streamable HTTP | One contract across agent harnesses; connector can read selected local files and upload bytes. | Direct remote connections remain a tested option for clients that support the chosen auth profile; a remote path is never a file upload. | | MCP | Official Python MCP SDK; local stdio connector, service Streamable HTTP | One contract across agent harnesses; connector can read selected local files and upload bytes. | Direct remote connections remain a tested option for clients that support the chosen auth profile; a remote path is never a file upload. |
| Canonical knowledge | UTF-8 Markdown with YAML frontmatter, YAML records, native Git CLI | Reviewable records, exact history, portable exports. | A database as canonical storage conflicts with the present PRD. | | Canonical knowledge | UTF-8 Markdown with YAML frontmatter, YAML records, native Git CLI | Reviewable records, exact history, portable exports. | A database as canonical storage conflicts with the present PRD. |
| Private artifacts | Content-addressed filesystem by SHA-256 | Retain originals without growing Git with PDFs/media. Git records hashes and manifests. | Object storage only after one-host capacity/backup measurements justify it. | | Private artifacts | Content-addressed filesystem by SHA-256 | Retain originals without growing Git with PDFs/media. Git records hashes and manifests. | Object storage only after one-host capacity/backup measurements justify it. |
@@ -39,7 +42,8 @@ The exact dependency inventory is a scaffolding deliverable. Model selection and
flowchart LR flowchart LR
H[Human reader] --> W[React website] H[Human reader] --> W[React website]
W --> R[Read HTTP adapter] W --> R[Read HTTP adapter]
A[Local agent harness] --> C[Local stdio MCP connector] PAK[GEWU profile, skills and pipelines] --> A[Existing local agent host]
A --> C[Local stdio MCP connector]
A --> R A --> R
C --> M[Service MCP adapter] C --> M[Service MCP adapter]
O[Human owner client] --> M O[Human owner client] --> M
@@ -59,6 +63,8 @@ flowchart LR
Imports point inward: transport -> application -> domain. Adapters implement storage, Git, clock, parser and embedding interfaces used by application services. Domain code imports neither FastAPI nor MCP nor React. A small lifespan-owned composition root creates services and closes resources. Each application service owns a complete use case; routes translate protocol messages and enforce transport admission. Imports point inward: transport -> application -> domain. Adapters implement storage, Git, clock, parser and embedding interfaces used by application services. Domain code imports neither FastAPI nor MCP nor React. A small lifespan-owned composition root creates services and closes resources. Each application service owns a complete use case; routes translate protocol messages and enforce transport admission.
Every substantial module exposes a versioned public contract and owns its implementation/state. Consumers cannot import its private internals or provider-specific SDK types. The [modularity protocol](../development/MODULARITY_PROTOCOL.md) defines module descriptors, dependency checks, compatible replacement tests and migration/rollback. This applies equally to service components, UI features, skills and pipeline coordinators. Compatible replacement changes composition/configuration rather than unrelated business logic; a breaking replacement declares a consumer migration.
Recommended code layout: Recommended code layout:
```text ```text
@@ -69,6 +75,12 @@ src/skb/
transports/ # MCP, read HTTP, operator/maintenance CLI transports/ # MCP, read HTTP, operator/maintenance CLI
bootstrap/ # configuration and lifespan assembly bootstrap/ # configuration and lifespan assembly
connector/ # local stdio client bridge; uses shared contract package connector/ # local stdio client bridge; uses shared contract package
agents/gewu/ # actual source pack; installed into a research workspace
AGENTS.md # research role, separate from repository development rules
manifest.json # pack/skill/pipeline versions and verified compatibility
protocols/ # evidence, scope and contribution concerns
skills/ # kb-ingest, kb-query, kb-curate, kb-synthesize
pipelines/ # host-executed coordination and checkpoint procedures
web/src/ web/src/
app/ # routes, providers, shell app/ # routes, providers, shell
features/ # search, reading, sources, problems, history features/ # search, reading, sources, problems, history
@@ -124,7 +136,7 @@ Human browser sessions are expiring HttpOnly, Secure, SameSite cookies. The read
For the initial controlled-team connector, document a GEWU provisioned-key authentication profile over TLS. Do not describe this as generic OAuth interoperability. HTTP MCP authorization has its own specification; supporting arbitrary remote OAuth clients requires a separately implemented and tested authorization-server/resource-server profile. The local stdio connector avoids assuming all four harnesses support the same remote authentication flow. For the initial controlled-team connector, document a GEWU provisioned-key authentication profile over TLS. Do not describe this as generic OAuth interoperability. HTTP MCP authorization has its own specification; supporting arbitrary remote OAuth clients requires a separately implemented and tested authorization-server/resource-server profile. The local stdio connector avoids assuming all four harnesses support the same remote authentication flow.
Protected changes use the human-authenticated owner MCP client and a digest-bound decision described in the contract. The proposed owner profile uses a short-lived opaque session obtained by password and TOTP reauthentication in a separate human terminal; it is an GEWU-controlled client profile, not a claim of generic OAuth support. Production separates the human owner credential from the agent's OS account/credential store. Owner-level unrestricted filesystem agents cannot be claimed to be isolated by prompt instructions. Protected changes use the human-authenticated owner MCP client and a digest-bound decision described in the contract. The proposed owner profile uses a short-lived opaque session obtained by password and TOTP reauthentication in a separate human terminal; it is a GEWU-controlled client profile, not a claim of generic OAuth support. Production separates the human owner credential from the agent's OS account/credential store. Owner-level unrestricted filesystem agents cannot be claimed to be isolated by prompt instructions.
Local operation uses the same core and directory layout as the VPS. Development may run on the user's account with disposable data; enforced pilot/team operation uses a separate service identity. VPS publication requires an independent restore test, HTTPS, private volumes and client workflow evidence. Moving authority to the VPS freezes local writes first; there is no independently writable local replica synchronization in v1. Local operation uses the same core and directory layout as the VPS. Development may run on the user's account with disposable data; enforced pilot/team operation uses a separate service identity. VPS publication requires an independent restore test, HTTPS, private volumes and client workflow evidence. Moving authority to the VPS freezes local writes first; there is no independently writable local replica synchronization in v1.
@@ -135,6 +147,7 @@ Local operation uses the same core and directory layout as the VPS. Development
| M0 contract slice | Schemas, state machine, safe file records, scope/policy fixtures; pin dependencies | Seeded invalid evidence/authority rejected; public schemas generated; decisions below settled for affected boundary. | | M0 contract slice | Schemas, state machine, safe file records, scope/policy fixtures; pin dependencies | Seeded invalid evidence/authority rejected; public schemas generated; decisions below settled for affected boundary. |
| Pilot end-to-end | Proposed starting point: Windows/Codex, text/Markdown, two projects plus shared, lexical search first | Upload -> proposal -> automatic acceptance -> committed read -> citation; crash/replay tests; read-only browser. Client/format choice remains recommended. | | Pilot end-to-end | Proposed starting point: Windows/Codex, text/Markdown, two projects plus shared, lexical search first | Upload -> proposal -> automatic acceptance -> committed read -> citation; crash/replay tests; read-only browser. Client/format choice remains recommended. |
| Full P0 service | Hybrid index, all required input types, four harnesses, portability and protected decisions | Per-client transfer/rejection/acceptance/retry/retrieval receipts; no scope or authority bypass. | | Full P0 service | Hybrid index, all required input types, four harnesses, portability and protected decisions | Per-client transfer/rejection/acceptance/retry/retrieval receipts; no scope or authority bypass. |
| Custom agent and module gates | Install GEWU profile/skills into an isolated research workspace; enforce dependency boundaries and pinned module/skill versions | Native host ingestion/query and interrupted-run recovery; compatible module swap passes contract/consumer tests. Instruction-pack presence alone cannot close this gate. |
| Team release | VPS migration, backup/restore, quality sampling, capacity/security acceptance | All selected PRD P0 gates plus measured retrieval, evidence and human reading tasks. | | Team release | VPS migration, backup/restore, quality sampling, capacity/security acceptance | All selected PRD P0 gates plus measured retrieval, evidence and human reading tasks. |
| P1 follow-up | Rich comparisons, graph canvas, promotion/import/export and synthesis/curation | Explicitly selected requirements and their own acceptance evidence. | | P1 follow-up | Rich comparisons, graph canvas, promotion/import/export and synthesis/curation | Explicitly selected requirements and their own acceptance evidence. |
+2
View File
@@ -66,6 +66,8 @@ For a connected run, service run identity, proposal revisions and acceptance rec
Pin the installed pack snapshot for an active run. If that version is unavailable after an upgrade, pause with a compatibility finding or explicitly start a successor run. Reuse previous outputs only when their hashes, evidence bindings and new stage contracts still hold; revalidate downstream stages after changes. Install/version manifests alone cannot enforce this in arbitrary hosts; native workflow tests must demonstrate it. Pin the installed pack snapshot for an active run. If that version is unavailable after an upgrade, pause with a compatibility finding or explicitly start a successor run. Reuse previous outputs only when their hashes, evidence bindings and new stage contracts still hold; revalidate downstream stages after changes. Install/version manifests alone cannot enforce this in arbitrary hosts; native workflow tests must demonstrate it.
The pack manifest supplies per-module implementation and instruction-contract versions, dependencies, compatible checkpoint contracts and file hashes for the profile, shared protocols, skills and pipelines. Run checkpoints retain the snapshot digest and resolved module IDs/contracts/hashes. Its service-capability requirements remain explicitly unbound until wire schemas exist; empty capability arrays are not a declaration of compatibility. The draft checkpoint fields and snapshot calculation are specified in the pack README.
A pipeline has a bounded work/correction budget, explicit coverage and a resumable stop. Two unchanged validation failures are a default stop for diagnosis, not permission to relax checks. Network uncertainty triggers status lookup, not a fresh proposal identity. Protected decisions leave the agent workflow for the separate human owner client. No continuous watcher, automatic external messaging or unbounded research loop is introduced. A pipeline has a bounded work/correction budget, explicit coverage and a resumable stop. Two unchanged validation failures are a default stop for diagnosis, not permission to relax checks. Network uncertainty triggers status lookup, not a fresh proposal identity. Protected decisions leave the agent workflow for the separate human owner client. No continuous watcher, automatic external messaging or unbounded research loop is introduced.
## Acceptance and sequencing ## Acceptance and sequencing
+5 -1
View File
@@ -1,11 +1,15 @@
# Agent contribution and security protocol # Agent contribution and security protocol
Status: proposed v0.1, 12 October 2026. Contracts: [architecture](../architecture/ARCHITECTURE.md) and [acceptance](../architecture/ACCEPTANCE_CONTRACT.md). Status: proposed v0.2, revised 13 October 2026. Contracts: [architecture](../architecture/ARCHITECTURE.md), [local agent](../architecture/LOCAL_AGENT.md) and [acceptance](../architecture/ACCEPTANCE_CONTRACT.md).
## Agent workflow ## Agent workflow
Publish one harness-neutral skill pack with four entry points: `kb-ingest`, `kb-query`, `kb-curate` and `kb-synthesize`. Each names its version, supported service/schema versions, inputs, outputs, relevant protocols and resume behavior. Installers translate configuration/discovery; they do not fork the workflow or validator rules for each harness. Publish one harness-neutral skill pack with four entry points: `kb-ingest`, `kb-query`, `kb-curate` and `kb-synthesize`. Each names its version, supported service/schema versions, inputs, outputs, relevant protocols and resume behavior. Installers translate configuration/discovery; they do not fork the workflow or validator rules for each harness.
The [GEWU source pack](../../agents/gewu/README.md) follows the owner's RESEARCH workspace pattern: profile, shared protocols, modular skills and coordinating pipeline instructions. The selected host supplies the model/runtime. Its manifest currently declares no verified service compatibility. Install into a dedicated research workspace and preserve existing profiles; source-pack creation is not host installation or a successful connection. Local host execution does not establish local-only inference.
Pin pack/skill/pipeline content for active runs, and record version/hash bindings with checkpoints. A profile cannot enforce isolation through prose; service capabilities and deployment permissions remain authoritative. A pipeline Markdown file cannot guarantee durable scheduling. Resume uses service status/receipts and retained output artifacts; missing compatibility or unavailable old instructions must be reported explicitly.
An ingestion run reads explicit project intent, registers a source artifact, records coverage and skips, extracts bounded proposals, supplies evidence-bound support assessments, submits bundles and reports receipts. The service persists the run but does not execute the agent's reasoning stages. A resume inspects existing source/proposal IDs and verified artifacts before repeating work. An ingestion run reads explicit project intent, registers a source artifact, records coverage and skips, extracts bounded proposals, supplies evidence-bound support assessments, submits bundles and reports receipts. The service persists the run but does not execute the agent's reasoning stages. A resume inspects existing source/proposal IDs and verified artifacts before repeating work.
Query results preserve citations, scope, dates, omissions and uncertainty. Curators propose corrections, contradiction links and duplicate candidates without overwriting disagreements. Synthesis cites accepted node revisions and records dependencies; later input changes produce warnings until an external agent proposes a refresh. Query results preserve citations, scope, dates, omissions and uncertainty. Curators propose corrections, contradiction links and duplicate candidates without overwriting disagreements. Synthesis cites accepted node revisions and records dependencies; later input changes produce warnings until an external agent proposes a refresh.
+1 -1
View File
@@ -20,7 +20,7 @@ Every implementation task names its owning module, public boundary and affected
| HTTP/MCP | Validate inputs and map outputs/errors; expose only operations in the allowlisted catalog. No duplicate business rules. | | HTTP/MCP | Validate inputs and map outputs/errors; expose only operations in the allowlisted catalog. No duplicate business rules. |
| Frontend | Read API data, route state and render evidence. No canonical mutation route or hidden browser proposal client. | | Frontend | Read API data, route state and render evidence. No canonical mutation route or hidden browser proposal client. |
| Local skills | Reason and propose using public contracts. No direct canonical edits, SQL tools or assumed human authority. | | Local skills | Reason and propose using public contracts. No direct canonical edits, SQL tools or assumed human authority. |
| Local agent runtime | Own bounded pipeline execution, model/tool dispatch and resumable client checkpoints. Use the service through public MCP contracts; never import its persistence or owner-credential internals. | | Local agent profile and pipelines | Own research-role routing, stage procedures, budgets and resumable checkpoint guidance. The existing host supplies model/tool execution. Use public MCP contracts; never depend on service persistence or owner-credential internals. |
The operation catalog declares name/version, request/response schemas, handler, capabilities, permitted transports, idempotency semantics and limits. Test the generated route/tool surfaces, including forbidden exposure. An MCP `readOnlyHint` is documentation, not enforcement. The operation catalog declares name/version, request/response schemas, handler, capabilities, permitted transports, idempotency semantics and limits. Test the generated route/tool surfaces, including forbidden exposure. An MCP `readOnlyHint` is documentation, not enforcement.
+4 -4
View File
@@ -4,7 +4,7 @@
## Default structure ## Default structure
Use a modular monolith for the service and a separate local-agent application. A module is a coherent responsibility with a public contract, private implementation and declared dependencies. It does not need its own process, repository or package release. Split deployment only when isolation, scaling or independent release needs justify it. Use a modular monolith for the service and a separate local-agent instruction pack executed by an existing host. A module is a coherent responsibility with a public contract, private implementation and declared dependencies. It does not need its own process, repository or package release. Split deployment only when isolation, scaling or independent release needs justify it.
Every feature belongs to a named module. Consumers use its public interface; they cannot import private helpers, inspect its tables, edit its files or rely on provider-specific response objects. Cross-module payloads use GEWU-owned types. The composition root selects implementations and manages their lifetimes. Domain/application code cannot select a concrete implementation through scattered conditionals. Every feature belongs to a named module. Consumers use its public interface; they cannot import private helpers, inspect its tables, edit its files or rely on provider-specific response objects. Cross-module payloads use GEWU-owned types. The composition root selects implementations and manages their lifetimes. Domain/application code cannot select a concrete implementation through scattered conditionals.
@@ -29,8 +29,8 @@ Compatibility is behavioral: valid inputs, errors, cancellation, ordering, idemp
| Search and ranking | Scoped candidates, scores/explanations, revision and budget rules | Replace FTS/vector engine or ranking algorithm without modifying readers. | | Search and ranking | Scoped candidates, scores/explanations, revision and budget rules | Replace FTS/vector engine or ranking algorithm without modifying readers. |
| Identity and credentials | Authenticated principal, capabilities, grants and revocation | Replace login backend without changing proposal authorization semantics. | | Identity and credentials | Authenticated principal, capabilities, grants and revocation | Replace login backend without changing proposal authorization semantics. |
| MCP and HTTP adapters | Versioned wire schemas and domain-error mapping | Update transport SDK without moving rules into routes. | | MCP and HTTP adapters | Versioned wire schemas and domain-error mapping | Update transport SDK without moving rules into routes. |
| Agent model provider | Typed requests/results, usage, timeouts and declared capabilities | Change local/hosted provider without exposing SDK types to skills. | | Agent host/model adapter | Profile discovery, model capabilities, tool access and execution metadata | Change configured host/model without baking provider syntax into shared skills. The host owns its provider SDK. |
| Agent pipeline runner | Stage dispatch, bounded scheduling, checkpoints and outcomes | Replace orchestration library while preserving stage contracts and resume semantics. | | Agent pipeline coordinator | Stage inputs/outputs, work budget, checkpoints and outcomes | Replace coordinating instructions while preserving skill contracts and resume obligations. The initial coordinator is host-executed Markdown, not a standalone engine. |
| Skills and stage handlers | Declared inputs/outputs, tools, prompt/content versions and budget | Replace an extraction or assessment skill without rewriting the pipeline. | | Skills and stage handlers | Declared inputs/outputs, tools, prompt/content versions and budget | Replace an extraction or assessment skill without rewriting the pipeline. |
| Harness adapter | Profile/skill discovery and authenticated public tool access | Change a host's configuration format without duplicating the skill pack. | | Harness adapter | Profile/skill discovery and authenticated public tool access | Change a host's configuration format without duplicating the skill pack. |
| Frontend feature modules | Route/data contract, component props, events and accessibility behavior | Replace an evidence viewer or result list while preserving API and navigation. | | Frontend feature modules | Route/data contract, component props, events and accessibility behavior | Replace an evidence viewer or result list while preserving API and navigation. |
@@ -40,7 +40,7 @@ Compatibility is behavioral: valid inputs, errors, cancellation, ordering, idemp
Public contracts, implementation versions, persisted schemas and model/prompt artifacts have distinct identifiers. Use [semantic versioning](https://semver.org/) for declared stable contracts: compatible additions are minor, fixes are patch, breaking behavior is major. Before 1.0, explicitly list supported contract versions; do not assume every `0.x` update is compatible. Published immutable artifacts are never changed in place. Public contracts, implementation versions, persisted schemas and model/prompt artifacts have distinct identifiers. Use [semantic versioning](https://semver.org/) for declared stable contracts: compatible additions are minor, fixes are patch, breaking behavior is major. Before 1.0, explicitly list supported contract versions; do not assume every `0.x` update is compatible. Published immutable artifacts are never changed in place.
Backend boundaries use typed ports with injected dependencies; the frontend imports feature public exports and shared primitives. Shared contract packages stay small and have no dependency on providers, storage engines or UI frameworks. Reject import cycles and cross-feature private imports in CI. The local agent cannot import service storage/auth internals; its GEWU access is through the public MCP client contract. Backend boundaries use typed ports with injected dependencies; the frontend imports feature public exports and shared primitives. Shared contract packages stay small and have no dependency on providers, storage engines or UI frameworks. Reject import cycles and cross-feature private imports in CI. Local-agent helper/connector code cannot import service storage/auth internals; its GEWU access is through the public MCP client contract.
Configuration selects from installed, reviewed implementations by ID. Validate configuration and capability compatibility before activation. Do not discover executable modules from uploaded sources, skill text, arbitrary import strings or URL-supplied code. Python package entry points are a possible future distribution mechanism, not permission to auto-load third-party code; [the packaging guide](https://packaging.python.org/en/latest/guides/creating-and-discovering-plugins/) describes discovery mechanisms, not trust enforcement. Configuration selects from installed, reviewed implementations by ID. Validate configuration and capability compatibility before activation. Do not discover executable modules from uploaded sources, skill text, arbitrary import strings or URL-supplied code. Python package entry points are a possible future distribution mechanism, not permission to auto-load third-party code; [the packaging guide](https://packaging.python.org/en/latest/guides/creating-and-discovering-plugins/) describes discovery mechanisms, not trust enforcement.
@@ -0,0 +1,27 @@
# Local agent and modularity review
13 October 2026. This record covers the local-agent and modularity additions after the architecture v0.2 review. It does not establish runtime acceptance.
## Requirement and reference findings
The owner requested a custom local agent with skills and pipelines, similar to their RESEARCH agents, and required replaceable modules throughout development. Inspection of Winnow in SCAR and Praxis in CV confirmed the relevant pattern: a workspace role, shared protocols, reusable skills and coordinating procedures executed by an existing host. SCAR's `.agents` points to `.opencode`; CV owns `.agents` directly. Their runtime workflows were not retested, and no reference-workspace instructions were activated for this task.
The [local-agent decision](../architecture/LOCAL_AGENT.md) adopts this form. The [source pack](../../agents/gewu/README.md) contains a profile, readiness/version manifest, evidence/scope/contribution protocols, four skills and four pipeline procedures. It introduces no standalone reasoning engine. Service compatibility and native host acceptance remain unverified. Files are supplied in the repository; no user-global configuration or installed research workspace was changed.
## Design changes
The [modularity protocol](../development/MODULARITY_PROTOCOL.md) makes public contracts, owned state, dependency direction, versioning, migration and replacement evidence explicit. It covers backend adapters, agent instructions, connector and frontend. A modular monolith is the service default; process separation is a deployment decision. Replacement must preserve behavioral and security invariants or declare an explicit contract migration.
The GOAL, PRD, architecture, development and security documents now distinguish the custom local profile from reasoning inside the knowledge service. The profile supplies ingest, query, curate and synthesize procedures; existing P1 synthesis and advanced-curation service priorities remain unchanged. Checkpoints preserve versions and outputs, while actual service receipts remain authoritative for acceptance. Markdown instructions do not establish durable execution, native skill discovery or safe retry behavior by themselves.
## Verification
All four skills pass the skill-creator structural validator. That check covers frontmatter and basic skill structure; it does not test semantic quality, tool connectivity or host behavior. A separate manifest check passed for all 12 referenced paths, unique skill IDs, matching skill names and pipeline versions, and explicit unverified compatibility status.
Across 30 Markdown files, local links and heading anchors resolve; fence and trailing-whitespace checks found no issues. The prose scan checked 76 patterns across the 16 new pack/design/review files and found no matches. `git diff --check` passed. These are static checks; they establish neither execution nor replacement behavior.
The bounded independent review found no blocker and one major gap: the pack's own profile and protocols lacked versioned replacement contracts. The repair adds descriptors for every instruction module and the checkpoint guide, explicit dependencies, checkpoint compatibility, per-file hashes and a snapshot digest. Contribution instructions require those IDs and digests in run records. Service capability binding remains explicitly pending. The descriptor/hash checks establish internal consistency; native resumption and upgrade compatibility still need execution tests.
The reviewer confirmed that finding closed at design level with no residual concrete defect. Final checks cover 13 module descriptors and hashes, their internal dependencies, the snapshot digest, 129 local links and five anchors. Markdown hashes normalize UTF-8/BOM and line endings as specified in the pack guide so checkout conversion does not change instruction identity. Hashes establish content identity, not trust or execution safety.
Runtime acceptance remains pending: install into a disposable workspace after the service contracts exist, verify discovery and read-only retrieval, then complete ingestion, invalid-evidence rejection, uncertain-result recovery and resumption with pinned versions. Full-v1 host claims require the declared client matrix. Module substitution, migration and rollback tests must accompany implementation.