Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ tests. The approved scope is the [Support Desk enhancement plan](https://github.
subsequently completed verified trusted publication; retain the
[historical release receipt](docs/BOOTSTRAP.md#historical-verified-011-release).
All four `0.1.2` packages have since completed verified trusted publication
for SD-03 atomic draft/source authoring. Source `0.1.3` is the synchronized,
unpublished optional human-reviewed evidence-report candidate and still
requires its own review, current-head gates, trusted publication, and strict verification.
for SD-03 atomic draft/source authoring. All four `0.1.3` packages completed
verified trusted publication for optional human-reviewed evidence reports;
retain the [public release](https://github.com/pegma-dev/knowledge-base/releases/tag/v0.1.3).
Synchronized `0.1.4` is the unpublished governed authoring-context/report-query
candidate and requires its own review, current-head gates, trusted publication
and strict verification.
Real-host acceptance remains separate.
- Never implement a database, authorization role model, identity/session/token
system, audit log, request limiter, or durable scheduler here. Compose the
Expand Down Expand Up @@ -58,6 +61,13 @@ tests. The approved scope is the [Support Desk enhancement plan](https://github.
not provide a global policy fence; current reads must reject stale authority.
- Replay rechecks current operation/resource permission and returns a bounded
historical acknowledgement, not raw content or restored publication authority.
- Governed authoring reads require `draftRead` and either `draftWrite` or
`evidenceSubmit`; explicit private evidence additionally requires `evidenceRead`.
Keep opaque authoring observations within one operation and application
instance. They are single-use head observations, never serialized credentials,
evidence, review or publication authority. Preserve complete admitted proof
history and the legacy report context path. Provider batching and fewer public
calls do not establish universal Workers Free query/CPU acceptance.
- Retrieval projections are derived hints. Count physical work before filtering;
request paths use keyed reads, never a corpus scan. Confirm current publication,
applicability, and effective portal/bot audience before exposing any title,
Expand Down Expand Up @@ -112,7 +122,9 @@ 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
[publication ledger](docs/BOOTSTRAP.md) for the completed manual bootstrap
and verified KB `0.1.2` and Agent Access `0.1.1` receipts. All five KB/Agent Access trusted publishers
and historical KB `0.1.2` and Agent Access `0.1.1` receipts. The
[KB `0.1.3` release](https://github.com/pegma-dev/knowledge-base/releases/tag/v0.1.3)
is also verified. 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
Expand All @@ -128,7 +140,7 @@ 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.3` candidate's own review, trusted publication, and strict registry
`0.1.4` candidate's own review, trusted publication, and strict registry
verification remain open. Host acceptance remains open before activation.
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.
Expand Down
28 changes: 20 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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 as of 2026-11-08: KB-01 through KB-03 provide contracts, pure domain
> Development status as of 2026-11-09: 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.
Expand All @@ -17,10 +17,12 @@ and exact publication approval. It requires no GitHub connection or AI provider.
> OIDC provenance. All four `0.1.1` packages subsequently completed
> [verified trusted publication](docs/BOOTSTRAP.md#historical-verified-011-release).
> All four `0.1.2` packages have since completed
> [verified trusted publication](docs/BOOTSTRAP.md#verified-knowledge-base-release)
> for SD-03 atomic draft/source authoring. Synchronized `0.1.3` is the
> **unpublished source candidate** for optional human-reviewed
> [evidence reports](docs/EVIDENCE_REPORTS.md); its review, current-head CI,
> [verified trusted publication](docs/BOOTSTRAP.md#historical-verified-012-release)
> for SD-03 atomic draft/source authoring. All four `0.1.3` packages completed
> [verified trusted publication](https://github.com/pegma-dev/knowledge-base/releases/tag/v0.1.3)
> for optional human-reviewed [evidence reports](docs/EVIDENCE_REPORTS.md).
> Synchronized `0.1.4` is the **unpublished source candidate** for governed
> authoring-context reads and report queries; its review, current-head CI,
> trusted publication and strict consumer verification remain pending.
> Actual two-host existing-login/client acceptance remains open.
> Host activation remains separately gated; this repository supplies no hosted KB.
Expand All @@ -45,6 +47,16 @@ and review reads have separate DTOs. The keyed published read returns
portal-safe content only. The three base packages remain independent of HTTP,
MCP, and provider SDKs.

The `0.1.4` candidate adds `getAuthoringContext` to read current draft and narrow
requirements together. It requires draft-read plus draft-write or evidence-submit;
requesting complete private evidence also requires evidence-read. Its opaque,
single-use `confirmAuthoringContext` observation is local to the same operation
and application instance, never a credential or publication authority. An
optional report-factory context pair and body-free `query` reduce repeated reads
while preserving legacy ports, full proof history and exact authority fences.
These source changes do not prove a universal 50-query or CPU budget for Workers
Free; real host profiles still require measured acceptance.

The optional adapter exposes exactly `getDraft`, `createDraft`, `updateDraft`,
`getValidationRequirements`, and `submitEvidence` over the same application.
Its scopes reuse `knowledgePermissions.draftRead`, `draftWrite`, and
Expand Down Expand Up @@ -147,10 +159,10 @@ 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 and the four-package KB trusted `0.1.2` release are complete;
`0.1.1` release and the four-package KB trusted `0.1.3` release are complete;
their exact receipts remain in the ledger. All four KB packages have
`latest: 0.1.2`; Agent Access has `latest: 0.1.1`; all retain historical
`bootstrap: 0.1.0`. Source `0.1.3` remains unpublished and needs its own review,
`latest: 0.1.3`; Agent Access has `latest: 0.1.1`; all retain historical
`bootstrap: 0.1.0`. Synchronized source `0.1.4` remains unpublished and needs its own review,
current-head CI, trusted release and strict consumer verification. Neither registry publication nor
synthetic proof satisfies real host acceptance or approves activation.

Expand Down
57 changes: 45 additions & 12 deletions docs/AGENT_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ an MCP adapter, and a Web Request/Response adapter. Both transports invoke the
existing `KnowledgeBaseApplication`; neither introduces
an authorization engine or another article lifecycle. The KB `0.1.0` packages
completed manual bootstrap without OIDC provenance. All four `0.1.1` packages
have since completed verified trusted publication. The current verified KB
release is [`0.1.2`](BOOTSTRAP.md#current-verified-012-release).
Optional report mode is new unpublished `0.1.3` candidate source, with its own
review, gates and verified trusted release pending.
have since completed verified trusted publication. All four KB packages are now
verified published at [`0.1.3`](https://github.com/pegma-dev/knowledge-base/releases/tag/v0.1.3),
including optional human-reviewed report mode. The synchronized `0.1.4` source
candidate adds the governed authoring-context pair and optional aggregate report
query. Its own review, gates, publication and strict verification remain open.
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
Expand Down Expand Up @@ -100,7 +101,7 @@ artifact URL and executes no guide step.

## Optional native-client report mode

The unpublished `0.1.3` source adds an optional `reports` port:
The verified `0.1.3` release includes an optional `reports` port:
`Pick<KnowledgeEvidenceReports, "report" | "ledger" | "status">`. A host can
compose the shared [human-report factory](EVIDENCE_REPORTS.md) behind this port.
It adds no tool or scope. The same MCP connection advertises extended strict
Expand All @@ -109,6 +110,24 @@ HTTP accepts the same versioned envelopes. Clients cannot enable the mode
through a request flag. When `reports` is omitted, legacy tool schemas,
accepted inputs and result shapes remain unchanged; extension fields reject.

The unpublished `0.1.4` candidate additionally accepts optional `reports.query`,
extending that trio with `Partial<Pick<KnowledgeEvidenceReports, "query">>`.
The trusted method is `query(access, { articleId, status?: { ledgerEpoch,
reportId } })`. Its body-free result contains `target: { articleId, generation,
collectionId, kind }`, `requirements`, `ledger`, and optional owner-only `status`.
The dispatcher makes one query call for report-aware requirements and projects
only the existing requirements/reportLedger/reportStatus fields. Internal target
metadata and ledger capacity are not new wire fields. This is a producer port,
not an additional tool, scope, client flag or client-supplied authority.

Supplying only the original trio retains its existing observation sequence.
Legacy requirements without `articleId` do not invoke query. A configured query's
failure or malformed output never falls back to a potentially different read;
missing or unsolicited status and inconsistent target/status identities refuse.
Collection/kind and epoch conflicts retain their existing safe errors. The
native query owns its current target, governance, ledger and final owner-status
observations; these do not form a cross-collection transaction.

The public types are `KnowledgeAgentReportRequirementsInput`,
`KnowledgeAgentReportRequirementsResult`, `KnowledgeAgentReportSubmissionInput`,
`KnowledgeAgentPendingReport`, `KnowledgeAgentReportEnvelope`, and
Expand Down Expand Up @@ -161,13 +180,24 @@ Explicit reassessment rotates the receipt cycle; poll for its current receipt
and obtain a new human confirmation before submitting it.

The optional port is trusted host composition, not a credential verifier. Bind
each `report`, `ledger` and `status` call to the same authenticated request/grant
and recheck that grant's identity, scope/resource restrictions and revocation
before and after awaited work. Preserve the dispatcher-supplied restricted
context; a freshly resolved owner/Admin context must not replace it. The host
must fence current grant changes during these awaits as well as authenticate
the initial transport request. The shared ledger's current-principal checks
do not independently authenticate a host grant.
all report/query work to the same original authenticated request, credential,
principal, grant, client and resource. Authenticate the initial transport request.
For pure reads, a host may retain per-port checks or use a request-local read
group: refresh full credential authority before its first read, enforce every
required permission clause on its restricted context, then refresh full current
authority after the completed actual `dispatcher.dispatch` invocation and before
any result is disclosed. Recheck the original header and all used scope and
permission requirements; never reuse the group across dispatches. MCP's actual
awaited tool callback is the boundary, not an outer Response that might precede
asynchronous tool work. Preserve fresh before/after guards on every write.

Preserve the dispatcher-supplied restricted context; a freshly resolved
owner/Admin context must not replace it. The shared ledger's current-principal
checks do not independently authenticate a host grant. The `0.1.4` application
context/confirmation pair can reduce repeated governed reads, but its opaque,
single-use observation is instance- and caller-bound read bookkeeping, not a
credential, evidence attestation or permission. It is never serialized, stored
or supplied by the agent. See [report composition](EVIDENCE_REPORTS.md).

Report writes and article reads/commits are separate. A later fence failure
can withhold a response after a report was queued; conflict or unavailability
Expand All @@ -191,6 +221,9 @@ decision, reset/drain, private-evidence read or publication tool is added.
The [public types](../packages/mcp/src/types.ts) and
[source protocol cases](../tests/agent-reports.test.ts) cover this optional mode;
actual native-client/host acceptance remains separate.
Reducing public-port calls does not establish a D1 query, CPU, physical-row or
wall-clock allowance. Actual supported host profiles still require measurement;
this candidate makes no universal Free-tier acceptance claim.

## HTTP composition

Expand Down
44 changes: 33 additions & 11 deletions docs/AGENT_WORKFLOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ 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 `0.1.0` packages completed manual bootstrap and
exact-byte postflight without OIDC provenance. All four `0.1.1` packages have
since completed verified trusted publication, followed by the current verified
[`0.1.2` release](BOOTSTRAP.md#current-verified-012-release).
Optional human-report mode is unpublished `0.1.3` candidate source with its own
review/release gates. This document
since completed verified trusted publication. All four packages are now verified
published at [`0.1.3`](https://github.com/pegma-dev/knowledge-base/releases/tag/v0.1.3),
including optional human-report mode. The synchronized unpublished `0.1.4`
candidate adds governed context reads and an optional aggregate report query;
its own review, gates, publication and strict verification remain open. 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).
Expand Down Expand Up @@ -109,6 +110,15 @@ staff tool. Without that port, their legacy schemas and behavior remain exact.
The [wire contract](AGENT_API.md#optional-native-client-report-mode) defines
the public DTOs. Both variants need effective `draftRead` and `evidenceSubmit`.

The `0.1.4` source candidate can compose optional `reports.query` behind that
same requirements tool. It consolidates the current target/requirements,
ledger and optional owner-status observations without changing the client
request, result schema, five tools or three scopes. The original three report
methods remain a compatible fallback; omitting reports retains legacy mode.
Query target metadata, private report data and opaque context observations are
never added to the wire. A failed configured query refuses rather than silently
switching read paths. Clients do not request or authorize this optimization.

1. Read the exact draft and call `getValidationRequirements` with its
`collectionId`, `kind` and `articleId`. Keep the returned
`reportLedger.ledgerEpoch`; a resetting ledger needs authorized staff
Expand Down Expand Up @@ -140,10 +150,18 @@ reportGeneration }` and exact command input. This acknowledges a private
freshness mismatches. Complete every required check, then let staff perform
separate exact review/publication.

The host must bind optional report-port calls to the same authenticated
request/grant, rechecking its current scope/resource/identity and revocation
before and after awaited report work. Current owner/Admin authority never
substitutes for the restricted delegated context. Report/KB transactions remain
The host must bind optional report/query calls to the original authenticated
request, credential, principal, grant, client and resource. Keep initial request
authentication. Pure reads may use a request-local full-credential check before
the first read and another after the complete actual dispatcher invocation,
checking every required scope/permission clause before disclosing its result.
That final check belongs inside the awaited MCP tool callback; guarding only an
outer Response is insufficient. Per-port read checks remain valid, and writes
retain fresh before/after guards. Never cache a read group across invocations.
Current owner/Admin authority never substitutes for the restricted delegated
context. An opaque application context observation only rechecks the producing
instance's exact read; it supplies no credential, human review or proof authority.
Report/KB transactions remain
separate; a final conflict or lost response can follow a queued report without
rolling it back. See [report retention and replay](EVIDENCE_REPORTS.md#capacity-retention-and-replay)
for epoch reset, receipt cycles and bounded recovery.
Expand Down Expand Up @@ -185,16 +203,17 @@ Historical source-proof evidence retains the original reviewed AUTH-01
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, and the current separate KB `0.1.2` trusted release is verified.
source is merged, and all four KB `0.1.3` packages have completed verified
publication. The earlier `0.1.2` release remains historical evidence.
Agent Access's
[release-preparation source](https://github.com/pegma-dev/agent-access/pull/2)
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.3` report-mode candidate retains its own gates, PR, and verified trusted release
pending. Both verified trusted dependencies precede production host
The KB `0.1.4` context/query candidate retains its own gates, PR, and verified
trusted release pending. Both verified trusted dependencies precede production host
assembly. Branches, copied source, local paths, and unpublished production
tarballs cannot substitute for them.

Expand Down Expand Up @@ -229,3 +248,6 @@ content, and operational evidence in their owning private systems. Actual
client runs, staff review/publication, privacy, isolation, bounded work, and
full human-workflow acceptance remain prerequisites before activation, A-01,
and either supervised pilot. Synthetic SDK success waives none of them.
Fewer repeated reads do not prove a Free-tier D1 budget, CPU allowance or bounded
physical-row cost. Measure the actual supported host invocation profiles before
claiming readiness; this candidate closes no such acceptance gate.
Loading
Loading