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
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ retiregolden.org, runs the stack on Azure).
Datadog. Workers Logs persistence is enabled via Wrangler
`observability` (the Cloudflare log store). Datadog ships when
`DATADOG_API_KEY` is set as a Worker secret.
- The **portability exhibit**: the account API composes
`@pegma/storage-cloudflare-d1` and exact `@pegma/sessions@0.1.0` today.
Identity and its Authorization adapter remain fail-closed injected ports
until their first exact public versions can replace the release boundary in
`worker/src/identity-runtime.ts`.
- The **portability exhibit**: the account API composes exact
`@pegma/storage-cloudflare-d1@0.4.7`, `@pegma/sessions@0.2.1`,
Comment thread
FlyOverCoderKY marked this conversation as resolved.
Resolved
`@pegma/identity@0.1.2`, and `@pegma/authorization-identity@0.4.0`
through `worker/src/identity-runtime.ts`.
- **Environment runbooks** for a synthetic Bench Ticket demo (email-code
identity, sessions, mail catcher, support desk, health):
[https://pegma.dev/runbooks](https://pegma.dev/runbooks).
Expand Down
45 changes: 27 additions & 18 deletions docs/KNOWLEDGE_COMPOSITION.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ the existing deployment workflow, which deploys the Worker before the Pages
site. Confirm that run and the metadata readback below before client tests.
Native-client acceptance and broader rollout remain pending. The host uses
exact published `@pegma/agent-access@0.1.1` and all four
`@pegma/knowledge-base-*` packages at `0.1.5`, over its existing Identity,
`@pegma/knowledge-base-*` packages at `0.1.6`, over its existing Identity,
Sessions, stored roles and D1 Store. The public catalog at `/api/mcp` remains
separate from protected article authoring.

Expand All @@ -21,23 +21,24 @@ at signed source
passed independent exact-byte, signature/provenance and registry-consumer
verification. Existing Identity and Support Desk keep their
`@pegma/rate-limit@0.2.0` dependency. The current host selects all five Support
Desk packages at `0.2.5`, including the optional AI coordinator. The separate
Desk packages at `0.2.7`, including the optional AI coordinator. The separate
synthetic stage remains default-disabled. The
[verified Support Desk `0.2.5` release](https://github.com/pegma-dev/support-desk/releases/tag/v0.2.5)
pins its optional AI dependency on KB application/contracts `0.1.5`.
[verified Support Desk `0.2.7` release](https://github.com/pegma-dev/support-desk/releases/tag/v0.2.7)
pins its optional AI dependency on KB application/contracts `0.1.6`.

The learning port forwards actual KB errors without the obsolete `0.1.2`
constructor alias or class-translation shim. The earlier `0.2.1` / nested `0.1.2`
assembly and its failed isolated production-layout diagnostic remain historical;
they neither establish nor replace current-graph qualification.

All four exact KB `0.1.5` packages are installed in the manifest and lockfile.
The answering read-batching release retains the shared report factory and
governed authoring-context/report-query APIs. Its producer verification covers
All four exact KB `0.1.6` packages are installed in the manifest and lockfile.
The release adds bounded native-client MCP request-metadata compatibility and
retains the shared report factory and governed authoring-context/report-query
APIs. Its producer verification covers
original registry bytes, signatures/source provenance and public-consumer
checks at signed source
[`6dae20df8dace50ad961d9c5fe8d28c90bf4918f`](https://github.com/pegma-dev/knowledge-base/commit/6dae20df8dace50ad961d9c5fe8d28c90bf4918f).
[Verified KB `0.1.5` release](https://github.com/pegma-dev/knowledge-base/releases/tag/v0.1.5).
[`b2946e149078e0ef460f970c2271c196ea9fc759`](https://github.com/pegma-dev/knowledge-base/commit/b2946e149078e0ef460f970c2271c196ea9fc759).
[Verified KB `0.1.6` release](https://github.com/pegma-dev/knowledge-base/releases/tag/v0.1.6).

The historical
[verified `0.1.4` release](https://github.com/pegma-dev/knowledge-base/releases/tag/v0.1.4)
Expand All @@ -59,7 +60,7 @@ model. It adds no public ingress or sixth cron to the existing human/KB
handlers. Actual stage broker and CPU proof remain pending, together with the
existing production, customer and provider acceptance gates.

The current manifest and lockfile pin released KB `0.1.5`,
The current manifest and lockfile pin released KB `0.1.6`,
`@pegma/storage-cloudflare-d1@0.4.7` and genuine `@pegma/storage-core@0.4.0`.
The D1 adapter itself retains that exact Core `0.4.0` dependency; no source alias,
local archive, override or forced Core deduplication supplies the canonical
Expand Down Expand Up @@ -90,6 +91,9 @@ PG-01's full review, CI and automatic deployment passed at that earlier checkpoi

### Public 0.2.5 adoption checkpoint

Release evidence for this historical checkpoint is the
[verified Support Desk `0.2.5` release](https://github.com/pegma-dev/support-desk/releases/tag/v0.2.5).

On 2026-11-11, the normal public Support `0.2.5` / D1 `0.4.7` graph passed local
Node `22.18.0` checks, all 1,125 tests, the static build and the main-Worker
packaging dry run. The normal suites comprised 1,002 Node tests across 62 files,
Expand Down Expand Up @@ -216,9 +220,11 @@ The [host policy](../worker/src/support-access.ts) keeps authority explicit:
- `Support` retains its original six Support Desk permissions (queue read,
staff reply, notes, assignment, management and Audit read) and adds explicit
human takeover plus explicit learning read, evidence submission, review and
withdrawal under policy `pegma.dev-policy-5`.
Learning processing is not granted. Existing assignments are not migrated
or silently granted KB powers.
withdrawal introduced by policy `pegma.dev-policy-5`. Current policy
`pegma.dev-policy-6` retains them and adds human engineering read, evidence
submission, review, withdrawal and repository-policy read. Learning processing
is not granted. Existing assignments are not migrated or silently granted KB
powers.
- `Knowledge` is a separately assigned role for collection reads, draft and
evidence work, human report review, publication and withdrawal. Admin-only
collection/governance mutation controls remain separate.
Expand Down Expand Up @@ -399,10 +405,13 @@ two isolated rate invocations followed by one ready-hint invocation:
remain a latency aid, with atomic SDK jobs and physical recovery preserved.

The original four other expressions remain in place. The cleanup rotation
retains its original 15 lanes and adds one separately gated learning-review
discovery lane, for 16 exclusive lanes. That lane emits queue hints only; a
review phase runs in a later Queue invocation. The default root supplies no
trusted learning bundle and keeps the review flag off. Minutes 58 and 59 have no `RATE_LIMIT_CRON` invocation. Before
retains its original 15 lanes, the separately gated learning-review discovery
lane and two engineering limiter lanes, for 18 exclusive lanes. Each lane runs
once per 18 eligible ticks, a nominal 18-19 minutes because minute 59 is
omitted. The learning lane emits queue hints only; a review phase runs in a
later Queue invocation. The default root supplies no trusted learning bundle
and keeps the review flag off. Minutes 58 and 59 have no `RATE_LIMIT_CRON`
invocation. Before
merging, inventory every Worker's current cron triggers in the deployment
account: pushes to `main` deploy these schedules regardless of the Knowledge
flag. Deployment replaces this Worker's existing expressions with these
Expand Down Expand Up @@ -472,7 +481,7 @@ completions cannot overwrite a newer generation. Already committed projection
writes are not rolled back after acknowledgement uncertainty.

The existing Knowledge turn in the
[16-lane cleanup schedule](../worker/src/maintenance-schedule.ts) independently
[18-lane cleanup schedule](../worker/src/maintenance-schedule.ts) independently
calls `repairRetrievalPage` with `limit:1` and `maxBatches:1`. Complete physical
cycles and the SDK's existing atomic article-change jobs remain the recovery
path for a lost hint, collection/policy changes and unfinished work. The ready
Expand Down
11 changes: 6 additions & 5 deletions docs/SUPPORT_ASSISTANT_STAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ checked during cloud qualification. See
## Run the local checks

Use the repository's supported Node version and frozen dependency install.
The current package selection is Support Desk `0.2.5` with direct Knowledge Base
`0.1.5`; [package.json](../package.json) is authoritative.
The current package selection is Support Desk `0.2.7` with direct Knowledge Base
`0.1.6`; [package.json](../package.json) is authoritative.

From the repository root:

Expand Down Expand Up @@ -87,11 +87,12 @@ on Node 22.18.0. Recovery profiles recorded 31 physical D1 calls for preparation
and 50 for answering, with zero blocked calls. Preparation made zero model or
reservation calls. Answering used one model call, one reservation and one
reconciliation, with the persisted ledger stable across later duplicates.
These historical results apply to that fictional fixture. The current public
These historical results apply to that fictional fixture. The earlier public
`0.2.5` graph passed the normal 1,125-test local/CI
[adoption checkpoint](KNOWLEDGE_COMPOSITION.md#public-025-adoption-checkpoint).
Deployed broker timing, retry delivery, CPU use and wider workloads retain
their qualification gates.
That checkpoint does not qualify the current `0.2.7` graph. Current host
validation remains pending. Deployed broker timing, retry delivery, CPU use and
wider workloads retain their qualification gates.

## Generate a fictional seed locally

Expand Down
96 changes: 67 additions & 29 deletions docs/SUPPORT_COMPOSITION.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ provider and customer activation retain their acceptance gates. See the

Exact published versions:

- `@pegma/support-desk-application@0.2.5`
- `@pegma/support-desk-contracts@0.2.5`
- `@pegma/support-desk-core@0.2.5`
- `@pegma/support-desk-templates@0.2.5`
- `@pegma/support-desk-ai@0.2.5` (optional coordinator)
- `@pegma/support-desk-application@0.2.7`
- `@pegma/support-desk-contracts@0.2.7`
- `@pegma/support-desk-core@0.2.7`
- `@pegma/support-desk-templates@0.2.7`
- `@pegma/support-desk-ai@0.2.7` (optional coordinator)
- `@pegma/authorization-admin@0.4.0` (role administration service)
- `@pegma/authorization-core@0.4.0` (AccessContext resolution)
- `@pegma/authorization-policy@0.4.0` (PolicyDocumentV1 schema validation)
- `@pegma/authorization-storage@0.4.0` (D1-backed role store)

All five Support Desk packages have completed producer publication and
registry qualification. The optional AI package selects exact KB application
and contracts `0.1.5`; the host selects all four KB packages at that version.
and contracts `0.1.6`; the host selects all four KB packages at that version.
Producer qualification and installation do not complete host or provider
acceptance. [Verified Support Desk `0.2.5` release](https://github.com/pegma-dev/support-desk/releases/tag/v0.2.5),
[verified KB `0.1.5` release](https://github.com/pegma-dev/knowledge-base/releases/tag/v0.1.5).
acceptance. [Verified Support Desk `0.2.7` release](https://github.com/pegma-dev/support-desk/releases/tag/v0.2.7),
[verified KB `0.1.6` release](https://github.com/pegma-dev/knowledge-base/releases/tag/v0.1.6).

Peers already present on the host: `@pegma/storage-core@0.4.0`,
`@pegma/storage-cloudflare-d1@0.4.7`, `@pegma/sessions@0.2.0`,
`@pegma/storage-cloudflare-d1@0.4.7`, `@pegma/sessions@0.2.1`,
`@pegma/rate-limit@0.2.0`, `@pegma/identity@0.1.2`, `@pegma/spine@0.1.1`.
These are direct host selections; the lockfile retains each released package's
own dependencies, including Support Desk's Spine `0.1.2`. No override or forced
Expand All @@ -45,9 +45,13 @@ The earlier [qualified Support 0.2.2 release](https://github.com/pegma-dev/suppo
uses signed source
[`99cf4e67da1d2357d99fd80389a96318a6e2cc93`](https://github.com/pegma-dev/support-desk/commit/99cf4e67da1d2357d99fd80389a96318a6e2cc93).
[Strict release verification](https://github.com/pegma-dev/support-desk/actions/runs/42907283767/job/130161276758)
qualifies those historical producer packages. The current public `0.2.5` graph
has passed the [normal local and CI validation checkpoint](KNOWLEDGE_COMPOSITION.md#public-025-adoption-checkpoint).
Review and deployment acceptance remain pending for the changed host.
qualifies those historical producer packages. The earlier public `0.2.5` graph
passed the [normal local and CI validation checkpoint](KNOWLEDGE_COMPOSITION.md#public-025-adoption-checkpoint).
That checkpoint does not qualify the current `0.2.7` host graph. Current host
validation, review and deployment acceptance remain pending. The current
[Sessions `0.2.1` selection](https://github.com/pegma-dev/sessions/releases/tag/v0.2.1)
includes the verified producer fix for the earlier `0.2.0` default-clock
concurrency defect under a consistent advancing clock.

## Storage namespace

Expand Down Expand Up @@ -78,7 +82,7 @@ unified host policy's `defaults` (no paid entitlement):
- `support.ticket.reply.own`
- `support.ticket.request_person.own`

Policy version: `pegma.dev-policy-5` — one `PolicyDocumentV1` for the whole
Policy version: `pegma.dev-policy-6` — one `PolicyDocumentV1` for the whole
host, schema-validated in tests (see `docs/ROLE_ADOPTION_PLAN.md`).

### Staff (stored `Support` role)
Expand All @@ -103,8 +107,13 @@ The `Support` role maps to:
- `support.learning.evidence.submit`
- `support.learning.review`
- `support.learning.withdraw`
- `support.engineering.read`
- `support.engineering.evidence.submit`
- `support.engineering.review`
- `support.engineering.withdraw`
- `support.engineering.policy.read`

`Admin` and `Knowledge` alone do not grant Support permissions. Taking over
`Admin` and `Knowledge` alone do not grant Support queue authority. Taking over
changes handling authority; the existing assignment action remains separate.

**Bootstrap (one-time seeding).** `PEGMA_SUPPORT_BOOTSTRAP_PRINCIPALS`
Expand Down Expand Up @@ -259,8 +268,10 @@ Durable rate-limit policies (separate from Identity):
request-person and takeover, including retries)
- `pegma.admin.role.mutate` (assign / revoke, 30/h per operator)
- `pegma.admin.principal.lookup` (directory lookups, 120/h per operator)
- `pegma.support.engineering.read` (engineering reads, 120/h per operator)
- `pegma.support.engineering.mutate` (engineering mutations, 30/h per operator)

All four are swept by the same rotating cleanup schedule, one policy per
All six are swept by the same rotating cleanup schedule, one policy per
invocation.

## Site pages
Expand All @@ -275,19 +286,20 @@ invocation.

## Optional resolution learning

The current source selects all five published Support Desk `0.2.5` packages
with the four direct KB `0.1.5` packages. AI `0.2.5` also declares exact KB
`0.1.5` dependencies. The public forwarding port preserves KB error instances;
The current source selects all five published Support Desk `0.2.7` packages
with the four direct KB `0.1.6` packages. AI `0.2.7` also declares exact KB
`0.1.6` dependencies. The public forwarding port preserves KB error instances;
no KB `0.1.2` alias, translation shim, second Store, override or private SDK
import supplies this assembly. The earlier Support `0.2.1` / nested KB `0.1.2`
compatibility assembly and its failed isolated production-layout diagnostic are
historical, not current graph or host-acceptance evidence.

The staged learning review admission and Queue worker retained in this branch
use the published, strictly verified Support Desk `0.2.5` APIs. The combined
public graph passed normal local and CI validation; review and deployment
acceptance remain pending. Runtime availability and feature activation retain
their existing trusted composition and readiness controls.
use the published, strictly verified Support Desk `0.2.7` APIs. The earlier
`0.2.5` host validation checkpoint remains historical. Current host validation,
review and deployment acceptance remain pending. Runtime availability and
feature activation retain their existing trusted composition and readiness
controls.

[Learning intake and processing](../worker/src/support-learning.ts) are separate,
default-disabled SDK boundaries. A real source verifier, current service/staff
Expand All @@ -301,9 +313,11 @@ and staff approval of the exact checked KB target remain separate. Neither
approval nor delivery publishes a guide: ordinary KB evidence, review and
publication gates still apply.

Policy `pegma.dev-policy-5` adds four explicit learning permissions to `Support`;
it grants neither learning processing nor KB staff access. Private proposal
reads and new review commits also require separately current KB `draftRead` and
Policy `pegma.dev-policy-5` introduced four explicit learning permissions to
`Support`. Current policy `pegma.dev-policy-6` retains those grants and adds
human engineering permissions; learning processing and KB staff access remain
separate. Private proposal reads and new review commits also require separately
current KB `draftRead` and
`provenanceRead`, normally through `Knowledge` or `Admin`. Browser submissions
and trusted direct SDK reviews enforce fresh KB and learning review/queue
permissions before and after the actual SDK proof. HTTP requires the complete
Expand Down Expand Up @@ -354,7 +368,7 @@ request/maintenance batching and activation limits remain documented in
## Staged assistant retrieval is separate

AI `0.2.2` introduced explicit `stagedRetrieval:true`, retained by the current
`0.2.5` selection; omission remains monolithic. The preparation attempt retrieves authorized sources and records a
`0.2.7` selection; omission remains monolithic. The preparation attempt retrieves authorized sources and records a
bounded no-call request without reserving paid usage. Only its durably
acknowledged finish returns `prepared`. The host must return and schedule a
genuinely later physical invocation at or after `nextAttemptAt`, never loop or
Expand All @@ -374,9 +388,9 @@ provider or activation result.
The separate cleanup cron (`0-58 * * * *`) runs one rotating task per
invocation, including Support Desk queue repair, inactive projection sweep,
each Support/Admin rate-limit policy and the separately gated learning-review
discovery lane. Each task runs once per sixteen eligible ticks (minute 59 is
omitted), with independent queue cursors and no
writes for unchanged bookmarks.
discovery lane, for 18 exclusive lanes. Each task runs once per 18 eligible
ticks, a nominal 18-19 minutes because minute 59 is omitted, with independent
queue cursors and no writes for unchanged bookmarks.
Identity Mail send and reconciliation have separate invocations
(`* * * * *` and `1-59 * * * *`); KB ready hints and their isolated rate cleanup
use the existing `0-57 * * * *` lane. No cron is added for human controls.
Expand Down Expand Up @@ -404,3 +418,27 @@ store probe runs only when `SUPPORT_HEALTH_PROBE` is exactly `"true"`.
documented further before accepting production-sensitive data at scale.

Built in the open by RetireGolden, LLC.


## Optional engineering human composition

The [engineering assembly](SUPPORT_ENGINEERING.md) uses policy version 6.
Support receives the five named human engineering permissions. Admin adds
repository-policy read and manage permissions. Policy operations require
current Admin and Support queue authority together.

The Worker accepts a trusted optional engineering composition. Its current
enabled callback and dependency bundle gate the router and staff-detail hints.
Human review has an additional strict current flag. The default Worker passes
no engineering configuration, leaving intake, review and processing OFF.

A configured staged-learning factory receives the same optional composition
as its third `create` argument. It composes `composeSupportEngineeringHuman`
into its existing `createSupportApi` call so current staff-detail hints and
its learning queue use their actual shared runtime. Engineering namespaces
also pass through the request-local root assembly before legacy routes.

Both engineering review entry points pass fresh host authority through the
public coordinator's `verifyBeforeCommit` option. The SDK returns its final
synchronous proof assertion to the Application commit boundary. Exact retained
review commands recover accepted receipts before mutable proof reads.
Loading
Loading