diff --git a/AGENTS.md b/AGENTS.md index 62b553e..98dcdc7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -19,8 +19,10 @@ tests. The approved scope is the [Support Desk enhancement plan](https://github. 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. + `0.1.0` packages completed manual maintainer bootstrap with exact-byte + postflight on 2026-11-07, without OIDC provenance. Source `0.1.1` is a candidate + for the first advertised trusted release; its review, publication, strict + registry/provenance verification, and host acceptance remain gates. - Never implement a database, authorization role model, identity/session/token system, audit log, request limiter, or durable scheduler here. Compose the corresponding Pegma package in the owning later task. @@ -97,18 +99,25 @@ tarballs. Independently retain its SHA-256 digest; never trust a digest taken only from the downloaded artifact. Preflight all four registry versions before any publish, and recover only by accepting byte-identical existing artifacts. See [release operations](docs/RELEASING.md) and the -[first-publication handoff](docs/BOOTSTRAP.md). Maintainer 2FA bootstrap and -external package ownership, signer, tag, environment, and trusted-publisher -settings remain separate gates. OIDC publishing receives only verified prepared +[first-publication handoff](docs/BOOTSTRAP.md) for the completed manual bootstrap +receipt and pending trusted release. All five KB/Agent Access trusted publishers +have been configured through the CLI; that configuration does not prove a +trusted publish. Recheck ownership, signer, tag, approval environment, direct +publishing, and 2FA/token restrictions for the release. OIDC publishing receives only verified prepared artifacts; it installs nothing, rebuilds no packages, and has no token fallback. A separate unprivileged job installs registry packages in an isolated temporary consumer with lifecycle scripts disabled and verifies signatures/provenance. `pnpm test` includes `test:release`'s release identity, manifest, argument, and registry regressions; these must execute on both Node lanes. -The protocol proof may build the reviewed, pinned public AUTH-01 source in an -isolated temporary consumer with all four KB tarballs and the official SDK. -That test-only exception never authorizes an unpublished production dependency. -Agent Access publication and KB-05 publication both precede real host assembly. +Agent Access `0.1.1` has completed its verified trusted release; retain its +[receipt](docs/BOOTSTRAP.md#verified-agent-access-prerequisite). The active +protocol proof installs exact registry `@pegma/agent-access@0.1.1` with all four +packed KB candidate artifacts and the official SDK in a fresh temporary consumer, +with lifecycle scripts disabled. It accepts no source-producer fallback. +Historical source-fixture evidence is not evidence for changed proof code; +current-head Node 22/24 gates must execute the registry composition. The KB +`0.1.1` candidate's own review, publication, strict registry verification, and +host acceptance remain open before real host assembly. Keep actual existing-login/Admin-consent and every requested client/mode proof open in P-00 and PG-01/RG-01 until both hosts record them before activation. diff --git a/README.md b/README.md index faf402d..64329dc 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,10 @@ and exact publication approval. It requires no GitHub connection or AI provider. > 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, +> supplies exact-artifact tooling. Both are merged. All four `0.1.0` packages +> completed manual bootstrap with exact-byte postflight on 2026-11-07, without +> OIDC provenance. Source `0.1.1` is a candidate for the first advertised trusted +> release. Its review, publication, strict registry/provenance verification, > and actual two-host existing-login/client acceptance remain separate gates. > This repository is not an operational hosted KB or a production dependency. @@ -51,7 +53,9 @@ 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, 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 +Agent Access `0.1.0` completed manual bootstrap without OIDC provenance, and its +`0.1.1` trusted release is now verified. The [release receipt](docs/BOOTSTRAP.md#verified-agent-access-prerequisite) +closes that public producer prerequisite only. 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. @@ -75,12 +79,13 @@ physical work/source budgets, whole-article token accounting, and repair. conformance against memory, local Azurite, and real local Miniflare D1 through the released D1 adapter. The [synthetic composition](examples/composition/README.md) 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 +The active `agent:proof` gate installs exact registry +`@pegma/agent-access@0.1.1` and all four packed KB candidate artifacts in a fresh +temporary consumer with lifecycle scripts disabled and the official MCP SDK `1.32.2`, exercising OAuth, the five tools, evidence binding, and HTTP/MCP parity. 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 +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: @@ -98,9 +103,10 @@ pnpm run agent:proof The npm and pnpm workspace declarations deliberately name the same four source packages: pnpm links them for development, while npm supplies artifact packing. The release check installs all four tarballs in a consumer outside either -workspace to verify dependency resolution without source links. The Agent -Access source fixture is confined to the temporary protocol-proof consumer; -production hosts must consume exact published Agent Access and KB versions. +workspace to verify dependency resolution without source links. The protocol +proof's Agent Access producer comes from the public registry with no source +fallback; production hosts must consume exact verified trusted Agent Access +and KB versions. Frozen installation permits the pinned native `workerd` install script only; test workers/timeouts and per-factory D1 disposal remain bounded. @@ -120,11 +126,17 @@ Read [AGENTS.md](AGENTS.md) before changing code and pack checks are separate from signed-tag release preparation. The release path binds all four tarballs to source identity and an independently retained manifest digest, preflights the full registry set, and verifies released consumers. -Merging source does not publish a package. Follow the -[maintainer bootstrap handoff](docs/BOOTSTRAP.md) for the four new npm names, -then configure their individual trusted publishers for later releases. Agent -Access follows its separate release process. SD-02 and host installation wait -for actual published dependencies; source and synthetic proof cannot satisfy +Merging source does not publish a package. The +[maintainer bootstrap ledger](docs/BOOTSTRAP.md) records the completed manual +`0.1.0` uploads and exact-byte postflight. All five KB/Agent Access trusted +publishers are configured through the CLI. Agent Access's verified trusted +`0.1.1` release is complete, while the KB trusted release remains gated. The +four KB packages' `latest` tags still resolve to `0.1.0`. A verified KB `0.1.1` +release is intended to advance them. An earlier attempt to delete Agent Access's +`latest` tag returned HTTP 400 before its `0.1.1` release. Agent Access now has +`latest: 0.1.1` and `bootstrap: 0.1.0`. +This does not advertise the KB bootstrap set or approve host use. SD-02 and host installation wait +for the verified trusted dependencies; source and synthetic proof cannot satisfy real host acceptance. Built in the open by RetireGolden, LLC. diff --git a/docs/AGENT_API.md b/docs/AGENT_API.md index acdb4b0..97688ae 100644 --- a/docs/AGENT_API.md +++ b/docs/AGENT_API.md @@ -3,9 +3,13 @@ `@pegma/knowledge-base-mcp` supplies a shared dispatcher, strict Zod schemas, an MCP adapter, and a Web Request/Response adapter. Both transports invoke the existing `KnowledgeBaseApplication`; neither introduces -an authorization engine or another article lifecycle. These source packages are -unpublished. Passing synthetic transport tests does not establish live OAuth, -protected staging execution, publication, or host readiness. +an authorization engine or another article lifecycle. The KB `0.1.0` packages +completed manual bootstrap without OIDC provenance; source `0.1.1` remains an +unpublished candidate with its own gates and verified trusted release pending. +Agent Access's verified public `0.1.1` producer prerequisite is closed; see the +[release receipt](BOOTSTRAP.md#verified-agent-access-prerequisite). Passing +synthetic transport tests does not establish live host login, protected staging +execution, KB trusted publication, or host readiness. ## Trusted host composition diff --git a/docs/AGENT_WORKFLOW.md b/docs/AGENT_WORKFLOW.md index 4f8b5c4..63fbf16 100644 --- a/docs/AGENT_WORKFLOW.md +++ b/docs/AGENT_WORKFLOW.md @@ -3,7 +3,9 @@ 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 +is also merged. All four KB `0.1.0` packages completed manual bootstrap and +exact-byte postflight without OIDC provenance. Source `0.1.1` is a candidate +for the first advertised trusted release, which remains gated; 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). @@ -100,22 +102,30 @@ claim that the historical state is still current. ## Source proof and retained host acceptance [AUTH-01 PR #1](https://github.com/pegma-dev/agent-access/pull/1) merged the public -credential producer source. The KB `pnpm run agent:proof` gate pins reviewed -commit `a444e2113db98455b638b2ef8aa7c2faccb16b62`, builds it only in an isolated -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 +credential producer source. The active KB `pnpm run agent:proof` gate now +installs exact public-registry `@pegma/agent-access@0.1.1` and all four packed +KB candidate artifacts in a fresh temporary consumer with lifecycle scripts +disabled and 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. 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. +Historical source-proof evidence retains the original reviewed AUTH-01 +`a444e2113db98455b638b2ef8aa7c2faccb16b62` fixture. The registry composition +accepts no source fallback and requires its own current-head gate results. 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 +is also merged; its manual `0.1.0` bootstrap is complete and its verified +trusted `0.1.1` release closed the public producer prerequisite at +**2026-11-07T22:32:42Z**. The +[release ledger](BOOTSTRAP.md#verified-agent-access-prerequisite) records exact +identities, the successful attempt-2 workflow, and strict verification stdout. +The KB `0.1.1` candidate remains unpublished with its own gates, PR, and trusted +release pending. Both verified trusted releases precede production host assembly. Branches, copied source, local paths, and unpublished production tarballs cannot substitute for them. diff --git a/docs/BOOTSTRAP.md b/docs/BOOTSTRAP.md index 1cf0bc8..c774654 100644 --- a/docs/BOOTSTRAP.md +++ b/docs/BOOTSTRAP.md @@ -2,18 +2,137 @@ ## Current state and owner -The maintainer owns npm's first-publication and external configuration steps. -All four KB package names are unpublished at synchronized source version -`0.1.0`. No tag, GitHub release, npm publication, publisher setting, or protection -setting is created by merging KB-05 source. Agent Access has its own separate -first-publication process. +The maintainer owns npm publication and external configuration. All four KB +`0.1.0` uploads were accepted through manual bootstrap, and their exact-byte +postflight passed at **2026-11-07T21:56:24Z**. Agent Access `0.1.0` also completed +manual bootstrap and postflight. Neither bootstrap has OIDC provenance. +Source `0.1.1` is the KB candidate for a separately reviewed first advertised +trusted release; it is not published or verified by this document. +Agent Access has since completed its verified trusted `0.1.1` release, recorded +below; that closes the public producer prerequisite only. + +The five KB/Agent Access trusted-publisher entries have been configured through +the CLI. An actual trusted release still requires the reviewed source and +current-head gates, approved signed tag, protected main ancestry, environment +approval, direct-publishing permission, 2FA/token restrictions, and its own +strict registry/provenance verification. See the full external checklist in +[release operations](RELEASING.md). This handoff deliberately separates creating the npm names from the first advertised trusted release. Manual maintainer 2FA publication does not establish OIDC provenance. It cannot be substituted for the strict `verify` result in [release operations](RELEASING.md). -## Prepare the initial exact set +## Recorded manual bootstrap receipt + +The public preparation identities were: + +| Producer | Signed tag and exact source commit | Prepare-only workflow | Artifact ID | Independently retained manifest SHA-256 | +| --------------------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------- | ------------- | ------------------------------------------------------------------ | +| KB, all four packages | `v0.1.0` at `f053db194eb73610e9b4872e1562f071ab8e6a5f` | [42415793421](https://github.com/pegma-dev/knowledge-base/actions/runs/42415793421) | `13591841615` | `45117cadad75a51aa9b818934974b60c17ba5ddee229fa766157a75035a653ee` | +| Agent Access | `v0.1.0` at `d4db0065f22a9c090fc2831b3e18fbbc37c1639c` | [42415787142](https://github.com/pegma-dev/agent-access/actions/runs/42415787142) | `13591317099` | `885d5422930e2dd3435f0ebea02fb74238b946c962715b2b1d81954684a10312` | + +The workflows prepared artifacts only. The maintainer separately uploaded the +verified `0.1.0` tarballs with interactive 2FA, using the historical procedure +below. After all five uploads were accepted, the operator ran each producer's +read-only `preflight` at **2026-11-07T21:56:24Z**. The following command blocks +are normalized reproducible forms: `PREPARED_DIRECTORY` replaces the private +local exact-artifact directory. The public identity arguments and digests are +the actual recorded values. + +KB command: + +```sh +node scripts/release-packages.mjs preflight --prepared-dir PREPARED_DIRECTORY --manifest-sha256 45117cadad75a51aa9b818934974b60c17ba5ddee229fa766157a75035a653ee --tag v0.1.0 --expected-commit f053db194eb73610e9b4872e1562f071ab8e6a5f +``` + +Operator-recorded stdout, verbatim; exit code `0`: + +```text +@pegma/knowledge-base-contracts@0.1.0: skip +@pegma/knowledge-base-core@0.1.0: skip +@pegma/knowledge-base-application@0.1.0: skip +@pegma/knowledge-base-mcp@0.1.0: skip +``` + +Agent Access command, run with that producer's script: + +```sh +node scripts/release-packages.mjs preflight --prepared-dir PREPARED_DIRECTORY --manifest-sha256 885d5422930e2dd3435f0ebea02fb74238b946c962715b2b1d81954684a10312 --tag v0.1.0 --expected-commit d4db0065f22a9c090fc2831b3e18fbbc37c1639c +``` + +Operator-recorded stdout, verbatim; exit code `0`: + +```text +@pegma/agent-access@0.1.0: skip +``` + +These are manual operator receipts, not CI results. Each `skip` means the +strict postflight accepted the existing exact version's metadata and tarball +bytes against its prepared artifact. This is bootstrap integrity evidence; +it is not the trusted-release `verify` result or OIDC provenance. + +At the manual-bootstrap checkpoint, the observed npm `latest` dist-tags resolved +to `0.1.0` despite the publishes using `--tag bootstrap`. An earlier attempt to +delete Agent Access's `latest` tag returned HTTP 400 before its `0.1.1` release. +The four KB packages' `latest` tags still resolve to `0.1.0`; their intended +correction is a verified forward `0.1.1` release. +Agent Access's current `latest` is `0.1.1` and its `bootstrap` remains `0.1.0`. +Neither tag behavior nor package availability advertises the KB bootstrap as +the approved dependency set or authorizes host installation. + +## Verified Agent Access prerequisite + +At **2026-11-07T22:32:42Z**, Agent Access `0.1.1` completed strict registry and +clean-consumer verification. Its [release PR #4](https://github.com/pegma-dev/agent-access/pull/4) +was merged, and its signed annotated `v0.1.1` tag targets +[`ffe4d8616632ce9d057caaf65124746f03d4d349`](https://github.com/pegma-dev/agent-access/commit/ffe4d8616632ce9d057caaf65124746f03d4d349). +The [trusted workflow run](https://github.com/pegma-dev/agent-access/actions/runs/42420302775) +succeeded on attempt 2. The separate unprivileged +[strict verification job](https://github.com/pegma-dev/agent-access/actions/runs/42420302775/job/128549453970) +recorded this stdout: + +```text +Verified registry release and clean consumer for 1 packages. +``` + +That verification covered exact registry bytes/dependencies, cryptographic +signatures, source-bound provenance, and clean consumer imports. The retained +artifact identity is: + +| Field | Value | +| --------------------------------------- | ------------------------------------------------------------------------------------------------- | +| Artifact ID | `13592934200` | +| Downloaded artifact archive SHA-256 | `8a29c3a60cfe1307d4dd5375d02c36b136bcdd404dcbea256ce32970e26ccbe6` | +| Independently retained manifest SHA-256 | `aff861e5e7e62612f42ce7b633519e86b0b5d11712e215f7c33fe5d30ba2198c` | +| Prepared producer tarball filename | `pegma-agent-access-0.1.1.tgz` | +| Producer tarball SHA-1 | `e590e4cfc8dc1c5a44292628099706b0ab919479` | +| Producer tarball SHA-512 integrity | `sha512-C8t2kkv2piE9Jxt48hrRj+dYDoBd4BMgyO9JpgBQT5ycr8xZx4hq43DSG9I/KjjPQhEvRhp7obYnZ/IiBme/Jw==` | + +The prepared producer filename and tarball hashes come from the independently +digest-bound manifest above in CI artifact `13592934200`. The linked strict +verification job verified that prepared identity against the registry release; +the proof's integrity pin uses those bound bytes rather than live registry +metadata as its trust anchor. + +Attempt 1's bounded registry-visibility window elapsed before verification +could observe the release. After the exact version became visible, strict +preflight accepted its identical bytes and the failed-only rerun reused the +original artifact and independent manifest binding. Attempt 2 then completed +verification; no package version or artifact was replaced. + +This closes the verified public Agent Access `0.1.1` prerequisite. The KB +protocol proof now composes that exact registry producer with four packed KB +candidate artifacts in a fresh consumer. KB `0.1.1` remains an unpublished +candidate with its own current-head gates, PR, trusted release, and strict +verification pending. Existing-login, current-Admin consent, every requested +client/mode, and both real hosts remain separately unproven. + +## Historical initial preparation procedure (`0.1.0`) + +The following procedure and literal versioned commands describe the completed +bootstrap. Current trusted-release operations use the placeholders in +[release operations](RELEASING.md); do not rerun a completed publication. 1. Confirm ownership and publishing permission for all four names. Record the maintainer responsible for each package and its 2FA publication. Keep @@ -52,7 +171,7 @@ OIDC provenance. It cannot be substituted for the strict `verify` result in tarball bytes. Only HTTP 404 establishes absence. Stop for any mismatch, access failure, or uncertain registry response. -## Maintainer 2FA bootstrap +## Historical maintainer 2FA bootstrap (`0.1.0`) Publish only the exact prepared tarballs, in this order, using the maintainer's interactive npm login and 2FA. Commands below are the handoff for that operator; @@ -76,16 +195,17 @@ the released dependency set or authorize host installation from it. ## First advertised trusted release -After the names exist, the maintainer configures all four trusted publishers, -the protected `npm-publish` environment, approved signers, and immutable tag -protection as described in [release operations](RELEASING.md). Each npm publisher +The names now exist and all five KB/Agent Access trusted-publisher entries have +been configured through the CLI. Recheck the protected `npm-publish` environment, +approved signers, immutable tag protection, and publishing policy as described +in [release operations](RELEASING.md). Each KB npm publisher must name this repository's exact `publish.yml` workflow and environment and explicitly permit direct publishing. Time new configurations to the prepared trusted release so their first-use expiry does not strand the release. -The first advertised release needs a separately reviewed synchronized version -and exact dependency-pin change. This source change chooses no future version -and performs no bump. A previously manually published version cannot be +The first advertised KB release candidate is synchronized version `0.1.1` with +exact internal dependency pins. It still needs review and all current-head +gates before release. A previously manually published version cannot be republished through OIDC to add provenance. Run the full review/Node 22/24 gate for the newly reviewed commit, create its approved signed annotated version tag on `origin/main`, then create its GitHub release with `--verify-tag` to trigger @@ -96,6 +216,9 @@ Advertise availability only after its separate unprivileged strict `verify` job succeeds for the entire set: registry bytes/dependencies, clean exact-version registry consumer, registry signatures, and matching source/workflow/tag/commit provenance. Preserve those -results with the release identity and independent manifest digest. SD-02 waits -for this published KB set; both hosts additionally require published Agent -Access and their retained actual login/Admin-consent/client/staging acceptance. +results with the release identity and independent manifest digest. The active +KB protocol proof uses the verified registry producer +`@pegma/agent-access@0.1.1`; historical source-producer evidence remains in +[source preparation](SOURCE_PREPARATION.md). SD-02 still waits for the verified +trusted KB set. The Agent Access release prerequisite is closed; both hosts +still require their retained actual login/Admin-consent/client/staging acceptance. diff --git a/docs/HOST_COMPOSITION.md b/docs/HOST_COMPOSITION.md index bd09238..f5583e6 100644 --- a/docs/HOST_COMPOSITION.md +++ b/docs/HOST_COMPOSITION.md @@ -5,11 +5,14 @@ This documents the KB-02/KB-03 application and KB-04 transport host boundaries. [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 +are merged; neither real host is ready on that evidence alone. The 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`. +over that application. All four `0.1.0` packages completed manual bootstrap +and exact-byte postflight without OIDC provenance. Source `0.1.1` is a candidate +for the first advertised trusted release; review, publication, strict registry/ +provenance verification, and host acceptance remain gates. 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. @@ -24,13 +27,19 @@ It is local consumer evidence, not a deployed Workers binding or production acceptance. The example's resolved contexts and receipt registry stand in for trusted host facts; they authenticate no real browser, agent, or staging run. AUTH-01's [merged public source](https://github.com/pegma-dev/agent-access/pull/1) -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 +provided KB-04's historical credential producer prerequisite. The separate +`agent:proof` now installs exact registry `@pegma/agent-access@0.1.1` in a fresh +temporary consumer with four packed KB artifacts, lifecycle scripts disabled, +and official SDK `1.32.2`. It tests the synthetic OAuth and 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. +is also merged, and its manual `0.1.0` bootstrap is complete without OIDC +provenance. Its trusted `0.1.1` release and strict registry verification have +since closed the public producer prerequisite. Actual existing-login/client +acceptance on both hosts and full KB-05 publication remain open. See the +[release ledger](BOOTSTRAP.md#verified-agent-access-prerequisite) for the exact +Agent Access receipt. The changed registry proof still needs current-head +execution; historical source-producer evidence does not validate it. 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 b9aa420..26c5f32 100644 --- a/docs/RELEASING.md +++ b/docs/RELEASING.md @@ -9,8 +9,13 @@ The release set is exactly these packages, in dependency order: 3. `@pegma/knowledge-base-application` 4. `@pegma/knowledge-base-mcp` -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) +As of **2026-11-07T21:56:24Z**, all four `0.1.0` packages completed manual +bootstrap with exact-byte postflight and no OIDC provenance. Source `0.1.1` is +the candidate for the first advertised trusted release; it remains subject to +review, current-head gates, publication, and strict registry/provenance +verification. Package README source links target the expected `v0.1.1` release +tag; that candidate tag and trusted release remain pending. +[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 @@ -20,17 +25,28 @@ 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. - -[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 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. +packages. The [maintainer bootstrap ledger](BOOTSTRAP.md) retains the actual +manual commands/stdout, exact identities, preparation runs/artifacts, and +independently retained digests. The four KB packages' `latest` tags still +resolve to `0.1.0` despite bootstrap tagging. A verified KB `0.1.1` release is +intended to advance them. An earlier attempt to delete Agent Access's `latest` +tag returned HTTP 400 before its `0.1.1` release. Agent Access +now has `latest: 0.1.1` and `bootstrap: 0.1.0`. This is not approval to consume +the KB bootstrap. + +[Agent Access](https://github.com/pegma-dev/agent-access) is a separate release. +Its `0.1.1` trusted publication and strict registry verification completed at +**2026-11-07T22:32:42Z** for signed source +`ffe4d8616632ce9d057caaf65124746f03d4d349`. The +[verified prerequisite receipt](BOOTSTRAP.md#verified-agent-access-prerequisite) +retains its exact artifact/digest, successful attempt-2 workflow, and unprivileged +verification job. That public producer prerequisite is closed. +The active `agent:proof` installs exact registry `@pegma/agent-access@0.1.1` +with four packed KB artifacts and official MCP SDK `1.32.2` in a fresh consumer. +The KB candidate still needs its own current-head gates, review, PR, publication, +and strict verification; historical source-proof results do not validate this +changed composition. Production hosts require verified trusted versions of +both components and their separately retained acceptance. ## Repository and development artifact gates @@ -80,8 +96,12 @@ repository, with complete ancestry and the commit contained in `origin/main`. Signature verification must use independently approved signer configuration. Neither a lightweight tag nor a tag at an unmerged commit qualifies. -After the complete gate, prepare from that exact clean checkout. The example -uses the current source version; substitute the full approved commit SHA: +After the complete gate, prepare from that exact clean checkout. In all current +runbook commands, replace `vX.Y.Z` with the approved synchronized release tag, +`FULL_COMMIT_SHA` with its full approved source commit, `PREPARED_DIRECTORY` with +the verified artifact directory, and `INDEPENDENT_SHA256` with the independently +retained manifest digest. The literal `v0.1.0` commands in the bootstrap ledger +are historical receipts, not current release instructions. Strict `prepare` requires both `RELEASE_NPM_CLI` and `RELEASE_NPM_VERSION=11.18.0`. The CLI path must be canonical, absolute, and name @@ -92,7 +112,7 @@ both variables before standalone preparation. The workflow configures them automatically. Development `check` and `pack` continue to use ambient npm. ```sh -node scripts/release-packages.mjs prepare --tag v0.1.0 --expected-commit FULL_COMMIT_SHA +node scripts/release-packages.mjs prepare --tag vX.Y.Z --expected-commit FULL_COMMIT_SHA ``` An optional `--out EMPTY_DIRECTORY` selects a new empty output directory. @@ -133,7 +153,9 @@ registry packages in its temporary consumer. It verifies bytes, signatures, and provenance using the same immutable artifact ID and independent digest. Manual dispatch skips both publishing and registry verification. -These external settings must be configured and recorded by the maintainer: +All five KB/Agent Access trusted-publisher entries have been configured through +the CLI. Configuration alone does not prove a trusted publish. The maintainer +must verify and record the full external checklist for each release: - ownership and organization publishing permission for all four npm names; - protected `origin/main`, immutable release tags, and approved SSH signers in @@ -142,8 +164,8 @@ These external settings must be configured and recorded by the maintainer: restrictions; - a separate npm trusted publisher for each package, bound to `pegma-dev/knowledge-base`, `publish.yml`, and `npm-publish`; -- explicit permission for direct `npm publish`, plus restrictions disallowing - token-based publishing. There is no repository npm token or token fallback. +- explicit permission for direct `npm publish`, with 2FA required and token-based + publishing disallowed. There is no repository npm token or token fallback. As checked on 2026-11-07, npm requires Node 22.14.0+ and npm 11.5.1+ for trusted publishing. New publisher configurations allow staged publishing by default; @@ -158,7 +180,7 @@ before changing these external settings. The read-only preflight is also the first-publication inspection command: ```sh -node scripts/release-packages.mjs preflight --prepared-dir PREPARED_DIRECTORY --manifest-sha256 INDEPENDENT_SHA256 --tag v0.1.0 --expected-commit FULL_COMMIT_SHA +node scripts/release-packages.mjs preflight --prepared-dir PREPARED_DIRECTORY --manifest-sha256 INDEPENDENT_SHA256 --tag vX.Y.Z --expected-commit FULL_COMMIT_SHA ``` It validates the schema-2 artifact set, then checks every exact package version @@ -240,20 +262,21 @@ A second isolated run installed all seven exact external runtime pins used by the two components, resolving 102 packages. Root lock versions and public registry URLs matched; the real audit reported `invalid=0`, `missing=0`, and `verified=21`. Lifecycle scripts and runtime imports remained disabled. -This checks the existing external dependency graph without publishing either -new component. +This historical check examined the existing external dependency graph without +publishing either new component. The observed public source was [pegma-dev/spine](https://github.com/pegma-dev/spine) at `refs/tags/v0.1.2`. This records the pinned CLI's working flag, output, and -certificate shape. It proves no provenance for unpublished KB or Agent Access +certificate shape. It proves no provenance for KB or Agent Access packages and performs no publisher operation. Their own exact repository, workflow, tag, and source-commit post-release verification remains mandatory. Raw bundles and certificate bytes are intentionally omitted. ## Consumers and retained host gates -KB publication precedes SD-02. Before real host assembly, verify both the exact -KB release set and the separately published Agent Access dependency. Git +The verified trusted KB release precedes SD-02. Before real host assembly, +verify both the exact trusted KB release set and the separately released Agent +Access dependency. The manual `0.1.0` bootstraps do not satisfy that gate. Git branches, copied source, local paths, and unpublished production tarballs do not substitute for registry releases. diff --git a/docs/RETRIEVAL.md b/docs/RETRIEVAL.md index 2004451..27dc05a 100644 --- a/docs/RETRIEVAL.md +++ b/docs/RETRIEVAL.md @@ -6,11 +6,12 @@ This design was recorded before durable retrieval operations and synchronized with the agreed public types and projection layout. Implementation tests and 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 +database, model integration, or authentication system. The KB `0.1.0` packages +completed manual bootstrap without OIDC provenance; source `0.1.1` remains an +unpublished candidate. Source tests and repository gates, not 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 +is [merged](https://github.com/pegma-dev/knowledge-base/pull/5). Verified trusted +KB publication, real-host acceptance, and production activation remain separate tasks. Read [declared collections](COLLECTIONS.md) for the authoritative record diff --git a/docs/SOURCE_PREPARATION.md b/docs/SOURCE_PREPARATION.md index 84a7645..bea6fa6 100644 --- a/docs/SOURCE_PREPARATION.md +++ b/docs/SOURCE_PREPARATION.md @@ -43,24 +43,29 @@ 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` in the public registry snapshot below. - -| Evidence area | This source slice | Separate remaining proof | -| ---------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------- | -| Storage consumer | Shared public KB suites on memory, local Azurite, and local Miniflare D1 | Production Azure/Workers configuration, operations, and host acceptance | -| Composition | Runnable fictional author/evidence/review/publication/retrieval flow | Real host identity, staging verification, existing-login/client acceptance, and UI | -| 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 | +current-head gates. The historical `0.1.0` absence snapshot below predates the +completed manual bootstrap. All four exact `0.1.0` artifacts passed manual +postflight at **2026-11-07T21:56:24Z**, without OIDC provenance; see the +[operator-recorded bootstrap receipt](BOOTSTRAP.md#recorded-manual-bootstrap-receipt). +Source `0.1.1` is a candidate for the first advertised trusted release, with +its own review, current-head gates, publication, and strict registry/provenance +verification pending. + +| Evidence area | This source slice | Separate remaining proof | +| ---------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| Storage consumer | Shared public KB suites on memory, local Azurite, and local Miniflare D1 | Production Azure/Workers configuration, operations, and host acceptance | +| Composition | Runnable fictional author/evidence/review/publication/retrieval flow | Real host identity, staging verification, existing-login/client acceptance, and UI | +| Artifacts | Four-package checks, schema-2 preparation, and manual `0.1.0` exact-byte postflight | First advertised trusted release with its own registry/provenance verification and released consumers | +| Task readiness | Current-head repository gates establish source readiness | Verified trusted releases and two-host/client acceptance remain separately recorded | 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 +## Historical public registry snapshot At **2026-11-07T18:48:30Z**, unauthenticated exact-version GET requests to the -public npm registry returned these results: +public npm registry returned these results before the later manual bootstrap: | Package | Exact version | HTTP status | | ----------------------------------- | ------------- | ----------- | @@ -100,8 +105,13 @@ for (const name of names) { 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. +The five `0.1.0` versions were subsequently uploaded and passed exact-byte +postflight at **2026-11-07T21:56:24Z**. The normalized commands, verbatim manual +stdout, preparation artifact identities, and independent digests are retained +in the [bootstrap receipt](BOOTSTRAP.md#recorded-manual-bootstrap-receipt). +This earlier 404 snapshot is not their current registry state. Repeat read-only +inspection when needed; strict full-set release preflight remains authoritative +for publication, and trusted-release verification still precedes host assembly. ## Pinned local D1 consumer @@ -227,12 +237,29 @@ remain the evidence of execution. ## Separate authenticated transport proof The KB-05 composition above uses synthetic resolved contexts. -KB-04's `pnpm run agent:proof` separately composes the real +The historical KB-04 `pnpm run agent:proof` composed the real [AUTH-01 source](https://github.com/pegma-dev/agent-access/pull/1), pinned to reviewed public commit `a444e2113db98455b638b2ef8aa7c2faccb16b62`, with all four KB tarballs and official MCP SDK `1.32.2` in an isolated temporary consumer. -The pinned source build is test-only. It does not become an unpublished -production dependency or authorize host installation. +That source build was test-only. It did not authorize a production dependency +or host installation; the historical source-gate results above retain that +immutable producer evidence. + +The active proof now installs exact public-registry +`@pegma/agent-access@0.1.1`, whose trusted release and strict verification +completed at **2026-11-07T22:32:42Z**. The +[verified prerequisite receipt](BOOTSTRAP.md#verified-agent-access-prerequisite) +retains its signed source and exact artifact/provenance record. +The proof composes that one registry producer with four packed KB candidate +artifacts and official MCP SDK `1.32.2` in a fresh temporary consumer, with +lifecycle scripts disabled. It accepts no producer checkout or source fallback. +A local candidate run on **2026-11-07** passed with `packedPackages: 4`, +`registryPackages: 1`, and `exactRegistryProducer: true`; all SDK/OAuth/device +and five-operation positive/negative checks passed. It retained +`liveHostsProven: false` and `targetClientAppsProven: 0`. A separate negative +probe rejected a source override at stage 1 before external commands. +Current-head Node 22/24 CI and the candidate's remaining review/release gates +are still required. That gate exercises OAuth and the exact five-tool draft/read/write/requirements/ evidence flow, shared HTTP/MCP behavior, and rejection cases. The evidence @@ -261,14 +288,16 @@ only for identical existing artifacts, and released-consumer checks use the 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, 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. +Manual maintainer 2FA bootstrap is complete, and all five KB/Agent Access +trusted-publisher entries have been configured through the CLI. Recheck the +full ownership, protected tag/main, approved signer, approval environment, +per-package publisher binding, direct-publishing, and 2FA/token-policy checklist +in [release operations](RELEASING.md) for the actual trusted release. +Full KB-05 still requires the `0.1.1` candidate's review and current-head gates, +then its own trusted publication, complete-set registry +integrity/signature/provenance verification, and released-consumer proof. +Manual bootstrap is not OIDC provenance. +Agent Access has its own publication history: [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). @@ -281,10 +310,13 @@ 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. +Agent Access `0.1.0` subsequently completed manual bootstrap and exact-byte +postflight without OIDC provenance. Its verified trusted `0.1.1` release then +closed the public producer prerequisite; see the +[exact receipt](BOOTSTRAP.md#verified-agent-access-prerequisite). The original +source-producer proof remains historical evidence, while the changed registry +composition requires its own current-head gates. +SD-02 waits for the verified trusted KB release, and both hosts wait for exact +verified trusted 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/examples/agent/README.md b/examples/agent/README.md index fca3484..9466f9d 100644 --- a/examples/agent/README.md +++ b/examples/agent/README.md @@ -1,16 +1,23 @@ # Packed local agent protocol proof Run `pnpm run agent:proof` from the repository after -`pnpm install --frozen-lockfile`, on Node 22.6+ or Node 24. Git and npm must be -available. The proof needs public GitHub and npm registry access and binds an +`pnpm install --frozen-lockfile`, on Node 22.6+ or Node 24. npm must be +available. The proof needs public npm registry access and binds an ephemeral listener to `127.0.0.1` only. Both component configurations explicitly enable `allowInsecureLoopback` for this test. -This is an independently reproducible, **test-only source composition**. It +The orchestrator isolates npm configuration: incoming `npm_config_*` variables +and user npmrc overrides are not applied, and the official npm registry is +mandatory. Transport settings such as `HTTPS_PROXY` and `NODE_EXTRA_CA_CERTS` +remain available; provide them when your network requires a proxy or custom CA. +Package mirrors and source fallbacks are not supported. + +This is an independently reproducible, **test-only artifact composition**. It exercises the actual MCP TypeScript SDK `1.32.2`, Sessions `0.2.0`, Authorization -Core `0.4.0`, Storage Core `0.4.0`, Agent Access and all four KB tarballs. It does +Core `0.4.0`, Storage Core `0.4.0`, exact registry `@pegma/agent-access@0.1.1`, +and all four packed KB candidate artifacts. It does not establish any of the four target client applications, a deployed host, -real browser login, real staging execution, first publication, or host activation. +real browser login, real staging execution, verified KB publication, or host activation. Those acceptance tasks remain open. ## Artifact boundary @@ -19,32 +26,46 @@ The [orchestrator](../../scripts/agent-protocol-proof.mjs): 1. Bootstraps exactly `pnpm@10.34.5` inside its bounded temporary directory. 2. Runs KB `release:check`, then packs contracts, core, application and MCP. -3. Clones the public - [Agent Access repository](https://github.com/pegma-dev/agent-access), checks out - the reviewed, publicly merged commit - [`a444e2113db98455b638b2ef8aa7c2faccb16b62`](https://github.com/pegma-dev/agent-access/commit/a444e2113db98455b638b2ef8aa7c2faccb16b62), - verifies its exact HEAD and declared package manager, installs its frozen - lockfile, builds, and packs its package. -4. Installs those five tarballs and the exact released SDK/Pegma dependencies - into a fresh npm consumer, with installation scripts disabled. +3. Creates a fresh npm consumer declaring the literal registry dependency + `@pegma/agent-access@0.1.1` and the four packed KB artifacts. +4. Installs the four KB tarballs, the one registry Agent Access package, and + exact released SDK/Pegma dependencies with installation scripts disabled. + It checks the producer's installed name/version, official registry resolution, + and reviewed SHA-512 integrity pin. 5. Copies only the [protocol fixture](../../scripts/agent-protocol-fixture.mjs) into that consumer and executes it. Component code is loaded exclusively through installed public package entrypoints. 6. Closes native client and server resources and removes the verified owned - temporary directory, including producer, toolchain, consumer and tarballs. + temporary directory, including toolchain, consumer and tarballs. + +Agent Access `0.1.1` has completed verified trusted publication; the +[exact receipt](../../docs/BOOTSTRAP.md#verified-agent-access-prerequisite) +retains its signed source, artifact binding, and strict registry/provenance +verification. It is a protocol-proof dependency, not a KB runtime or workspace +dependency. The proof performs no deployment, tagging, release creation or +publication and does not rerun the producer's own release gates. + +No producer checkout, source override, clone, or source-build fallback is +accepted. The earlier source-producer path remains historical evidence in +[source preparation](../../docs/SOURCE_PREPARATION.md#separate-authenticated-transport-proof). + +## Maintaining the producer pin + +Update the producer version and integrity together in a reviewed PR: -Agent Access is currently unpublished. Its immutable producer is a dev fixture, -not a root dependency, runtime dependency, workspace package, copied auth source, -lockfile substitution, or production release substitute. The proof performs no -deployment, tagging, release creation or publication. It does not claim that -the producer's own review/validation gates were rerun; its immutable public merge -is the producer provenance boundary. +1. Obtain both values from the independently digest-bound prepared manifest of + a fully verified trusted producer release. Use the producer's strict `verify` + command to confirm exact registry bytes and source-bound provenance. +2. Record the release identity, independent manifest digest, prepared tarball + hashes, and verification receipt, as in the + [current producer receipt](../../docs/BOOTSTRAP.md#verified-agent-access-prerequisite). +3. Change both proof pins in the reviewed PR and run `pnpm run agent:proof` on + Node 22 and 24 before accepting the update. -For a preexisting local checkout, the optional `AGENT_ACCESS_SOURCE` environment -variable avoids a network clone. Its HEAD must equal that same exact reviewed -commit. The script clones its committed Git objects into the temporary directory; -it never installs, builds, checks out, or edits the supplied checkout, and never -consumes its uncommitted files. Omitting this variable uses the public repository. +Do not automatically accept `npm view` output or newly served registry metadata +as a replacement trust anchor, or advance the producer version merely because +metadata was re-signed. Published versions are immutable; altered tarball bytes +must fail closed and require a reviewed release decision. ## Actual protocol and application path @@ -99,26 +120,27 @@ are never printed. ## Safe result and failure diagnostics Success prints one JSON receipt containing only booleans and numeric counts, -including `packedPackages: 5`, `tools: 5`, `draftRevision: 2`, +including `packedPackages: 4`, `registryPackages: 1`, +`exactRegistryProducer: true`, `tools: 5`, `draftRevision: 2`, `liveHostsProven: false` and `targetClientAppsProven: 0`. Native command output is captured and suppressed. Failure prints only `passed: false` and a numeric `stage`, plus a numeric `fixtureStage` when available: -| Stage | Work | -| ------------- | ------------------------------------------------ | -| 1 | Isolated pinned pnpm bootstrap | -| 2 | KB release check and tarballs | -| 3 | Immutable Agent Access preparation | -| 4 | Clean consumer installation | -| 5 | Protocol fixture | -| Fixture 10–18 | Host/application bootstrap | -| Fixture 20 | SDK discovery, browser approval and exchange | -| Fixture 30 | Tools, drafts, retries and DTO parity | -| Fixture 40 | Validation requirements and receipt verification | -| Fixture 50 | Wrong resource and wrong PKCE | -| Fixture 60 | Expiry, refresh and revocation | -| Fixture 70 | Device authorization | -| Fixture 80 | Current Admin demotion | +| Stage | Work | +| ------------- | --------------------------------------------------- | +| 1 | Isolated pinned pnpm bootstrap | +| 2 | KB release check and tarballs | +| 3 | Fresh consumer with exact registry producer | +| 4 | Installation and producer identity/integrity checks | +| 5 | Protocol fixture | +| Fixture 10–18 | Host/application bootstrap | +| Fixture 20 | SDK discovery, browser approval and exchange | +| Fixture 30 | Tools, drafts, retries and DTO parity | +| Fixture 40 | Validation requirements and receipt verification | +| Fixture 50 | Wrong resource and wrong PKCE | +| Fixture 60 | Expiry, refresh and revocation | +| Fixture 70 | Device authorization | +| Fixture 80 | Current Admin demotion | Bootstrap substages are application factory 11, collection 12, validation policy 13, governance 14, session 15, listener 16, issuer 17 and adapters 18. diff --git a/examples/composition/README.md b/examples/composition/README.md index f7356d1..0db941b 100644 --- a/examples/composition/README.md +++ b/examples/composition/README.md @@ -19,8 +19,10 @@ pnpm run example [`composition.ts`](composition.ts) exports `createExampleComposition(store?)` and `runCompleteExampleFlow(composition)`. The optional Store defaults to `createMemoryStore()`; the example imports no test helpers. [`run.ts`](run.ts) -prints a safe completion summary. These are workspace source examples; the KB -packages remain unpublished and cannot yet be installed as production releases. +prints a safe completion summary. These are workspace source examples. The KB +`0.1.0` packages completed manual bootstrap without OIDC provenance; the +`0.1.1` candidate remains unpublished and requires its own verified trusted +release before production installation. The flow creates a fictional workshop collection with portal use disabled and a separate bot audience. A synthetic author creates a walkthrough, submits its diff --git a/package.json b/package.json index 01c2864..3e482b6 100644 --- a/package.json +++ b/package.json @@ -34,10 +34,10 @@ "@cloudflare/workers-types": "5.20260730.1", "@modelcontextprotocol/sdk": "1.32.2", "@pegma/authorization-core": "0.4.0", - "@pegma/knowledge-base-application": "0.1.0", - "@pegma/knowledge-base-contracts": "0.1.0", - "@pegma/knowledge-base-core": "0.1.0", - "@pegma/knowledge-base-mcp": "0.1.0", + "@pegma/knowledge-base-application": "0.1.1", + "@pegma/knowledge-base-contracts": "0.1.1", + "@pegma/knowledge-base-core": "0.1.1", + "@pegma/knowledge-base-mcp": "0.1.1", "@pegma/spine": "0.1.2", "@pegma/storage-azure-tables": "0.4.0", "@pegma/storage-cloudflare-d1": "0.4.1", diff --git a/packages/application/README.md b/packages/application/README.md index 09b53cf..aecf18b 100644 --- a/packages/application/README.md +++ b/packages/application/README.md @@ -1,22 +1,26 @@ # @pegma/knowledge-base-application -This unpublished KB-02/KB-03 source package composes contracts/core with +This package composes contracts/core with host-supplied Storage Core, Authorization Core, Audit, and a clock. Source implementation and repository gates determine task completion; neither this package nor local tests establish a live host or production readiness. -The [declared layout](https://github.com/pegma-dev/knowledge-base/blob/main/docs/COLLECTIONS.md) records the agreement made -before durable operations. [Host composition](https://github.com/pegma-dev/knowledge-base/blob/main/docs/HOST_COMPOSITION.md) describes the host +The [declared layout](https://github.com/pegma-dev/knowledge-base/blob/v0.1.1/docs/COLLECTIONS.md) records the agreement made +before durable operations. [Host composition](https://github.com/pegma-dev/knowledge-base/blob/v0.1.1/docs/HOST_COMPOSITION.md) describes the host authentication, current-resource authorization, verified-evidence, and privacy -boundaries. [Retrieval](https://github.com/pegma-dev/knowledge-base/blob/main/docs/RETRIEVAL.md) +boundaries. [Retrieval](https://github.com/pegma-dev/knowledge-base/blob/v0.1.1/docs/RETRIEVAL.md) documents bounded lexical lookup, authoritative confirmation, citations, and repair. The optional `@pegma/knowledge-base-mcp` package adds HTTP/MCP adapters over this API; it supplies no login or token issuer. Real-host acceptance and production activation remain separately gated. -GitHub links in this unpublished README track development `main`; they are -not frozen version documentation. KB-05 release preparation must pin those -references to verified release source before first publication. +GitHub documentation links target this package's release tag rather than +development `main`. During release preparation that tag may still be pending; +it is created after the reviewed merge and before publishing. Source readers +can use the explicitly moving +[DEVELOPMENT documentation on main](https://github.com/pegma-dev/knowledge-base/blob/main/docs/HOST_COMPOSITION.md) +while preparing a release. The versioned contract references remain tag-pinned; +the DEVELOPMENT link is a source-reader fallback. The application API owns authorized commands, application-generation CAS, bounded immutable revision/evidence history, exact review/publication, @@ -39,7 +43,7 @@ or a support model. `limits`, `evidenceVerifier`, `privateSources`, and nested `retrieval` settings. Hosts authenticate callers and resolve current scoped `AccessContext` values. The -[public types](https://github.com/pegma-dev/knowledge-base/blob/main/packages/application/src/types.ts) define commands and purpose-specific results; +[public types](https://github.com/pegma-dev/knowledge-base/blob/v0.1.1/packages/application/src/types.ts) define commands and purpose-specific results; the package owns no HTTP routes or credentials. Creates use `expectedGeneration: 0`; later mutations use exact application @@ -112,7 +116,7 @@ provider data controls; current publication checks remain mandatory. ranked prefix of whole articles within aggregate byte/token budgets with a positive local count; reconfirmation is exact and all-or-nothing. `retrieval.limits` can only lower fixed component ceilings. -See [retrieval](https://github.com/pegma-dev/knowledge-base/blob/main/docs/RETRIEVAL.md) +See [retrieval](https://github.com/pegma-dev/knowledge-base/blob/v0.1.1/docs/RETRIEVAL.md) for the exact API, limits, authority/reference fences, and evaluation boundary. `repairArticleIndex`, `repairRetrievalPage`, and `getArticleIndexStatus` require @@ -129,13 +133,13 @@ causal jobs share one resource partition in `knowledge-base.records.v1`. Native flat chunk properties keep bounded rows compatible with the host's store adapter. The application separately bounds physical rows, encoded bytes, history, transaction work, retries, and control reserve. Read the -[layout limits](https://github.com/pegma-dev/knowledge-base/blob/main/docs/COLLECTIONS.md#physical-representation-and-hard-bounds) +[layout limits](https://github.com/pegma-dev/knowledge-base/blob/v0.1.1/docs/COLLECTIONS.md#physical-representation-and-hard-bounds) before changing admission or retention; these are component safety bounds, not measured host throughput. No private persistence or parallel audit log is implemented here. -Merging source does not publish a package. Hosts must wait for the exact public -release and normal release/host activation gates. See -[release operations](https://github.com/pegma-dev/knowledge-base/blob/main/docs/RELEASING.md). +Merging source does not publish a package. Hosts verify exact registry artifacts +and provenance and complete their release/host activation gates. See +[release operations](https://github.com/pegma-dev/knowledge-base/blob/v0.1.1/docs/RELEASING.md). Built in the open by RetireGolden, LLC. diff --git a/packages/application/package.json b/packages/application/package.json index 9e6b24a..ff6b5b2 100644 --- a/packages/application/package.json +++ b/packages/application/package.json @@ -1,6 +1,6 @@ { "name": "@pegma/knowledge-base-application", - "version": "0.1.0", + "version": "0.1.1", "description": "Authorized knowledge authoring, evidence, review, and publication over Pegma storage.", "license": "MIT", "type": "module", @@ -31,8 +31,8 @@ "dependencies": { "@pegma/audit": "0.2.0", "@pegma/authorization-core": "0.4.0", - "@pegma/knowledge-base-contracts": "0.1.0", - "@pegma/knowledge-base-core": "0.1.0", + "@pegma/knowledge-base-contracts": "0.1.1", + "@pegma/knowledge-base-core": "0.1.1", "@pegma/spine": "0.1.2", "@pegma/storage-core": "0.4.0" }, diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 8549f29..a0e02e2 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -1,6 +1,6 @@ { "name": "@pegma/knowledge-base-contracts", - "version": "0.1.0", + "version": "0.1.1", "description": "Provider-neutral knowledge collections, revisions, validation, and approval contracts.", "license": "MIT", "type": "module", diff --git a/packages/core/README.md b/packages/core/README.md index 6ea4b64..28c350e 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -1,7 +1,7 @@ # @pegma/knowledge-base-core Pure collection, draft, verification, review, publication, and retirement -transitions. This initial 0.1.0 source is unpublished. It requires no Support +transitions. It requires no Support Desk, GitHub, model, framework, database, or provider SDK. Core owns domain invariants. The application service checks current named diff --git a/packages/core/package.json b/packages/core/package.json index cacf64c..bba2079 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@pegma/knowledge-base-core", - "version": "0.1.0", + "version": "0.1.1", "description": "Pure knowledge article, validation, and publication transitions.", "license": "MIT", "type": "module", @@ -29,7 +29,7 @@ "directory": "packages/core" }, "dependencies": { - "@pegma/knowledge-base-contracts": "0.1.0" + "@pegma/knowledge-base-contracts": "0.1.1" }, "scripts": { "build": "tsc -p tsconfig.json", diff --git a/packages/mcp/README.md b/packages/mcp/README.md index c8c5738..d22881f 100644 --- a/packages/mcp/README.md +++ b/packages/mcp/README.md @@ -2,13 +2,14 @@ Optional KB-04 agent transport source for Pegma Knowledge Base. This package adapts the authorized application API to bounded agent commands and the Model -Context Protocol. It is unpublished at `0.1.0`; merging its source does not -publish it or establish a live hosted Knowledge Base. +Context Protocol. Hosts compose it with their protected Knowledge Base +endpoints; the package does not supply a hosted service. The contracts, core, and application packages remain independent of MCP, HTTP, provider SDKs, and login flows. Hosts choose this adapter when exposing agent access. The adapter pins `@modelcontextprotocol/sdk` at `1.32.2` and `zod` at -`4.6.7`; it composes the same exact `0.1.0` Knowledge Base packages. +`4.6.7`; it composes the matching exact Knowledge Base package versions declared +in its dependencies. The MCP adapter explicitly uses the SDK's Workers-compatible JSON Schema validator, which requires no generated code. Its `@cfworker/json-schema` @@ -43,9 +44,9 @@ or private evidence and provenance. through host-configured protected endpoints. Both require fresh host authentication and admission control on every request; neither issues tokens. -The [host composition contract](https://github.com/pegma-dev/knowledge-base/blob/main/docs/HOST_COMPOSITION.md) +The [host composition contract](https://github.com/pegma-dev/knowledge-base/blob/v0.1.1/docs/HOST_COMPOSITION.md) describes authenticated contexts, trusted evidence, replay, and safe DTOs. The -[retrieval contract](https://github.com/pegma-dev/knowledge-base/blob/main/docs/RETRIEVAL.md) +[retrieval contract](https://github.com/pegma-dev/knowledge-base/blob/v0.1.1/docs/RETRIEVAL.md) describes authoritative current-publication confirmation and audience boundaries. ## Local verification and release @@ -62,21 +63,27 @@ pnpm run release:check pnpm run agent:proof ``` -`release:check` packs and installs all four unpublished Knowledge Base packages +`release:check` packs and installs all four prepared Knowledge Base packages in an isolated temporary consumer, verifies their actual artifact bytes and inventory, and imports their public entry points without workspace links. -`agent:proof` exercises the authenticated SDK path with a pinned public Agent -Access producer packed only into a temporary test consumer. That producer -source is a test fixture, not a production release substitute or package -dependency. These local checks establish neither live host acceptance nor npm +`agent:proof` exercises the authenticated SDK path with an exact released Agent +Access registry producer and the four packed KB artifacts in a fresh temporary +consumer, with lifecycle scripts disabled. Agent Access remains a proof +dependency rather than this package's runtime dependency. These local checks +establish neither live host acceptance nor KB trusted npm publication. Each package has its own README, MIT LICENSE, build-on-prepack hook, and -compiled-test exclusion. All four package versions remain synchronized at -`0.1.0`. First publication, release tags, trusted-publisher configuration, and +compiled-test exclusion. All four package versions remain synchronized with +exact internal dependency pins. Publishing, release tags, trusted-publisher configuration, and host activation are separate maintainer operations in the -[release procedure](https://github.com/pegma-dev/knowledge-base/blob/main/docs/RELEASING.md). -Development links above track `main`; release preparation must pin verified -release documentation before first publication. +[release procedure](https://github.com/pegma-dev/knowledge-base/blob/v0.1.1/docs/RELEASING.md). +Documentation links target this package's release tag rather than development +`main`. During release preparation that tag may still be pending; it is created +after the reviewed merge and before publishing. Source readers can use the +explicitly moving +[DEVELOPMENT documentation on main](https://github.com/pegma-dev/knowledge-base/blob/main/docs/HOST_COMPOSITION.md) +while preparing a release. The versioned contract references remain tag-pinned; +the DEVELOPMENT link is a source-reader fallback. Built in the open by RetireGolden, LLC. diff --git a/packages/mcp/package.json b/packages/mcp/package.json index f1cded5..0037050 100644 --- a/packages/mcp/package.json +++ b/packages/mcp/package.json @@ -1,6 +1,6 @@ { "name": "@pegma/knowledge-base-mcp", - "version": "0.1.0", + "version": "0.1.1", "description": "Optional MCP transport for authorized Pegma knowledge authoring and validation.", "license": "MIT", "type": "module", @@ -32,9 +32,9 @@ "@cfworker/json-schema": "4.1.6", "@modelcontextprotocol/sdk": "1.32.2", "@pegma/authorization-core": "0.4.0", - "@pegma/knowledge-base-application": "0.1.0", - "@pegma/knowledge-base-contracts": "0.1.0", - "@pegma/knowledge-base-core": "0.1.0", + "@pegma/knowledge-base-application": "0.1.1", + "@pegma/knowledge-base-contracts": "0.1.1", + "@pegma/knowledge-base-core": "0.1.1", "zod": "4.6.7" }, "scripts": { diff --git a/packages/mcp/src/mcp.ts b/packages/mcp/src/mcp.ts index 24228f9..7d8a4a7 100644 --- a/packages/mcp/src/mcp.ts +++ b/packages/mcp/src/mcp.ts @@ -332,7 +332,7 @@ export function createKnowledgeAgentMcp( maxRequestBodySize: dispatcher.limits.maxRequestBytes, }); const server = new Server( - { name: "@pegma/knowledge-base-mcp", version: "0.1.0" }, + { name: "@pegma/knowledge-base-mcp", version: "0.1.1" }, { capabilities: { tools: {} }, // Workers prohibit the runtime code generation used by SDK-default AJV. diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4435bac..287f19b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,16 +24,16 @@ importers: specifier: 0.4.0 version: 0.4.0 '@pegma/knowledge-base-application': - specifier: 0.1.0 + specifier: 0.1.1 version: link:packages/application '@pegma/knowledge-base-contracts': - specifier: 0.1.0 + specifier: 0.1.1 version: link:packages/contracts '@pegma/knowledge-base-core': - specifier: 0.1.0 + specifier: 0.1.1 version: link:packages/core '@pegma/knowledge-base-mcp': - specifier: 0.1.0 + specifier: 0.1.1 version: link:packages/mcp '@pegma/spine': specifier: 0.1.2 @@ -78,10 +78,10 @@ importers: specifier: 0.4.0 version: 0.4.0 '@pegma/knowledge-base-contracts': - specifier: 0.1.0 + specifier: 0.1.1 version: link:../contracts '@pegma/knowledge-base-core': - specifier: 0.1.0 + specifier: 0.1.1 version: link:../core '@pegma/spine': specifier: 0.1.2 @@ -99,7 +99,7 @@ importers: packages/core: dependencies: '@pegma/knowledge-base-contracts': - specifier: 0.1.0 + specifier: 0.1.1 version: link:../contracts packages/mcp: @@ -114,13 +114,13 @@ importers: specifier: 0.4.0 version: 0.4.0 '@pegma/knowledge-base-application': - specifier: 0.1.0 + specifier: 0.1.1 version: link:../application '@pegma/knowledge-base-contracts': - specifier: 0.1.0 + specifier: 0.1.1 version: link:../contracts '@pegma/knowledge-base-core': - specifier: 0.1.0 + specifier: 0.1.1 version: link:../core zod: specifier: 4.6.7 diff --git a/scripts/agent-protocol-proof.mjs b/scripts/agent-protocol-proof.mjs index f7efabf..73977b3 100644 --- a/scripts/agent-protocol-proof.mjs +++ b/scripts/agent-protocol-proof.mjs @@ -1,4 +1,4 @@ -/** TEST ONLY: immutable public producer -> packed consumer -> loopback SDK proof. */ +/** TEST ONLY: exact registry producer + four packed KB artifacts -> loopback SDK proof. */ import assert from "node:assert/strict"; import { spawnSync } from "node:child_process"; import { @@ -16,8 +16,10 @@ import { basename, delimiter, dirname, join } from "node:path"; import { fileURLToPath, pathToFileURL } from "node:url"; const root = fileURLToPath(new URL("../", import.meta.url)); -const reviewedAgentAccess = "a444e2113db98455b638b2ef8aa7c2faccb16b62"; -const publicProducer = "https://github.com/pegma-dev/agent-access.git"; +const registry = "https://registry.npmjs.org/"; +const agentAccessVersion = "0.1.1"; +const agentAccessIntegrity = + "sha512-C8t2kkv2piE9Jxt48hrRj+dYDoBd4BMgyO9JpgBQT5ycr8xZx4hq43DSG9I/KjjPQhEvRhp7obYnZ/IiBme/Jw=="; const packageManagerVersion = "10.34.5"; const packages = ["contracts", "core", "application", "mcp"]; let stage = 0; @@ -120,15 +122,27 @@ async function proof() { ); try { stage = 1; + assert.equal( + process.env.AGENT_ACCESS_SOURCE, + undefined, + "Source producer overrides are not supported.", + ); const npm = await npmCliPath(); const npmrc = join(temporary, "npmrc"); - await writeFile(npmrc, "registry=https://registry.npmjs.org/\n"); + await writeFile( + npmrc, + `registry=${registry}\n@pegma:registry=${registry}\n`, + ); let env = { - ...process.env, + ...Object.fromEntries( + Object.entries(process.env).filter( + ([key]) => !key.toLowerCase().startsWith("npm_config_"), + ), + ), npm_config_userconfig: npmrc, - npm_config_registry: "https://registry.npmjs.org/", + npm_config_registry: registry, }; - // Pin the producer's toolchain even when invoked directly with `node`. + // Pin the KB packing toolchain even when invoked directly with `node`. const toolchain = join(temporary, "toolchain"); await mkdir(toolchain); await writeFile(join(toolchain, "package.json"), '{"private":true}\n'); @@ -179,55 +193,6 @@ async function proof() { } stage = 3; - const suppliedSource = process.env.AGENT_ACCESS_SOURCE; - if (suppliedSource) { - // Read only. Clone committed Git objects; never copy a dirty source tree - // or install/build in the user's checkout. - assert.equal( - run("git", ["rev-parse", "HEAD"], suppliedSource, env), - reviewedAgentAccess, - ); - } - const producer = join(temporary, "agent-access-producer"); - run( - "git", - [ - "clone", - "--no-local", - "--no-checkout", - suppliedSource ?? publicProducer, - producer, - ], - temporary, - env, - ); - run("git", ["checkout", "--detach", reviewedAgentAccess], producer, env); - assert.equal( - run("git", ["rev-parse", "HEAD"], producer, env), - reviewedAgentAccess, - ); - const manifest = JSON.parse( - await readFile(join(producer, "package.json"), "utf8"), - ); - assert.equal(manifest.packageManager, `pnpm@${packageManagerVersion}`); - run( - process.execPath, - [pnpm, "install", "--frozen-lockfile"], - producer, - env, - ); - run(process.execPath, [pnpm, "run", "build"], producer, env); - dependencies.push( - await pack( - join(producer, "packages", "agent-access"), - artifacts, - "@pegma/agent-access", - npm, - env, - ), - ); - - stage = 4; const consumer = join(temporary, "consumer"); await mkdir(consumer); await writeFile( @@ -238,6 +203,7 @@ async function proof() { type: "module", dependencies: { ...Object.fromEntries(dependencies), + "@pegma/agent-access": agentAccessVersion, "@modelcontextprotocol/sdk": "1.32.2", "@pegma/sessions": "0.2.0", "@pegma/authorization-core": "0.4.0", @@ -246,19 +212,46 @@ async function proof() { }, }), ); + stage = 4; run( process.execPath, [ npm, "install", + `--registry=${registry}`, "--ignore-scripts", - "--package-lock=false", + "--package-lock=true", "--no-audit", "--no-fund", ], consumer, env, ); + const installedProducer = JSON.parse( + await readFile( + join( + consumer, + "node_modules", + "@pegma", + "agent-access", + "package.json", + ), + "utf8", + ), + ); + assert.equal(installedProducer.name, "@pegma/agent-access"); + assert.equal(installedProducer.version, agentAccessVersion); + const lockfile = JSON.parse( + await readFile(join(consumer, "package-lock.json"), "utf8"), + ); + const lockedProducer = + lockfile.packages["node_modules/@pegma/agent-access"]; + assert.equal(lockedProducer.version, agentAccessVersion); + assert.equal( + lockedProducer.resolved, + `${registry}@pegma/agent-access/-/agent-access-${agentAccessVersion}.tgz`, + ); + assert.equal(lockedProducer.integrity, agentAccessIntegrity); await copyFile( join(root, "scripts", "agent-protocol-fixture.mjs"), join(consumer, "proof.mjs"), @@ -269,9 +262,10 @@ async function proof() { ); assert.equal(receipt.passed, true); return { - packedPackages: dependencies.length, - immutableProducer: true, ...receipt, + packedPackages: dependencies.length, + registryPackages: 1, + exactRegistryProducer: true, }; } finally { const cleanup = await realpath(temporary); diff --git a/test/README.md b/test/README.md index 597dfec..6b04e55 100644 --- a/test/README.md +++ b/test/README.md @@ -74,10 +74,12 @@ not assert a passing run. The domain/storage suites exercise KB-02/KB-03 source and partial KB-05 consumer preparation. Agent transport suites add KB-04 HTTP/MCP parity and boundary -coverage; `pnpm run agent:proof` separately exercises the actual SDK and reviewed -Agent Access artifacts in an isolated synthetic consumer. These results do not +coverage; `pnpm run agent:proof` separately exercises the actual SDK with exact +registry `@pegma/agent-access@0.1.1` and four packed KB candidate artifacts in a +fresh isolated synthetic consumer. These results do not establish actual site logins or target-client application acceptance. Local storage tests establish no browser UI, live Workers/host acceptance, model-provider settings, production throughput, or -retention operations. All four KB packages remain unpublished; the full -KB-05 release/publication and host activation gates remain required. +retention operations. All four KB `0.1.0` packages completed manual bootstrap +without OIDC provenance. KB `0.1.1` remains an unpublished candidate; its full +verified trusted release and the host activation gates remain required.