diff --git a/AGENTS.md b/AGENTS.md index 641f8e6..62b553e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -14,8 +14,11 @@ tests. The approved scope is the [Support Desk enhancement plan](https://github. optional `@pegma/knowledge-base-mcp` package for the shared five-operation dispatcher, versioned HTTP contract, and MCP transport. Live host interfaces remain host work; do not create later packages early. -- KB-04 source is merged. KB-05 source preparation adds local D1 conformance, - a public synthetic composition, and exact-artifact release tooling. All four +- [KB-04 source](https://github.com/pegma-dev/knowledge-base/pull/5) and + the separate KB-05 [partial source](https://github.com/pegma-dev/knowledge-base/pull/4) + and [release-preparation source](https://github.com/pegma-dev/knowledge-base/pull/6) + slices are merged. The partial slice adds local D1 conformance and a public + synthetic composition; the release slice adds exact-artifact tooling. All four packages remain unpublished at synchronized version `0.1.0`; source readiness does not complete first publication, registry verification, or host acceptance. - Never implement a database, authorization role model, identity/session/token diff --git a/README.md b/README.md index 210d7b5..faf402d 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,14 @@ Hosts own their users, storage, authorization policy, interfaces, and deployment Knowledge Base owns collection policy, immutable article revisions, validation, and exact publication approval. It requires no GitHub connection or AI provider. -> Development status: KB-01 through KB-03 provide contracts, pure domain +> Development status as of 2026-11-07: KB-01 through KB-03 provide contracts, pure domain > transitions, authorized application/persistence, and bounded retrieval/repair. > [Merged KB-04 source](https://github.com/pegma-dev/knowledge-base/pull/5) adds > the optional five-operation HTTP/MCP adapter and authenticated protocol proof. -> KB-05 source preparation supplies local D1 conformance, a public synthetic -> example, and exact-artifact release tooling. All four packages are unpublished +> The separate [partial KB-05 source](https://github.com/pegma-dev/knowledge-base/pull/4) +> supplies local D1 conformance and a public synthetic example; the later +> [release-preparation source](https://github.com/pegma-dev/knowledge-base/pull/6) +> supplies exact-artifact tooling. Both are merged. All four packages are unpublished > at `0.1.0`. First publication, trusted-publisher setup, registry verification, > and actual two-host existing-login/client acceptance remain separate gates. > This repository is not an operational hosted KB or a production dependency. @@ -47,7 +49,9 @@ Read the [agent API](docs/AGENT_API.md) for the exact contract and Hosts compose the separate [Agent Access](https://github.com/pegma-dev/agent-access) producer with their existing human login and current Admin consent. AUTH-01's [merged source](https://github.com/pegma-dev/agent-access/pull/1) supplies the -source prerequisite; publication remains separate. Initial authoring grants are +source prerequisite, and its +[release preparation](https://github.com/pegma-dev/agent-access/pull/2) is merged. +Agent Access remains unpublished at `0.1.0`. Initial authoring grants are app-instance-wide. Collection-specific delegation is a future host seam. The KB does not issue credentials or implement login, roles, or a limiter. @@ -74,7 +78,9 @@ demonstrates author/test/review/publish/retrieve with fictional trust inputs. The separate `agent:proof` gate composes reviewed pinned AUTH-01 source and all four packed KB artifacts in a temporary consumer with the official MCP SDK `1.32.2`, exercising OAuth, the five tools, evidence binding, and HTTP/MCP parity. -Current-head results establish execution; these proofs establish neither actual +The [historical source-gate record](docs/SOURCE_PREPARATION.md#historical-source-gates) +retains reviewed heads and CI links. Current-head results establish execution; +these proofs establish neither actual requested-client compatibility nor either real host's login/staging acceptance. Develop on Node 22.6.0+ or 24 with pnpm 10.34.5: diff --git a/docs/AGENT_WORKFLOW.md b/docs/AGENT_WORKFLOW.md index 14a5142..4f8b5c4 100644 --- a/docs/AGENT_WORKFLOW.md +++ b/docs/AGENT_WORKFLOW.md @@ -1,8 +1,9 @@ # Agent authoring and test-evidence workflow -KB-04 adds optional authoring transports over the existing Knowledge Base -application. Source work remains in progress until current-head gates and -review pass. All four KB packages are unpublished at `0.1.0`; this document +The [merged KB-04 source](https://github.com/pegma-dev/knowledge-base/pull/5) +adds optional authoring transports over the existing Knowledge Base +application. [KB-05 release-preparation source](https://github.com/pegma-dev/knowledge-base/pull/6) +is also merged. All four KB packages are unpublished at `0.1.0`; this document describes the composition and retained acceptance contract, not a live service or a client-compatibility claim. The exact wire contract is in [AGENT_API.md](AGENT_API.md). @@ -105,14 +106,15 @@ temporary test consumer, and installs all four KB tarballs with the official MCP SDK `1.32.2`. It exercises OAuth and real SDK protocol calls through the five-operation loop, host-attested evidence, HTTP/MCP parity, and rejection cases. The fictional human session, staging run, and attester remain test -inputs. Current-head gate output establishes execution; this document records -no pass verdict. - -KB-04 source exit requires format, type, tests, synthetic example, artifact -checks, and `agent:proof` on Node 22 and 24, plus a clean current-head OpenRouter -review with zero actionable findings and the applicable security checks. It -closes only the source slice. KB-05 owns reviewed publication of the four KB -packages; Agent Access follows its separate first-publication and +inputs. The historical reviewed-head gate results and exact CI links are +recorded in [source preparation](SOURCE_PREPARATION.md#historical-source-gates); +changed source requires fresh +current-head gates. + +The merged KB-04 source exit closes only its source slice. KB-05 release-preparation +source is merged; full KB-05 publication remains open. Agent Access's +[release-preparation source](https://github.com/pegma-dev/agent-access/pull/2) +is also merged and follows its separate first-publication and trusted-publisher process. Both public releases precede production host assembly. Branches, copied source, local paths, and unpublished production tarballs cannot substitute for them. diff --git a/docs/COLLECTIONS.md b/docs/COLLECTIONS.md index 758d509..218c9b7 100644 --- a/docs/COLLECTIONS.md +++ b/docs/COLLECTIONS.md @@ -10,8 +10,10 @@ document alone does not mark a task complete. The authoritative collection is `knowledge-base.records.v1`. The approved scope is the [implementation plan](https://github.com/pegma-dev/support-desk/blob/main/docs/KNOWLEDGE_AI_PLAN.md) -and its P-00 capacity/privacy requirements. MCP, real-host acceptance, and -production readiness remain later gates. +and its P-00 capacity/privacy requirements. KB-04's optional HTTP/MCP adapter +source is [merged](https://github.com/pegma-dev/knowledge-base/pull/5). Package +publication, real-host acceptance, and production readiness remain separate +gates. ## Partition and authority rules diff --git a/docs/HOST_COMPOSITION.md b/docs/HOST_COMPOSITION.md index 60d6655..bd09238 100644 --- a/docs/HOST_COMPOSITION.md +++ b/docs/HOST_COMPOSITION.md @@ -3,16 +3,19 @@ ## Status and ownership This documents the KB-02/KB-03 application and KB-04 transport host boundaries. -KB-04 source is in progress until current-head gates and review pass; neither -real host is ready on that evidence alone. The unpublished application composes -contracts/core with host-supplied Storage Core and Authorization Core. The +[KB-04 source](https://github.com/pegma-dev/knowledge-base/pull/5) and +[KB-05 release preparation](https://github.com/pegma-dev/knowledge-base/pull/6) +are merged; neither real host is ready on that evidence alone. The unpublished +application composes contracts/core with host-supplied Storage Core and +Authorization Core. The optional `@pegma/knowledge-base-mcp` package supplies bounded HTTP/MCP adapters over that application. All four KB packages are unpublished at `0.1.0`. No package becomes an identity system or an operational hosted endpoint. See [declared collections](COLLECTIONS.md) for the required layout, CAS, admission, and replay design. -Independent partial KB-05 [source preparation](SOURCE_PREPARATION.md) adds +The earlier merged [partial KB-05 source](https://github.com/pegma-dev/knowledge-base/pull/4), +documented in [source preparation](SOURCE_PREPARATION.md), adds shared memory/Azurite/local-D1 conformance and a [public synthetic composition](../examples/composition/README.md). The D1 fixture passes a real Miniflare binding directly to the released @@ -24,8 +27,10 @@ AUTH-01's [merged public source](https://github.com/pegma-dev/agent-access/pull/ provides KB-04's credential producer prerequisite. The separate `agent:proof` gate uses that reviewed pinned source only in a temporary consumer with the four KB tarballs and official SDK `1.32.2`. It tests the synthetic OAuth and -draft/evidence transport loop. Actual existing-login/client acceptance on both -hosts, Agent Access publication, and full KB-05 publication remain separate. +draft/evidence transport loop. Agent Access's +[release-preparation source](https://github.com/pegma-dev/agent-access/pull/2) +is also merged. Actual existing-login/client acceptance on both hosts, Agent +Access publication, and full KB-05 publication remain separate. The host owns identity verification, scoped local-agent credentials, current authorization resolution, browser/transport protections, store construction, diff --git a/docs/RELEASING.md b/docs/RELEASING.md index 581bdd4..b9aa420 100644 --- a/docs/RELEASING.md +++ b/docs/RELEASING.md @@ -9,12 +9,15 @@ The release set is exactly these packages, in dependency order: 3. `@pegma/knowledge-base-application` 4. `@pegma/knowledge-base-mcp` -All four have synchronized source version `0.1.0` and remain unpublished. -[KB-04 source](https://github.com/pegma-dev/knowledge-base/pull/5) is merged at -`b61fc77aedd22e888ac7292c3597f93e54fcda8e`; its Node 22/24 lanes passed 372 tests -each and the official-SDK authenticated synthetic protocol proof. KB-05's source -candidate supplies local D1 conformance, public synthetic composition, and the -release tooling. +As of **2026-11-07**, all four have synchronized source version `0.1.0` and +remain unpublished. [KB-04 source](https://github.com/pegma-dev/knowledge-base/pull/5) +and [KB-05 release preparation](https://github.com/pegma-dev/knowledge-base/pull/6) +are merged. The separate earlier [partial KB-05 source slice](https://github.com/pegma-dev/knowledge-base/pull/4) +supplied local D1 conformance and public synthetic composition; PR #6 added +release tooling. The canonical [historical source-gate record](SOURCE_PREPARATION.md#historical-source-gates) +identifies reviewed heads separately from merge commits and retains exact +CI links, counts, review, and security receipts. Full KB-05 publication remains +open. Changed source still needs all current-head gates before release preparation. No source merge configures publishers, creates a tag/release, or publishes npm packages. Follow the [maintainer bootstrap handoff](BOOTSTRAP.md) for first use. @@ -22,7 +25,11 @@ packages. Follow the [maintainer bootstrap handoff](BOOTSTRAP.md) for first use. [Agent Access](https://github.com/pegma-dev/agent-access/pull/1) is a separate release. Its reviewed commit `a444e2113db98455b638b2ef8aa7c2faccb16b62` is built only in `agent:proof`'s isolated test consumer with the four KB tarballs and -official MCP SDK `1.32.2`. Its merged 123-test source result does not publish it. +official MCP SDK `1.32.2`. Its separate +[release-preparation source](https://github.com/pegma-dev/agent-access/pull/2) +is also merged; [source preparation](SOURCE_PREPARATION.md) records its +reviewed-head CI and merge identity. It remains unpublished at `0.1.0`; that release-only merge +does not replace the protocol fixture's original implementation pin. Production hosts require exact published versions of both components. ## Repository and development artifact gates diff --git a/docs/RETRIEVAL.md b/docs/RETRIEVAL.md index 5e38adb..2004451 100644 --- a/docs/RETRIEVAL.md +++ b/docs/RETRIEVAL.md @@ -8,8 +8,10 @@ repository gates remain required. KB-03 extends the existing application package; it creates no new package, database, model integration, or authentication system. All packages remain unpublished at source version `0.1.0`. Source tests and repository gates, not -this document, determine completion. API/MCP, real-host acceptance, and -production activation remain later tasks. +this document, determine completion. KB-04's optional HTTP/MCP adapter source +is [merged](https://github.com/pegma-dev/knowledge-base/pull/5). Package +publication, real-host acceptance, and production activation remain separate +tasks. Read [declared collections](COLLECTIONS.md) for the authoritative record layout and [host composition](HOST_COMPOSITION.md) for trusted access, @@ -232,9 +234,11 @@ draft exclusion, stale index/cache and policy/proof/source revocation, applicability mismatches, safe titles/snippets/counts/errors, whole-source budgets, and instrumented physical read/page ceilings. Maintenance tests cover duplicate/out-of-order jobs, partial failure, bounded resumable scans, -capacity admission, retirement/move cleanup, and repair convergence. Memory -and real-Azurite evidence are source gates; D1 consumer conformance and real -host workflows retain their later release/activation gates. +capacity admission, retirement/move cleanup, and repair convergence. These +public-entry suites run against memory, real Azurite, and real local Miniflare +D1 in the earlier merged [partial KB-05 source slice](SOURCE_PREPARATION.md). +Released-consumer +verification and real host workflows retain their release/activation gates. The executable source cases live in [retrieval tests](../tests/retrieval.test.ts) and [physical-bound tests](../tests/retrieval-bounds.test.ts), using diff --git a/docs/SOURCE_PREPARATION.md b/docs/SOURCE_PREPARATION.md index bd0fdee..84a7645 100644 --- a/docs/SOURCE_PREPARATION.md +++ b/docs/SOURCE_PREPARATION.md @@ -2,15 +2,49 @@ ## Scope and readiness -KB-05 source preparation supplies a real local D1 consumer fixture, a public -synthetic composition, and exact-artifact release tooling. The earlier fixture -slice is [merged](https://github.com/pegma-dev/knowledge-base/pull/4), and -[KB-04 source](https://github.com/pegma-dev/knowledge-base/pull/5) is merged at -`b61fc77aedd22e888ac7292c3597f93e54fcda8e`. That source passed 372 tests on each -Node 22/24 lane and the separate authenticated official-SDK protocol proof. -These are historical merged-source results; current changes require fresh +KB-05 source preparation has two separately reviewed source slices. The earlier +[partial source slice](https://github.com/pegma-dev/knowledge-base/pull/4) +supplied the real local D1 consumer fixture and public synthetic composition. +The later [release-preparation slice](https://github.com/pegma-dev/knowledge-base/pull/6) +added exact-artifact release tooling. Neither source slice completes full +KB-05 publication or host acceptance. + +### Historical source gates + +As of **2026-11-07**, [KB-04 source](https://github.com/pegma-dev/knowledge-base/pull/5) +was merged at +[`b61fc77aedd22e888ac7292c3597f93e54fcda8e`](https://github.com/pegma-dev/knowledge-base/commit/b61fc77aedd22e888ac7292c3597f93e54fcda8e). +The historical gate ran on reviewed head +[`c897626de6c7b2ea574f4154b0bc7a7731ee106e`](https://github.com/pegma-dev/knowledge-base/commit/c897626de6c7b2ea574f4154b0bc7a7731ee106e), +not the subsequent merge commit. Its [CI run](https://github.com/pegma-dev/knowledge-base/actions/runs/42390433045) +passed `format:check`, `check`, `test`, `example`, `release:check`, and +`agent:proof` on both Node 22 and 24: each lane ran 372 runtime tests, the +synthetic example, all four packed-artifact imports, and the separate +authenticated five-operation official-SDK protocol proof. The +[final OpenRouter review](https://github.com/pegma-dev/knowledge-base/pull/5#pullrequestreview-5813559169) +recorded a clean verdict with zero `OPEN` findings, and the +[security receipt](https://github.com/pegma-dev/knowledge-base/pull/5#issuecomment-6709727682) +recorded no issues for that same reviewed head. +[CodeQL](https://github.com/pegma-dev/knowledge-base/actions/runs/42390433140) +also passed for that head. + +As of **2026-11-07**, [KB-05 release preparation](https://github.com/pegma-dev/knowledge-base/pull/6) +was merged at +[`7f5eee68be692b5489de3965f3f5ede7ef7a812d`](https://github.com/pegma-dev/knowledge-base/commit/7f5eee68be692b5489de3965f3f5ede7ef7a812d). +Its final reviewed head +[`c8ef14af0ec32e3903b9399543b7a9f2e48df2f9`](https://github.com/pegma-dev/knowledge-base/commit/c8ef14af0ec32e3903b9399543b7a9f2e48df2f9) +passed the complete gate in this +[CI run](https://github.com/pegma-dev/knowledge-base/actions/runs/42398508042) +on each Node 22/24 lane: +372 runtime tests plus 128 release regressions (500 per lane, zero skips), the +synthetic example, all four packed-artifact imports, and the authenticated +five-operation official-SDK proof. The merge record retains three OpenRouter +review rounds; final round 3 is clean with zero open actionable findings. +See the [final review](https://github.com/pegma-dev/knowledge-base/pull/6#pullrequestreview-5814111477) +and the [security receipt](https://github.com/pegma-dev/knowledge-base/pull/6#issuecomment-6710997171). +These are historical merged-source results; changed source requires fresh current-head gates. All four KB packages remain unpublished at synchronized -source version `0.1.0`. +source version `0.1.0` in the public registry snapshot below. | Evidence area | This source slice | Separate remaining proof | | ---------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------- | @@ -19,10 +53,56 @@ source version `0.1.0`. | Artifacts | Four-package checks and signed-tag preparation with a schema-2 manifest | First publication, trusted-publisher setup, registry integrity/provenance, and released consumers | | Task readiness | Current-head repository gates establish source readiness | Actual publication and two-host/client acceptance remain separately recorded | -The historical result above does not certify this working tree. Record verified +The merged-source results above do not certify this working tree. Record verified current-head gate results before treating changed source as validated. Local emulator and fixture results are not production or live Workers proof. +## Public registry snapshot + +At **2026-11-07T18:48:30Z**, unauthenticated exact-version GET requests to the +public npm registry returned these results: + +| Package | Exact version | HTTP status | +| ----------------------------------- | ------------- | ----------- | +| `@pegma/agent-access` | `0.1.0` | 404 | +| `@pegma/knowledge-base-contracts` | `0.1.0` | 404 | +| `@pegma/knowledge-base-core` | `0.1.0` | 404 | +| `@pegma/knowledge-base-application` | `0.1.0` | 404 | +| `@pegma/knowledge-base-mcp` | `0.1.0` | 404 | + +Reproduce the read-only probe with Node 22/24, for example by piping this +JavaScript to `node --input-type=module`. It requires no install or registry +authentication, requests cache revalidation, rejects redirects, applies a +15-second timeout per request, and cancels each response body: + +```js +const names = [ + "@pegma/agent-access", + "@pegma/knowledge-base-contracts", + "@pegma/knowledge-base-core", + "@pegma/knowledge-base-application", + "@pegma/knowledge-base-mcp", +]; +for (const name of names) { + const response = await fetch( + `https://registry.npmjs.org/${encodeURIComponent(name)}/0.1.0`, + { + redirect: "error", + headers: { "cache-control": "no-cache" }, + signal: AbortSignal.timeout(15_000), + }, + ); + console.log(`${name}@0.1.0 HTTP ${response.status}`); + await response.body?.cancel(); +} +``` + +Only HTTP 404 establishes absence of the public exact version. This snapshot +proves no package-name availability, ownership, private registry state, or +publication authority. Other statuses and transport errors are not absence. +Repeat the probe before relying on availability or planning host activation; +strict full-set release preflight remains authoritative for publication. + ## Pinned local D1 consumer The source dependency snapshot was verified on **2026-11-07**. These are exact @@ -146,7 +226,7 @@ remain the evidence of execution. ## Separate authenticated transport proof -The partial KB-05 composition above still uses synthetic resolved contexts. +The KB-05 composition above uses synthetic resolved contexts. KB-04's `pnpm run agent:proof` separately composes the real [AUTH-01 source](https://github.com/pegma-dev/agent-access/pull/1), pinned to reviewed public commit `a444e2113db98455b638b2ef8aa7c2faccb16b62`, with all four @@ -159,13 +239,13 @@ evidence flow, shared HTTP/MCP behavior, and rejection cases. The evidence attester must bind the authenticated actor and runner to the exact article revision/content hash, staging build, execution result, and opaque receipt; an authenticated agent's claimed `passed` result remains untrusted data. -KB-04's merged-source result records execution; changed source requires fresh -current-head results. +The merged KB-04 and KB-05 source results record execution; changed source +requires fresh current-head results. See [agent workflow](AGENT_WORKFLOW.md) for the retained source and host gates. ## Remaining gates -KB-04's source exit is merged; it does not establish actual clients or two-host +KB-04's source exit was merged; it does not establish actual clients or two-host authentication/staging acceptance. Those gates remain open in P-00 and PG-01/RG-01. Every requested client/mode must record discovery, existing-login/current-Admin consent, the five operations, @@ -182,12 +262,29 @@ public registry. See [release operations](RELEASING.md) and the concrete [bootstrap handoff](BOOTSTRAP.md). Source readiness leaves package ownership, protected tags/environments, approved -signers, first maintainer 2FA publication, per-package trusted publishers, -registry integrity/provenance verification, and released consumers pending. -Manual bootstrap is not OIDC provenance. Agent Access has its own publication -prerequisites, also required before host assembly; AUTH-01's merged source at -`a444e2113db98455b638b2ef8aa7c2faccb16b62` and its 123-test source result do -not publish it. SD-02 waits for KB publication, and both hosts wait for exact +signers, first maintainer 2FA publication, per-package trusted publishers, and +explicit direct-publishing permission pending. Full KB-05 also requires a +separately reviewed synchronized first advertised version and exact pin change, +then its own complete-set registry integrity/signature/provenance verification +and released-consumer proof. Manual bootstrap is not OIDC provenance. +Agent Access has its own publication +prerequisites, also required before host assembly. +[Agent Access release preparation](https://github.com/pegma-dev/agent-access/pull/2) +was merged at +[`eddddd5e333ce16b6a4a8233b84656b3ac784947`](https://github.com/pegma-dev/agent-access/commit/eddddd5e333ce16b6a4a8233b84656b3ac784947). +As of **2026-11-07**, its final reviewed head +[`165e56ab19e9860d6c0bd17f419052b751394b9c`](https://github.com/pegma-dev/agent-access/commit/165e56ab19e9860d6c0bd17f419052b751394b9c), +rather than the merge commit, +passed this [CI run](https://github.com/pegma-dev/agent-access/actions/runs/42399414623). +Its Node 22/24 lanes each passed 123 runtime tests and 136 release +regressions with zero skips; its merge record retains three OpenRouter review +rounds, with final round 3 clean and zero open actionable findings. +See the [final review](https://github.com/pegma-dev/agent-access/pull/2#pullrequestreview-5814178148) +and the [security receipt](https://github.com/pegma-dev/agent-access/pull/2#issuecomment-6711125916). +It remains unpublished at `0.1.0`. The KB protocol fixture still pins AUTH-01's +original implementation commit `a444e2113db98455b638b2ef8aa7c2faccb16b62`; +the separate release-preparation merge does not change that immutable fixture. +SD-02 waits for KB publication, and both hosts wait for exact published KB and Agent Access dependencies before their retained acceptance. Hosts must wait for exact released artifacts rather than adopting branches, copied source, local paths, or unpublished production tarballs. diff --git a/packages/contracts/README.md b/packages/contracts/README.md index ad7a5f7..0308fc0 100644 --- a/packages/contracts/README.md +++ b/packages/contracts/README.md @@ -2,8 +2,9 @@ Provider-free collection, immutable article revision, validation evidence, and exact approval contracts for a composable knowledge base. This package owns -permission names; the host's Authorization Core composition owns their meaning -and enforcement. Identity and time types come from `@pegma/spine`. +permission names; the application enforces current permission/resource checks +using host-resolved Authorization Core contexts. Identity and time types come +from `@pegma/spine`. Collections independently enable portal and bot use for an explicit audience. Every article inherits its collection policy; there are no article-level access @@ -13,8 +14,8 @@ public collection approval; both initial hosts keep it disabled. Content edits create a new immutable `ArticleRevision`. `Article` is a bounded transition aggregate containing the current draft and at most one published -snapshot; it is not a revision archive. Application services must retain -bounded revision history separately and authorize access to it. An existing +snapshot; it is not a revision archive. The application retains bounded +revision history separately and authorizes access to it. An existing publication can remain while an update awaits review. Retirement removes the published snapshot from the transition result. @@ -25,12 +26,13 @@ protected artifact references, and an attestation receipt. A `passed` result alone is insufficient. Hashes use lowercase hexadecimal SHA-256. These types do not authenticate identity or prove a submitted attestation. The -later application/host boundary must authenticate the runner and reviewer, +application/host boundary must authenticate the runner and reviewer, verify the attestation against its trusted verifier, apply current permission and resource checks, and control private evidence access. Authoring callers cannot grant themselves publication authority by supplying these fields. The package does not own persistence, an access model, HTTP/MCP transports, safe HTML rendering, arbitrary URL fetching, code execution, GitHub, or model -integration. Evidence and approval records are private staff material; later -customer/bot projections must return approved article content only. +integration. Evidence and approval records are private staff material; the +application's customer/bot DTOs return approved article content and safe +metadata only. diff --git a/packages/contracts/src/index.ts b/packages/contracts/src/index.ts index 7799f12..c77eb73 100644 --- a/packages/contracts/src/index.ts +++ b/packages/contracts/src/index.ts @@ -191,7 +191,7 @@ export interface PublishedArticle { /** * Bounded transition input/output: one current revision and one publication. - * Durable immutable revision history is owned by later application services. + * Durable immutable revision history is owned by application services. */ export interface Article { readonly id: ArticleId; diff --git a/packages/core/README.md b/packages/core/README.md index 14ce6ab..6ea4b64 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -70,8 +70,9 @@ to detect same-version mutation. It is only a policy-binding predicate. It does not authorize a read, authenticate external evidence, establish retained evidence availability/revocation, or implement customer retrieval. Never expose an aggregate or its private approval/evidence fields directly to customers or -the model. Never expose or log raw aggregates. Authorized DTO construction, -evidence access, retention, and deletion belong to KB-02 and the host. +the model. Never expose or log raw aggregates. Authorized DTO construction +and evidence access belong to the application. Hosts own retention/deletion; +the bounded application history has no compaction operation. All times, identities, and policies are explicit inputs. A **ReviewContext** must come from the trusted application: it supplies current collection and @@ -82,8 +83,9 @@ review or evidence operation cannot predate the supplied collection's latest update. Older evidence can remain valid when the operation uses current time and the evidence still satisfies its exact binding and freshness requirements. A caller inventing an attestation object has not produced verification proof. -The later API/MCP boundary must verify receipts and authorize evidence -submission before calling these transitions. +The application verifies receipts through its trusted host port and authorizes +evidence submission before calling these transitions. The optional HTTP/MCP +adapter uses that same application boundary. A draft targeting a future build waits for matching verification or is revised; evidence for a different staging build fails closed. @@ -104,8 +106,8 @@ rendered as text. 32 current evidence records, 16 steps per record, and eight artifact references per record. Other strings and identity lists also have explicit bounds. These are validation ceilings, not measured production throughput, retention, -rate limits, or model budgets. KB-02 must separately bound durable partitions, -retained history, and transaction work. +rate limits, or model budgets. The application separately bounds durable +partitions, retained history, and transaction work. Domain failures are **KnowledgeBaseError** with code and field. Core does not implement HTTP mappings, replay receipts, concurrent storage updates,