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
79 changes: 79 additions & 0 deletions docs/CEDRLANG-GRIMOIRE-A2A.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# CEDRlang, Grimoire, and Local A2A Contract

## Purpose

**CEDRlang** is the repository’s deterministic, non-executing format for compact agent instruction records. **Grimoire** is the optional symbolic vocabulary layer used by an authorized mapper. The codec does not execute commands, edit files, invoke CEDARscript, call a network service, start a workflow, or use a local pointer registry.

> CEDRlang is a compact representation protocol, not encryption, authentication, authorization, or a security boundary.

A public symbolic representation may be non-self-describing, but it can only be reconstructed by an authorized mapper holder. The public repository includes no private mapper, key, token, or decoded private mapping. The only mapper used by tests is synthetic and deliberately non-sensitive.

## Canonical Source and Generated Forms

The canonical intermediate record (CIR) is the source of truth. It is normalized and serialized deterministically before hashing. Agent documents must remain readable canonical material until a separate approved migration creates deterministic machine projections. The root `AGENTS.md`, its human companion, `CLAUDE.md`, ICM entry points, and the public README are **not** rewritten by this initial foundation.

| CIR field | Type | Compression eligibility |
|---|---|---|
| `schema_version` and `document_id` | Stable identifiers | Excluded |
| `purpose` | Text | Eligible |
| `directives` | Ordered text list | Eligible |
| `constraints` | Ordered text list | Excluded to keep governance and safety boundaries plainly visible |
| `inputs` and `outputs` | Ordered text lists | Eligible |
| `provenance` | Text | Eligible |

The canonical SHA-256 digest is calculated over fixed-key JSON after Unicode NFC and line-ending normalization. A decoder must reject unsupported versions, mapper mismatch, malformed segments, unknown handles, and digest mismatch.

## Mapper Contract

An authorized mapper has a stable ID, semantic version, public content hash, and a bijective `forward`/`reverse` relation. Every normalized source token maps to one symbolic handle and every handle maps back to one source token. A mapper collision is a hard error, not a best-effort repair.

The 70% criterion is measured as:

```text
replaced eligible tokens / total eligible tokens
```

It is a codec-coverage metric, not a claim about proprietary model tokenization, compression ratio, encryption strength, or resistance to reverse engineering. Reports record the mapper metadata, canonical digest, numerator, denominator, coverage ratio, and excluded fields. A caller may set a threshold and receive a failure when it is not met.

## Local A2A Envelope

The initial Agent2Agent contract is local validation only. An envelope carries its protocol version, message ID, sender role, recipient role, correlation ID, intent, mapper ID/version, encoded payload, canonical digest, issuance time, TTL, and one of three states: `PENDING`, `ACK`, or `NACK`. Serialized envelopes use an exact field set: unknown fields, omitted fields, non-object payloads, and non-JSON-serializable payloads are rejected before record decoding is attempted.

| Control | Behavior |
|---|---|
| Version compatibility | Unknown CIR or A2A versions fail closed. |
| Integrity | Payload decoding and envelope digest must both match the canonical record. |
| Expiry | Envelopes with a passed TTL are rejected. |
| Idempotency | The same message ID and digest is an idempotent duplicate; the same ID with a different digest is a conflict. |
| State transition | Only `PENDING → ACK` and `PENDING → NACK` are permitted. |
| Size limit | Payloads above the local 64 KiB contract limit are rejected. |
| Serialized-object boundary | Unknown/missing fields, non-object payloads, and non-JSON-serializable values fail closed before payload decoding. |

No external mailbox, workflow dispatch, public transformed comment, or remote installation is part of this contract. Such integration requires a separate, accepted proposal with supply-chain review, permissions analysis, safe output design, and prompt-injection tests.

## CEDARscript and CID Separation

CEDARscript is a distinct code-analysis and transformation language with execution-capable runtimes. The repository’s `cid.py` is a pointer registry for CEDARscript command phrases. Neither surface is a CEDRlang document decoder or a private Grimoire mapper.

The implementation must maintain the following boundary:

```text
CEDRlang CIR / mapper / A2A validator
├── deterministic data transformation only
├── no subprocess, network, filesystem mutation, or execution
└── no CID or CEDARscript dependency

CEDARscript / CID / patch router
└── separately governed code-editing parity surface
```

## Implementation Reference

The initial implementation is `workspace/compression_sandbox/cedrlang/protocol.py`. Its focused tests are `tests/test_cedrlang_protocol.py`. The bounded codec, coverage, A2A, evidence, and compatibility scope is tracked as proposal `cedrlang-grimoire-a2a`, items `LGA-01`, `LGA-02`, `LGA-03`, `LGA-04`, and `LGA-06`; later migration work must receive separately scoped work items.

## References

1. [CEDRlang / Grimoire / A2A decision record](proposals/active/cedrlang-grimoire-a2a/source.md)
2. [Linguist agent-contact inventory](reviews/linguist-177/agent-contact-inventory.md)
3. [External CEDARScript boundary](reviews/linguist-177/external-cedarscript-boundary.md)
4. [CEDARScript Editor (Python)](https://github.com/CEDARScript/cedarscript-editor-python)
10 changes: 10 additions & 0 deletions docs/proposals/active/cedrlang-grimoire-a2a/ITEMS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# ITEMS — CEDRlang / Grimoire / A2A

| ID | Work | Priority | Owner | Status | Evidence / acceptance criteria |
|---|---|---:|---|---|---|
| LGA-01 | Define a versioned canonical CEDRlang record, deterministic normalization/serialization, typed errors, synthetic mapper contract, collision rejection, integrity digest, and eligible-token coverage report. | P1 | Manus AI | done | `tests/test_cedrlang_protocol.py` proves deterministic output, exact normalized round trip, digest equality, collision/unknown-handle failure, and measured coverage output. |
| LGA-02 | Define and validate a local-only A2A envelope with protocol/version fields, message and correlation IDs, mapper ID, digest, TTL, ACK/NACK state, idempotency classification, and bounded payload size. | P1 | Manus AI | done | `tests/test_cedrlang_protocol.py` rejects malformed, tampered, expired, duplicated, unsupported-version, and invalid-state envelopes. |
| LGA-03 | Preserve the existing `bin/cedrlang` interface through a small compatibility boundary while explicitly separating CID/CEDARscript editing pointers from the non-executing CEDRlang codec. | P1 | Manus AI | done | Existing document translation tests remain green; the new CEDRlang foundation has no import or invocation path to `cid.py`, patch routing, subprocesses, or external services. |
| LGA-04 | Publish CEDRlang/Grimoire/A2A specification, source-of-truth policy, mapper custody boundary, and contact-surface migration guide. | P1 | Manus AI | done | `docs/CEDRLANG-GRIMOIRE-A2A.md` names the private mapper as an external custody interface, excludes private data from the repository, and does not describe symbolic replacement as encryption. |
| LGA-05 | Run targeted codec/A2A tests, existing CedrLang tests, repository gates, secret/path checks, and a bounded context-graph closeout. | P1 | Manus AI | blocked | Tests, smoke, lint, boundary/credential scans, graph render, and review packet pass. `repo_gate.py` is blocked by inherited `archwiz/linear_sync.py` syntax; full registry validation is blocked by pre-existing orphan active directories. |
| LGA-06 | Add strict serialized A2A envelope parsing/serialization that rejects unknown or missing fields and malformed non-object payloads before envelope validation. | P1 | Manus AI | done | `tests/test_cedrlang_protocol.py` proves deterministic dictionary output, exact field acceptance, and rejection of missing, unknown, or malformed envelope objects without network, filesystem, CID, or execution access. |
73 changes: 73 additions & 0 deletions docs/proposals/active/cedrlang-grimoire-a2a/MANIFEST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
id: cedrlang-grimoire-a2a
title: "CEDRlang deterministic codec, Grimoire boundary, and local A2A envelope foundation"
author: Manus AI
posted_at: 2026-08-20
source: source.md
status: in_review
priority: P1
reviewers:
- id: timerloggedout-spec
role: operator-authorizer
status: in_review
- id: google-labs-jules
role: non-author implementation reviewer
status: requested
related_prs: [126, 154, 177, 196, 208, 218, 228, 275]
related_issues: [117, 175, 182, 274]
related_branches: [feature/cedrlang-grimoire-a2a]
gates_required: [repo-gate, termux-smoke]
---

# MANIFEST — CEDRlang / Grimoire / A2A

## Summary

This proposal reconstructs the useful, independently testable core of the Linguist PR family in a clean scope. It introduces a deterministic, non-executing CEDRlang canonical record and symbolic codec with a synthetic public test mapper, unambiguous reverse mapping, coverage reporting, integrity verification, and local Agent2Agent envelope validation. It explicitly separates the codec from CEDARscript execution and CID pointer registration, does not publish obfuscated comments, does not call external install scripts, and does not commit any private mapping material. The proposal responds to the current review findings for [#126](https://github.com/timerloggedout-spec/termux-monorepo/pull/126), [#154](https://github.com/timerloggedout-spec/termux-monorepo/pull/154), and [#177](https://github.com/timerloggedout-spec/termux-monorepo/pull/177), while preserving only their unique safe value.

## Reviewers

| ID | Role | Status | At | Notes |
|----|------|--------|-----|-------|
| Manus AI | author / executor | posted | 2026-08-20 | Bounded implementation branch; no integration or external workflow write. |
| timerloggedout-spec | operator-authorizer | in_review | 2026-08-21 | Requested consolidation of the viable successor and formal review; acceptance is still required before an integration claim or merge. |
| google-labs-jules | non-author implementation reviewer | requested | 2026-08-21 | Requested to review the bounded successor after the current Jules PR family was reconciled. |

## Review log

### 2026-08-20 — Manus AI

- Disposition: commented
- Notes: Read-only reconnaissance found seven pull requests with `Linguist` in the title and no matching issue titles. The active open PRs #154 and #177 are both dirty; the owner-directed disposition for #154 is to reconstruct unique value in a small rebased hygiene-passed diff. The private/lossless-mapper claim is not currently implemented by the tracked regex tables or tracked pointer files. See `docs/reviews/linguist-177/` for the metadata-only evidence record and inventory.

### 2026-08-20 — Manus AI publication update

- Disposition: changes_requested
- Notes: Published the review packet and required follow-up work as [issue #274](https://github.com/timerloggedout-spec/termux-monorepo/issues/274); cross-linked the evidence to issues [#117](https://github.com/timerloggedout-spec/termux-monorepo/issues/117) and [#175](https://github.com/timerloggedout-spec/termux-monorepo/issues/175), and to open PRs [#154](https://github.com/timerloggedout-spec/termux-monorepo/pull/154) and [#177](https://github.com/timerloggedout-spec/termux-monorepo/pull/177). No acceptance, merge, or private-mapper decision is implied. `RESEARCH.md` contains the pending decision/vote questions.

### 2026-08-21 — consolidation and formal-review request

- Disposition: in_review
- Notes: The successor branch was rebased onto current `master-staging`; the original focused suite passed 18 tests, and the review-resolution suite now passes 21 tests with selected lint. Current live review finds #154 and #177 open but `DIRTY`/`CONFLICTING`; [PR #275](https://github.com/timerloggedout-spec/termux-monorepo/pull/275) is the sole bounded review candidate. [Issue #182](https://github.com/timerloggedout-spec/termux-monorepo/issues/182) is the explicit Grimoire/CID/CEDR naming root; issue #117 remains the A2A design root. See `CURRENT-INTEGRATION-RECONCILIATION.md` and `current-integration-relationships.mmd`. The former registry-orphan failure is isolated in PR #290 and remains a dependency until independently integrated; it is not waived.

## Checklist (process)

- [x] Registered in `docs/proposals/registry.yaml` on this feature branch
- [x] ITEMS.md itemized before implementation
- [ ] At least one non-author review recorded
- [ ] Status → accepted before execution merges
- [ ] PRs cite `Implements: LGA-01` or the applicable work-item ID
- [ ] Gates green on merge
- [ ] Closed + moved to `closed/` when terminal

## Links

- ITEMS: ./ITEMS.md
- Source: ./source.md
- Evidence: `../../../reviews/linguist-177/`
- Related A2A proposal: [Issue #117](https://github.com/timerloggedout-spec/termux-monorepo/issues/117)
- Publication and subtask tracker: [Issue #274](https://github.com/timerloggedout-spec/termux-monorepo/issues/274)
- Operator priority/gate record: [Issue #175](https://github.com/timerloggedout-spec/termux-monorepo/issues/175)
- Research and decision requests: ./RESEARCH.md
- Current integration reconciliation: `../../../reviews/linguist-177/CURRENT-INTEGRATION-RECONCILIATION.md`
- Current relationship graph source: `../../../reviews/linguist-177/current-integration-relationships.mmd`
40 changes: 40 additions & 0 deletions docs/proposals/active/cedrlang-grimoire-a2a/RESEARCH.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Research, Review, and Decision Requests — CEDRlang / Grimoire / A2A

**Status:** Open for non-author review. This record does not approve integration, mapper custody, transport, or an agent-contact migration.

## Questions Requiring an Explicit Decision

| ID | Decision question | Required evidence | Decision owner | Current state |
|---|---|---|---|---|
| R-01 | Which approved custody service may hold a production private mapper, and who may access it? | Threat model, access matrix, rotation/revocation procedure, audit/event retention policy, incident response, and no-repository-secret proof. | Operator + security reviewer | Open |
| R-02 | What is the canonical human source for each agent contact point, and may a generated machine projection exist? | Source/target inventory, generator determinism, freshness check, rollback, readability/safety visibility audit, and owner assignment. | Operator + documentation owner | Open |
| R-03 | Which A2A transport and authentication model is acceptable after the local envelope foundation? | Authn/authz model, replay/fuzz tests, bounded idempotency-store ownership, failure semantics, key custody, privacy assessment, and transport threat model. | Operator + security reviewer | Open |
| R-04 | What operational meaning, if any, should the 70% coverage target have? | Representative approved CIR corpus, declared eligibility policy, independent measurement, quality/error analysis, and lower-bound failure behavior. | Linguist reviewer + operator | Open |
| R-05 | How are inherited repository-gate and proposal-registry blockers resolved or formally exempted? | Fix PR or explicit operator disposition, rerun evidence, and updated status board. | Repository maintainer | Open |

## Required Independent Review

A non-author reviewer must evaluate the following before the proposal status can move from `in_review` to `accepted`:

1. The clean successor still has no CID, CEDARscript, subprocess, network, mapper-content, or external-service path in `protocol.py`.
2. The lossless claim is constrained to canonical-record reconstruction with the authorized mapper; no public-obfuscation security claim is made.
3. The test suite covers mapper collisions, literal symbol preservation, integrity tampering, coverage threshold failure, TTL expiry, state transitions, and replay conflict.
4. The publication links and relationship diagrams distinguish verified evidence from candidate history and disclose the partial historical index window.
5. Any follow-on agent-contact migration has a separately accepted work item.

## Vote Record

| Reviewer | Role | Vote | Date | Evidence / rationale |
|---|---|---|---|---|
| Manus AI | author-executor | changes requested | 2026-08-20 | Foundation is implemented and published, but private custody, contact-point source policy, A2A transport, baseline blockers, and independent review remain open. |
| google-labs-jules | non-author implementation reviewer | requested | 2026-08-21 | Requested in the proposal manifest; a recorded non-author disposition is required before acceptance. |
| timerloggedout-spec | operator-authorizer | pending | — | Required before merge/integration claim. |

## Publication Links

- [GitHub follow-up and subtask tracker #274](https://github.com/timerloggedout-spec/termux-monorepo/issues/274)
- [Agent2Agent proposal #117](https://github.com/timerloggedout-spec/termux-monorepo/issues/117)
- [Operator priority/gate record #175](https://github.com/timerloggedout-spec/termux-monorepo/issues/175)
- [Review packet](../../../reviews/linguist-177/LINGUIST-REVIEW-PACKET.md)
- [CEDRlang contract](../../../CEDRLANG-GRIMOIRE-A2A.md)
- [Context-relationship graph reuse guide](../../../reviews/linguist-177/context-relationship-graph-reuse.md)
Loading
Loading