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
587 changes: 587 additions & 0 deletions .design/c6-context-memory.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ jobs:
- name: Verify the full applicable workspace
run: cargo verus verify --workspace --all-features --locked --check-toolchain --fwd-verus-args-to roots -- --rlimit 20
- name: Reject proof cheats in every V and H root
run: cargo verus verify --package peritus-approval --package peritus-artifact-store --package peritus-budget --package peritus-codec --package peritus-evidence --package peritus-git --package peritus-journal --package peritus-kernel --package peritus-leases --package peritus-migrations --package peritus-model-protocol --package peritus-network --package peritus-patch --package peritus-policy --package peritus-process --package peritus-projection --package peritus-protocol --package peritus-provider-anthropic --package peritus-provider-compatible --package peritus-provider-core --package peritus-provider-google --package peritus-provider-openai --package peritus-quality-policy --package peritus-sandbox --package peritus-sandbox-linux --package peritus-sandbox-macos --package peritus-sandbox-windows --package peritus-secrets --package peritus-spec --package peritus-tool-protocol --package peritus-tool-router --package peritus-tools-fs --package peritus-tools-git --package peritus-tools-quality --package peritus-tools-shell --package peritus-types --package peritus-workspace --all-features --locked --check-toolchain --fwd-verus-args-to roots -- --no-cheating --rlimit 20
run: cargo verus verify --package peritus-approval --package peritus-artifact-store --package peritus-budget --package peritus-codec --package peritus-context --package peritus-evidence --package peritus-git --package peritus-journal --package peritus-kernel --package peritus-leases --package peritus-memory --package peritus-migrations --package peritus-model-protocol --package peritus-network --package peritus-patch --package peritus-policy --package peritus-process --package peritus-projection --package peritus-protocol --package peritus-provider-anthropic --package peritus-provider-compatible --package peritus-provider-core --package peritus-provider-google --package peritus-provider-openai --package peritus-quality-policy --package peritus-role --package peritus-sandbox --package peritus-sandbox-linux --package peritus-sandbox-macos --package peritus-sandbox-windows --package peritus-secrets --package peritus-spec --package peritus-tool-protocol --package peritus-tool-router --package peritus-tools-fs --package peritus-tools-git --package peritus-tools-quality --package peritus-tools-shell --package peritus-types --package peritus-workspace --all-features --locked --check-toolchain --fwd-verus-args-to roots -- --no-cheating --rlimit 20
- name: Produce the full verified release build
run: cargo verus build --workspace --all-features --release --locked --check-toolchain --fwd-verus-args-to roots -- --rlimit 20
- name: Build every V and H root without proof cheats
run: cargo verus build --package peritus-approval --package peritus-artifact-store --package peritus-budget --package peritus-codec --package peritus-evidence --package peritus-git --package peritus-journal --package peritus-kernel --package peritus-leases --package peritus-migrations --package peritus-model-protocol --package peritus-network --package peritus-patch --package peritus-policy --package peritus-process --package peritus-projection --package peritus-protocol --package peritus-provider-anthropic --package peritus-provider-compatible --package peritus-provider-core --package peritus-provider-google --package peritus-provider-openai --package peritus-quality-policy --package peritus-sandbox --package peritus-sandbox-linux --package peritus-sandbox-macos --package peritus-sandbox-windows --package peritus-secrets --package peritus-spec --package peritus-tool-protocol --package peritus-tool-router --package peritus-tools-fs --package peritus-tools-git --package peritus-tools-quality --package peritus-tools-shell --package peritus-types --package peritus-workspace --all-features --release --locked --check-toolchain --fwd-verus-args-to roots -- --no-cheating --rlimit 20
run: cargo verus build --package peritus-approval --package peritus-artifact-store --package peritus-budget --package peritus-codec --package peritus-context --package peritus-evidence --package peritus-git --package peritus-journal --package peritus-kernel --package peritus-leases --package peritus-memory --package peritus-migrations --package peritus-model-protocol --package peritus-network --package peritus-patch --package peritus-policy --package peritus-process --package peritus-projection --package peritus-protocol --package peritus-provider-anthropic --package peritus-provider-compatible --package peritus-provider-core --package peritus-provider-google --package peritus-provider-openai --package peritus-quality-policy --package peritus-role --package peritus-sandbox --package peritus-sandbox-linux --package peritus-sandbox-macos --package peritus-sandbox-windows --package peritus-secrets --package peritus-spec --package peritus-tool-protocol --package peritus-tool-router --package peritus-tools-fs --package peritus-tools-git --package peritus-tools-quality --package peritus-tools-shell --package peritus-types --package peritus-workspace --all-features --release --locked --check-toolchain --fwd-verus-args-to roots -- --no-cheating --rlimit 20
4 changes: 2 additions & 2 deletions .github/workflows/formal-governance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,13 @@ jobs:
run: cargo verus verify --workspace --all-features --locked --check-toolchain --fwd-verus-args-to roots -- --rlimit 20
- name: Reject proof cheats in every V and H root
working-directory: candidate
run: cargo verus verify --package peritus-approval --package peritus-artifact-store --package peritus-budget --package peritus-codec --package peritus-evidence --package peritus-git --package peritus-journal --package peritus-kernel --package peritus-leases --package peritus-migrations --package peritus-model-protocol --package peritus-network --package peritus-patch --package peritus-policy --package peritus-process --package peritus-projection --package peritus-protocol --package peritus-provider-anthropic --package peritus-provider-compatible --package peritus-provider-core --package peritus-provider-google --package peritus-provider-openai --package peritus-quality-policy --package peritus-sandbox --package peritus-sandbox-linux --package peritus-sandbox-macos --package peritus-sandbox-windows --package peritus-secrets --package peritus-spec --package peritus-tool-protocol --package peritus-tool-router --package peritus-tools-fs --package peritus-tools-git --package peritus-tools-quality --package peritus-tools-shell --package peritus-types --package peritus-workspace --all-features --locked --check-toolchain --fwd-verus-args-to roots -- --no-cheating --rlimit 20
run: cargo verus verify --package peritus-approval --package peritus-artifact-store --package peritus-budget --package peritus-codec --package peritus-context --package peritus-evidence --package peritus-git --package peritus-journal --package peritus-kernel --package peritus-leases --package peritus-memory --package peritus-migrations --package peritus-model-protocol --package peritus-network --package peritus-patch --package peritus-policy --package peritus-process --package peritus-projection --package peritus-protocol --package peritus-provider-anthropic --package peritus-provider-compatible --package peritus-provider-core --package peritus-provider-google --package peritus-provider-openai --package peritus-quality-policy --package peritus-role --package peritus-sandbox --package peritus-sandbox-linux --package peritus-sandbox-macos --package peritus-sandbox-windows --package peritus-secrets --package peritus-spec --package peritus-tool-protocol --package peritus-tool-router --package peritus-tools-fs --package peritus-tools-git --package peritus-tools-quality --package peritus-tools-shell --package peritus-types --package peritus-workspace --all-features --locked --check-toolchain --fwd-verus-args-to roots -- --no-cheating --rlimit 20
- name: Produce the full verified release build
working-directory: candidate
run: cargo verus build --workspace --all-features --release --locked --check-toolchain --fwd-verus-args-to roots -- --rlimit 20
- name: Build every V and H root without proof cheats
working-directory: candidate
run: cargo verus build --package peritus-approval --package peritus-artifact-store --package peritus-budget --package peritus-codec --package peritus-evidence --package peritus-git --package peritus-journal --package peritus-kernel --package peritus-leases --package peritus-migrations --package peritus-model-protocol --package peritus-network --package peritus-patch --package peritus-policy --package peritus-process --package peritus-projection --package peritus-protocol --package peritus-provider-anthropic --package peritus-provider-compatible --package peritus-provider-core --package peritus-provider-google --package peritus-provider-openai --package peritus-quality-policy --package peritus-sandbox --package peritus-sandbox-linux --package peritus-sandbox-macos --package peritus-sandbox-windows --package peritus-secrets --package peritus-spec --package peritus-tool-protocol --package peritus-tool-router --package peritus-tools-fs --package peritus-tools-git --package peritus-tools-quality --package peritus-tools-shell --package peritus-types --package peritus-workspace --all-features --release --locked --check-toolchain --fwd-verus-args-to roots -- --no-cheating --rlimit 20
run: cargo verus build --package peritus-approval --package peritus-artifact-store --package peritus-budget --package peritus-codec --package peritus-context --package peritus-evidence --package peritus-git --package peritus-journal --package peritus-kernel --package peritus-leases --package peritus-memory --package peritus-migrations --package peritus-model-protocol --package peritus-network --package peritus-patch --package peritus-policy --package peritus-process --package peritus-projection --package peritus-protocol --package peritus-provider-anthropic --package peritus-provider-compatible --package peritus-provider-core --package peritus-provider-google --package peritus-provider-openai --package peritus-quality-policy --package peritus-role --package peritus-sandbox --package peritus-sandbox-linux --package peritus-sandbox-macos --package peritus-sandbox-windows --package peritus-secrets --package peritus-spec --package peritus-tool-protocol --package peritus-tool-router --package peritus-tools-fs --package peritus-tools-git --package peritus-tools-quality --package peritus-tools-shell --package peritus-types --package peritus-workspace --all-features --release --locked --check-toolchain --fwd-verus-args-to roots -- --no-cheating --rlimit 20

gate-a:
name: Gate A
Expand Down
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,54 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]

### Added
- Implement the complete production C6 Context and Memory boundary with separate maintainable
`peritus-role`, `peritus-context`, and `peritus-memory` orchestration crates (#15)
- Project every canonical B1 actor role into an explicit non-widening context policy, including
writer, reviewer, fixer, evaluator, and evolver profiles plus restricted service/worker/plugin
profiles, without introducing another security-role identity or issuing capabilities
- Add checked ordered capability views whose Verus specification proves every visible operation
remains permitted by the exact B1 actor role, along with presentation, contribution, freshness,
memory, hidden-reasoning, and producer-ancestry controls
- Require an independent reviewer view to use fresh read-only context, exclude producer-hidden
reasoning and memory-derived producer rationale, and preserve every B2 reviewer-independence
requirement as evidence that later orchestration must establish
- Add bounded provenance-aware context nodes that bind content digests, authority and trust
ceilings, semantic classes, required/optional mode, priority, recency, role visibility, and
canonical dependencies, with graph rejection for duplicates, missing edges, and cycles
- Add deterministic required-first context selection with complete dependency closures, atomic
optional admission, stable integer precedence, explicit selection/omission reasons, checked node
and byte limits, and exact context-window, output-reserve, protocol-overhead, used, and remaining
token accounting
- Add transactional compaction validation over selected canonical source ranges, including policy
binding, digest and lineage checks, visibility, range ordering, token savings, protected policy,
specification, user-instruction, capability, and blocking-finding classes, and trust-preserving
derivation only when every source and policy allow it
- Add provider-neutral render plans whose individually delimited segments preserve source identity,
message role, provenance, authority, trust, context class, content digest, and bounded bytes
without concatenating untrusted text into an elevated instruction channel
- Add immutable scoped memory records with stable identities and revisions, original provenance,
source events, supporting and contradicting evidence, bounded confidence and relevance features,
logical observations, review/expiry state, feedback, and canonical content digests
- Add explicit memory review, quarantine, release, expiry, supersession, forgetting, and tombstone
transitions; tombstones bind prior digest and revision and deterministically dominate replayed
records at or below the deleted revision
- Add deterministic filter-before-rank retrieval with exact project/workspace/repository/actor/role
scope checks, lifecycle and tombstone exclusion, confidence and feature policy, bounded integer
score components, stable identity tie-breaking, result/token limits, and an explanation for every
selected or excluded record
- Add rebuildable canonical memory indexes and digests over active records and tombstones, with
deterministic posting lists and equivalence tests that keep storage an implementation detail for
the future C0/D0 composition boundary
- Add context and memory poisoning matrices proving instruction-like repository, external, tool,
provider, and recalled text remains quoted non-authoritative evidence with its original
provenance and cannot become policy, a capability, or an authority transition
- Add focused no-cheating Verus roots for role narrowing, context graph/selection/accounting and
compaction invariants, memory non-authority, lifecycle advancement, tombstone dominance, and
bounded retrieval; register all three crates in architecture, ordinary-API, reproducibility, and
hosted formal-governance command surfaces
- Add the complete C6 design, operating guide, crate READMEs, construction/selection/compaction/
rendering/lifecycle/index/retrieval test matrices, and the documented D0 integration boundary

- Implement the complete production C5 Model Providers boundary with six maintainable model-layer
crates for the provider-neutral protocol, shared provider core, OpenAI, Anthropic, Google, and
explicitly configured compatible endpoints (#14)
Expand Down
31 changes: 31 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ members = [
"crates/model/peritus-provider-anthropic",
"crates/model/peritus-provider-google",
"crates/model/peritus-provider-compatible",
"crates/orchestration/peritus-context",
"crates/orchestration/peritus-memory",
"crates/orchestration/peritus-role",
"crates/tools/peritus-tool-protocol",
"crates/tools/peritus-tool-router",
"crates/tools/peritus-tools-fs",
Expand Down
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,17 @@ The implemented foundation and runtime spine now covers:
HTTP/process transport boundary, production OpenAI Responses, Anthropic Messages, stable-v1
Google Interactions/Generate Content, explicitly profiled compatible endpoints, and separate
account-backed Codex/Claude routes through their credential-owning official executables, with
immutable wire fixtures and fresh-subject A2 conformance.
immutable wire fixtures and fresh-subject A2 conformance; and
- C6: canonical role-specific context views, provenance and authority-aware context DAGs,
deterministic dependency-complete selection and token accounting, validated compaction lineage,
typed provider-neutral render plans, scoped evidence-backed memory lifecycle and tombstones,
deterministic explainable retrieval, and rebuildable canonical indexes.

These are library and verification layers. There is not yet a user-facing `peritus` CLI, daemon,
TUI, complete agent loop, writer-reviewer-fixer orchestrator, or native packaged-host
qualification. C6 is the next runtime boundary: provenance-aware context construction, compaction,
memory selection/lifecycle, and role capabilities. A3, C6–C7, D0–D3, E0–E3, F0, G0–G3, and
H0–H4 remain before production release and qualification.
qualification. D0 is the next functional runtime boundary: the durable model/tool loop that
combines the completed C0–C6 contracts. A3, C7, D0–D3, E0–E3, F0, G0–G3, and H0–H4 remain before
production release and qualification.

Gate A is the current merge authority: ordinary Rust checks, architecture and API policy,
supply-chain policy, pinned toolchains, full Verus verification, and verified release builds must
Expand Down Expand Up @@ -99,6 +103,9 @@ The [C5 model provider guide](docs/c5-model-providers.md) documents the provider
verified reduction and retry semantics, hardened HTTP/process ownership, official first-party API
and account-runtime contracts, explicit compatible profiles, immutable fixtures, and provider
conformance boundary.
The [C6 context and memory guide](docs/c6-context-memory.md) documents canonical role views,
provenance-aware context graphs, deterministic selection and token planning, validated compaction,
typed rendering, scoped derived-memory lifecycle, explainable retrieval, and rebuildable indexes.
The [GitHub governance runbook](docs/github-governance.md) defines the GitHub Team-compatible
repository ruleset and required `Gate A` status that must be active after the A1 genesis push.
Immutable required-workflow authority remains an explicitly documented Enterprise Cloud deferral.
21 changes: 21 additions & 0 deletions architecture.toml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,27 @@ owner = "C5"
layer = "model"
verification_class = "H"

[[packages]]
name = "peritus-context"
path = "crates/orchestration/peritus-context"
owner = "C6"
layer = "orchestration"
verification_class = "H"

[[packages]]
name = "peritus-memory"
path = "crates/orchestration/peritus-memory"
owner = "C6"
layer = "orchestration"
verification_class = "H"

[[packages]]
name = "peritus-role"
path = "crates/orchestration/peritus-role"
owner = "C6"
layer = "orchestration"
verification_class = "V"

[[packages]]
name = "peritus-protocol"
path = "crates/foundation/peritus-protocol"
Expand Down
Loading