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
21 changes: 17 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ tests. The approved scope is the [Support Desk enhancement plan](https://github.

- Contracts and core own collection policy, immutable article revisions,
validation/evidence bindings, approval, publication, and retirement.
- KB-01 is pure domain work. Storage, authorized services, retrieval, API/MCP,
and host interfaces are later tasks; do not create their packages early.
- KB-01 owns pure domain work. KB-02 adds declared persistence and authorized
application services. Retrieval/search, API/MCP, and live host interfaces
remain later tasks; do not create their packages early.
- 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.
Expand All @@ -22,8 +23,17 @@ tests. The approved scope is the [Support Desk enhancement plan](https://github.
- Approval binds exact content, revision, audience/policy, applicability,
validation policy, and evidence. Edits and changed authority invalidate it.
A `passed` string or claimed runner identity does not authenticate evidence.
- Core transitions are not an authorization boundary. The later application
must authenticate/authorize the actor, attestations, and current resources.
- Core transitions are not an authorization boundary. The application
enforces named permissions and current KB resources; the host authenticates
access contexts and evidence/source facts. Caller-supplied proof fields do
not establish that trust.
- KB-02 article heads are normalized; content/evidence/publication history is
immutable and bounded. Application generation fences every state change,
independently of content revision. Same-partition CAS, Audit, receipts, and
causal jobs commit together. Collection/profile and article partitions do
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.
- Base packages require no Support Desk, GitHub, model, framework, HTTP, or
provider SDK. Evidence is data; never execute code or fetch submitted URLs.
- Constrain content and links; host renderers must disable executable content
Expand All @@ -50,3 +60,6 @@ trusted-publisher configuration are separate maintainer operations.
Read this file, the root README, then the owning package README. The public
enhancement plan defines KB-01 through KB-05. Give a worker one task and an
explicit file ownership boundary; do not revert another worker's edits.
For KB-02, read [declared collections](docs/COLLECTIONS.md) before changing
durable operations and [host composition](docs/HOST_COMPOSITION.md) before
changing authorization, verifier, replay, or DTO boundaries.
40 changes: 28 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ Hosts own their users, storage, authorization policy, interfaces, and deployment
Knowledge Base owns collection policy, immutable article revisions, validation,
and exact publication approval. It requires no GitHub connection or AI provider.

> Development status: KB-01 implements contracts and pure domain transitions.
> The packages are unpublished. Authorized persistence, retrieval, API/MCP,
> and customer/staff interfaces are later tasks. This repository is not yet an
> operational knowledge-base service or a production dependency.
> Development status: KB-01 provides contracts and pure domain transitions;
> KB-02 adds authorized application/persistence source. Its implementation and
> repository gates determine completion. All three packages are unpublished.
> Retrieval/search, API/MCP, and live customer/staff interfaces remain later
> tasks. This repository is not yet an operational hosted KB or a production
> dependency.

| Package | Scope |
| ----------------------------------------------------------------- | ------------------------------------------------------ |
| [`@pegma/knowledge-base-contracts`](packages/contracts/README.md) | Collection, article, evidence, and approval vocabulary |
| [`@pegma/knowledge-base-core`](packages/core/README.md) | Pure validation and lifecycle transitions |
| Package | Scope |
| --------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| [`@pegma/knowledge-base-contracts`](packages/contracts/README.md) | Collection, article, evidence, and approval vocabulary |
| [`@pegma/knowledge-base-core`](packages/core/README.md) | Pure validation and lifecycle transitions |
| [`@pegma/knowledge-base-application`](packages/application/README.md) | Authorized services, bounded declared persistence, private DTOs, and exact publication |

Collections default to private and independently specify portal and bot-answer
audiences. Articles inherit collection policy. Staff approval binds the exact
Expand All @@ -23,11 +26,22 @@ authorizes edited content.

Core transitions accept explicit inputs and return new values. They do not
authenticate a runner or staff member, enforce host roles, fetch evidence URLs,
or execute guide steps. Later application services must enforce current
Authorization Core permissions and authenticated attestation boundaries.
or execute guide steps. The application enforces current named permissions
and resource checks; hosts authenticate scoped access contexts and trusted
evidence/source facts. Private draft, evidence, provenance, and review reads
have separate DTOs. The keyed published read returns portal-safe content only.
Local agents will test guides against authorized staging and submit evidence
through the later API/MCP adapter.

KB-02 stores normalized heads and bounded immutable history with same-partition
CAS, Audit, replay receipts, and causal jobs. Application generation is separate
from content revision. Replay returns a historical bounded acknowledgement
after current authorization, never a raw aggregate. Current publication reads
reject stale authority; no cross-partition policy transaction is promised.
Read [declared collections](docs/COLLECTIONS.md) and
[host composition](docs/HOST_COMPOSITION.md) for the layout, limits, verifier
contract, and safe read boundaries.

Develop on Node 22 or 24 with pnpm 10.34.5:

```sh
Expand All @@ -38,9 +52,9 @@ pnpm test
pnpm run release:check
```

The npm and pnpm workspace declarations deliberately name the same two source
The npm and pnpm workspace declarations deliberately name the same source
packages: pnpm links them for development, while npm supplies artifact packing.
The release check installs both tarballs in a consumer outside either workspace
The release check installs all three tarballs in a consumer outside either workspace
to verify dependency resolution without source links.

The [approved enhancement plan](https://github.com/pegma-dev/support-desk/blob/main/docs/KNOWLEDGE_AI_PLAN.md)
Expand All @@ -54,3 +68,5 @@ Read [AGENTS.md](AGENTS.md) before changing code and
[release operations](docs/RELEASING.md) before preparing artifacts. Merging
source does not publish a package. Each new npm name needs the maintainer's
first publication and trusted-publisher setup before hosts can consume it.

Built in the open by RetireGolden, LLC.
Loading
Loading