From d42662c49764749f99793e00150a2503fb50079d Mon Sep 17 00:00:00 2001 From: timerloggedout-spec <2.33432881e+08+timerloggedout-spec@users.noreply.github.com> Date: Thu, 20 Aug 2026 19:32:17 +0000 Subject: [PATCH 1/8] feat(cedrlang): add governed local codec foundation Implements: LGA-01, LGA-02, LGA-03, LGA-04 --- docs/CEDRLANG-GRIMOIRE-A2A.md | 78 +++ .../active/cedrlang-grimoire-a2a/ITEMS.md | 9 + .../active/cedrlang-grimoire-a2a/MANIFEST.md | 54 ++ .../active/cedrlang-grimoire-a2a/source.md | 31 ++ docs/proposals/registry.yaml | 22 +- .../linguist-177/LINGUIST-REVIEW-PACKET.md | 111 ++++ .../linguist-177/agent-contact-inventory.md | 59 +++ docs/reviews/linguist-177/context-issue117.md | 35 ++ docs/reviews/linguist-177/context-pr126.md | 29 ++ docs/reviews/linguist-177/context-pr154.md | 72 +++ docs/reviews/linguist-177/context-pr177.md | 86 +++ docs/reviews/linguist-177/context-pr177.mmd | 83 +++ .../linguist-177/diagram-validation.md | 12 + .../external-cedarscript-boundary.md | 22 + .../linguist-relationship-summary.mmd | 35 ++ tests/test_cedrlang_protocol.py | 177 +++++++ .../compression_sandbox/cedrlang/protocol.py | 488 ++++++++++++++++++ 17 files changed, 1401 insertions(+), 2 deletions(-) create mode 100644 docs/CEDRLANG-GRIMOIRE-A2A.md create mode 100644 docs/proposals/active/cedrlang-grimoire-a2a/ITEMS.md create mode 100644 docs/proposals/active/cedrlang-grimoire-a2a/MANIFEST.md create mode 100644 docs/proposals/active/cedrlang-grimoire-a2a/source.md create mode 100644 docs/reviews/linguist-177/LINGUIST-REVIEW-PACKET.md create mode 100644 docs/reviews/linguist-177/agent-contact-inventory.md create mode 100644 docs/reviews/linguist-177/context-issue117.md create mode 100644 docs/reviews/linguist-177/context-pr126.md create mode 100644 docs/reviews/linguist-177/context-pr154.md create mode 100644 docs/reviews/linguist-177/context-pr177.md create mode 100644 docs/reviews/linguist-177/context-pr177.mmd create mode 100644 docs/reviews/linguist-177/diagram-validation.md create mode 100644 docs/reviews/linguist-177/external-cedarscript-boundary.md create mode 100644 docs/reviews/linguist-177/linguist-relationship-summary.mmd create mode 100644 tests/test_cedrlang_protocol.py create mode 100644 workspace/compression_sandbox/cedrlang/protocol.py diff --git a/docs/CEDRLANG-GRIMOIRE-A2A.md b/docs/CEDRLANG-GRIMOIRE-A2A.md new file mode 100644 index 000000000..2fe58e013 --- /dev/null +++ b/docs/CEDRLANG-GRIMOIRE-A2A.md @@ -0,0 +1,78 @@ +# 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`. + +| 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. | + +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`. Work is tracked as proposal `cedrlang-grimoire-a2a`, item `LGA-01`; 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) diff --git a/docs/proposals/active/cedrlang-grimoire-a2a/ITEMS.md b/docs/proposals/active/cedrlang-grimoire-a2a/ITEMS.md new file mode 100644 index 000000000..198ad6175 --- /dev/null +++ b/docs/proposals/active/cedrlang-grimoire-a2a/ITEMS.md @@ -0,0 +1,9 @@ +# 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. | diff --git a/docs/proposals/active/cedrlang-grimoire-a2a/MANIFEST.md b/docs/proposals/active/cedrlang-grimoire-a2a/MANIFEST.md new file mode 100644 index 000000000..93ebc7f6b --- /dev/null +++ b/docs/proposals/active/cedrlang-grimoire-a2a/MANIFEST.md @@ -0,0 +1,54 @@ +--- +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: draft +priority: P1 +reviewers: + - id: timerloggedout-spec + role: operator-authorizer + status: requested +related_prs: [126, 154, 177, 196, 208, 218, 228] +related_issues: [117] +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 | requested | 2026-08-20 | Formal proposal acceptance is required before an integration claim or merge. | + +## 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. + +## 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) diff --git a/docs/proposals/active/cedrlang-grimoire-a2a/source.md b/docs/proposals/active/cedrlang-grimoire-a2a/source.md new file mode 100644 index 000000000..52f1dea36 --- /dev/null +++ b/docs/proposals/active/cedrlang-grimoire-a2a/source.md @@ -0,0 +1,31 @@ +# CEDRlang / Grimoire / A2A Technical Decision Record + +## Decision + +CEDRlang is a **non-executing**, deterministic codec and local message-validation layer. It operates on a typed canonical intermediate record (CIR) and may use a mapper that is injected by an authorized caller. The public repository contains only a synthetic test mapper. The **Grimoire** name refers to the optional symbolic presentation layer; it is not encryption, authentication, access control, or a claim of secrecy. CEDARscript and the current CID pointer registry remain separate code-editing/parity tooling and are not called by CEDRlang. + +A literal one-way transformation cannot independently yield perfect reverse translation. The accepted technical model is therefore: a public symbolic representation is non-self-describing, while an authorized mapper holder can reconstruct the normalized canonical record deterministically and verify its integrity. No private mapper is committed, logged, embedded in a generated document, or copied into a pull-request comment. + +## Canonical Intermediate Record + +A canonical record has the following fields: `schema_version`, `document_id`, `purpose`, `directives`, `constraints`, `inputs`, `outputs`, and `provenance`. Each field is plain text or an ordered list of plain text. Canonicalization performs Unicode NFC normalization, normalizes line endings to LF, removes trailing whitespace, rejects NUL/control characters, and serializes a fixed sorted-key JSON representation. Its SHA-256 digest is the transmission-integrity value. + +## Mapper Contract + +A mapper is an immutable, versioned mapping from a normalized eligible token or phrase to an unambiguous symbolic handle. It supplies `mapper_id`, semantic version, a public content hash, `forward` and `reverse` maps, and an explicit `private` custody flag. A valid mapper has unique handles and a bijective reverse map. The codec rejects collisions, unknown handles, malformed handles, cycles, invalid versions, and content hash mismatches. The implementation provides a synthetic `test-grimoire-v1` mapper only; a production mapper must arrive through an operator-approved secret-safe interface that is outside this repository. + +## Coverage and 70% Target + +The measurable 70% target is **not** an estimated tokenizer claim. It is `replaced_eligible_tokens / total_eligible_tokens` across the allowed CIR fields. Structural keys, schema/version fields, digests, IDs, safety constraints, and escaped protected literals are excluded from the denominator. A report includes the numerator, denominator, exclusions, mapper ID, mapper version, canonical digest, and calculated ratio. The codec can enforce a caller-selected minimum target and fails closed when the threshold is not reached. + +## A2A Envelope + +The local A2A envelope is a typed schema rather than arbitrary compressed prose. It carries protocol version, message ID, sender role, recipient role/capability, correlation ID, intent, payload, mapper identity, canonical digest, issuance timestamp, TTL, state, acknowledgement ID, and error code. It validates IDs, size limits, version compatibility, expiry, digest, and allowed state transitions. It categorizes duplicate message IDs as idempotent duplicates only when the canonical digest matches; a reused ID with a different digest is a conflict. The initial implementation performs no network access, no workflow dispatch, no external install, and no code modification. + +## Explicit Non-Goals + +The following are excluded from this proposal: migrating the root `AGENTS.md` or `README.md`; generating human or machine instruction projections; changing `.cedar/cedar_index.json`; changing `cid.py`; invoking CEDARscript, `sed`, `awk`, AST tools, or patch routers; installing MCP Agent Mail; posting transformed public content; changing GitHub Actions; and creating a private-mapper secret store. These items need separate approved work items after the canonical codec proves its constraints. + +## Evidence Basis + +The decision is based on the bounded graph rooted at PR #177, all-state title inventory, local source inventory, and the operator scope guidance for the dirty Linguist PRs. It preserves the valid requirements for deterministic translation and A2A protocol development while correcting the current scope mix between a document translator and an execution-capable code-editing system. diff --git a/docs/proposals/registry.yaml b/docs/proposals/registry.yaml index 994620b86..1f9d5deaa 100644 --- a/docs/proposals/registry.yaml +++ b/docs/proposals/registry.yaml @@ -1,7 +1,7 @@ # ArchW1z proposal registry — agents read this first version: 1 -updated_at: "2026-08-07T00:00:00Z" -updated_by: tembo +updated_at: "2026-08-20T00:00:00Z" +updated_by: Manus AI proposals: - id: context-relationship-graph @@ -129,3 +129,21 @@ proposals: status: posted related_prs: [63] gates_required: [repo-gate] + + - id: cedrlang-grimoire-a2a + title: "CEDRlang deterministic codec, Grimoire boundary, and local A2A envelope foundation" + author: Manus AI + status: draft + priority: P1 + path: active/cedrlang-grimoire-a2a/ + reviewers: + - id: Manus AI + role: author-executor + status: posted + - id: timerloggedout-spec + role: operator-authorizer + status: requested + related_issues: [117] + related_prs: [126, 154, 177, 196, 208, 218, 228] + related_branches: [feature/cedrlang-grimoire-a2a] + gates_required: [repo-gate, termux-smoke] diff --git a/docs/reviews/linguist-177/LINGUIST-REVIEW-PACKET.md b/docs/reviews/linguist-177/LINGUIST-REVIEW-PACKET.md new file mode 100644 index 000000000..e6e4bd68c --- /dev/null +++ b/docs/reviews/linguist-177/LINGUIST-REVIEW-PACKET.md @@ -0,0 +1,111 @@ +# Linguist Review Packet — PR #177 and Related Work + +**Review date:** 2026-08-20 UTC + +**Repository evidence revision:** `933d65d0e2c49e28079f300f5a516932330c60e7` + +**Implementation branch:** `feature/cedrlang-grimoire-a2a` from `master-staging` at `d33842a` + +**Review status:** **Conditional / not merge-ready** + +## Executive Assessment + +The Linguist workstream contains a useful performance-oriented public document translator, but its present implementation does not substantiate the requested internal-mapper, measured-70%, clean-transmission, or Agent2Agent protocol claims. The current regex codec, tracked CEDARscript pointer index, and public Grimoire diction sources represent separate concerns that have drifted into one role. The two open focal pull requests are both broad, dirty stacks and are unsuitable targets for incremental repair. The evidence-supported disposition is to preserve only isolated value in a clean, governed successor branch rather than amend or force-merge those stacks. [1] [2] + +A bounded implementation has been added on the successor branch. It introduces a deterministic, non-executing CIR codec, bijective synthetic mapper contract, integrity digest, measurable eligible-token coverage report, and local A2A envelope validator. It deliberately excludes private mapper contents, CEDARscript/CID execution, public transformed postings, workflow changes, external installation, and any migration of root agent contact files. The work remains **conditional** because the repository gate and full proposal-registry validator have inherited baseline blockers, and proposal acceptance/non-author review remain pending. + +| Disposition | Rationale | +|---|---| +| **Do not amend or merge PR #177** | Public metadata reports an open, dirty, non-rebaseable stack with 161 changed files and substantial unrelated scope. [1] | +| **Do not amend or merge PR #154** | Public metadata reports an open 165-file stack; its inspected owner guidance is recorded only by permalink and directs a small reconstructed hygiene-passed change rather than re-landing the stack. [2] | +| **Keep #196, #208, #218, and #228 as historical optimization evidence** | Each is merged and narrowly touches the public translator/tests; shared-file history is a candidate link, not proof that its design decisions solve the mapper or A2A requirements. [1] | +| **Implement a clean successor foundation** | The new proposal and `LGA-01` contract isolate deterministic codec/A2A behavior from CEDARscript pointers and expose explicit tests/evidence. [3] [4] | + +## Title-Complete Linguist Inventory + +The authenticated GitHub CLI could not be used because its configured credential returned an authentication error. Collection therefore used the public GitHub read API for title discovery and pull-request metadata, plus the repository’s current local graph index. The title search returned **seven pull requests and no issues** whose title contains `Linguist`; it is the all-state collection bound for this packet. [1] + +| PR | State at collection | Changed files | Relationship classification | Review disposition | +|---:|---|---:|---|---| +| [#126](https://github.com/timerloggedout-spec/termux-monorepo/pull/126) | Closed, not merged | 9 | **Verified** predecessor; graph records a `MENTIONS` edge to issue #117. | Treat as the earliest A2A/compression design reference only. | +| [#154](https://github.com/timerloggedout-spec/termux-monorepo/pull/154) | Open | 165 | **Verified** predecessor through exact owner reference, common reviewed files, and graph evidence. | Do not revive the dirty stack; reconstruct unique safe value only. | +| [#177](https://github.com/timerloggedout-spec/termux-monorepo/pull/177) | Open, dirty | 161 | **Verified** review root. | Do not amend; use this packet and successor foundation instead. | +| [#196](https://github.com/timerloggedout-spec/termux-monorepo/pull/196) | Merged | 5 | **Candidate** relation through shared translator/history. | Retain its narrow compilation improvements as optional regression context. | +| [#208](https://github.com/timerloggedout-spec/termux-monorepo/pull/208) | Merged | 3 | **Candidate** relation through shared translator/history. | Retain as optimization history, not a protocol design source. | +| [#218](https://github.com/timerloggedout-spec/termux-monorepo/pull/218) | Merged | 2 | **Candidate** relation through shared translator/history. | Retain as optimization history, not a protocol design source. | +| [#228](https://github.com/timerloggedout-spec/termux-monorepo/pull/228) | Merged | 2 | **Candidate** relation through shared translator/history. | Retain as optimization history, not a protocol design source. | + +## Context Relationship Graph + +The generated graph used the exact root `pr:177`, depth `2`, and a 25-node limit. It contains verified commit, review, review-comment, issue-comment, and source-file relationships. The canonical index is current to 2026-08-19 but has a retained **partial** GitHub history window with `next_start_page: 2`; this packet therefore does not claim complete historical graph coverage. [5] [6] + +![Curated Linguist relationship summary](linguist-relationship-summary.png) + +The Mermaid source for both the generated raw graph and the concise evidence summary is committed under this directory. The PNG render artifacts remain intentionally ignored by the repository and are supplied as task attachments. The raw graph, rendering validation, evidence bounds, and candidate separation are documented in `context-pr177.md`, `context-pr177.mmd`, `linguist-relationship-summary.mmd`, and `diagram-validation.md`. + +| Verified relationship | Evidence | +|---|---| +| PR #126 `MENTIONS` issue #117, *Agent2Agent Comms Proposal*. | Generated exact-root query [`context-pr126.md`](context-pr126.md); [#126](https://github.com/timerloggedout-spec/termux-monorepo/pull/126); [#117](https://github.com/timerloggedout-spec/termux-monorepo/issues/117). | +| PR #154 and PR #177 have verified review/file relationships to `workspace/compression_sandbox/cedrlang/cedrlang.py` and agent instruction surfaces. | Generated exact-root queries [`context-pr154.md`](context-pr154.md) and [`context-pr177.md`](context-pr177.md). | +| Exact owner comment on #177 references #126 and #154. | [Exact permalink](https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5273315069). The comment body is intentionally not copied into this packet. | +| Historical CEDARscript is an execution-capable code-transformation system, distinct from document encoding. | [CEDARScript organization](https://github.com/CEDARScript); [CEDARScript Editor](https://github.com/CEDARScript/cedarscript-editor-python). | + +## Design Findings + +| ID | Severity | Finding | Evidence-backed conclusion | +|---|---|---|---| +| L-01 | **Blocking** | The public codec does not implement an authorized private mapper. | `cedrlang.py` uses in-repository regex/dictionary substitutions; tracked `.cedar` and Grimoire files are not an access-controlled mapper. The implementation must not claim private lossless reconstruction until an approved external custody interface exists. [7] | +| L-02 | **Blocking** | Literal one-way/lossy representation conflicts with perfect reconstruction. | Perfect reconstruction requires a defined canonical form, versioned bijection, authorized mapper, and integrity check. The clean foundation encodes this distinction instead of treating obfuscation as a security primitive. [3] | +| L-03 | **Blocking** | `cid.py` scope is CEDARscript command-pointer registration, not generic CEDRlang decoding. | It writes home-directory command pointers and enumerates code-editing operations; local patch routing can execute CEDARscript, `sed`, or generated Python. CEDRlang must not call this surface. [7] [8] | +| L-04 | **Required** | Existing tests prove selected formatting round trips but not mapper collision safety, 70% measurement, canonical digest, version handling, or A2A behavior. | New tests cover each omitted control while retaining the historical 11-test translation suite. [9] | +| L-05 | **Required** | No local A2A contract existed. | Issue #117 is a verified related proposal, but its historical workflow example includes remote installation/external service behavior. The successor implements local-only envelope validation without that side effect. [10] | +| L-06 | **Required** | Instruction surfaces lack a reproducible canonical/projection policy. | `AGENTS.md`, `AGENTS.hum.md`, and `CLAUDE.md` must remain readable until a later approved migration defines source ownership and drift checks. Existing root/ICM branch guidance also needs separate governance reconciliation. [11] | + +## Successor Implementation + +The new work is registered as proposal `cedrlang-grimoire-a2a` and its first work item, `LGA-01`. The proposal remains **draft** pending required non-author review and formal acceptance; the feature branch is a Tier-0 implementation/research artifact, not a merge request or an institutional acceptance claim. + +| Delivered component | What it does | What it deliberately does not do | +|---|---|---| +| `protocol.py` | Canonical record normalization, deterministic serialization, SHA-256 digest, mapper collision validation, segment-safe encode/decode, coverage report, A2A envelope/TTL/state/replay validation. | No filesystem writes, subprocesses, network, external service, CID, CEDARscript, or patch routing. | +| `test_cedrlang_protocol.py` | Six focused tests for deterministic round trips, collisions, literal handles, coverage enforcement, tamper failure, A2A TTL/state/replay behavior. | No real/private mapper test data. | +| `CEDRLANG-GRIMOIRE-A2A.md` | Public specification of canonical source, mapper boundary, 70% coverage definition, local A2A schema, and CEDARscript separation. | No private mapper custody instructions or operational automation. | +| Proposal and review evidence | Item ledger, decision record, source inventory, graph outputs, external-boundary record, and review packet. | No PR comment, approval, merge, external workflow, secret, or repository configuration write. | + +## Validation Evidence + +| Validation | Result | Notes | +|---|---|---| +| `python3 -m pytest tests/test_cedrlang.py tests/test_cedrlang_protocol.py -q` | **Pass: 17 tests** | 11 historical translator tests plus 6 new foundation tests passed. | +| `python3 -m compileall -q workspace/compression_sandbox/cedrlang/protocol.py tests/test_cedrlang_protocol.py` | **Pass** | New implementation and tests compile. | +| `ruff check --select F,E9 …` | **Pass** | Compatibility-focused linting is clean. The repository’s global Ruff defaults suggest modern typing rewrites that are not adopted because the documented Python floor is 3.9. | +| Dependency boundary scan | **Pass** | No execution, network, CID, or CEDARscript import/invocation pattern exists in `protocol.py`. | +| Scoped credential-signature scan | **Pass** | No credential signatures or private mapper contents were found in new implementation/docs/evidence files. | +| `git diff --cached --check` | **Pass** | No staged whitespace error remains. | +| `python3 scripts/ci/termux_smoke.py` | **Pass** | Smoke gate passed on Linux with Python 3.12.3; Termux-specific checks were reported as non-blocking environment notes. | +| `python3 scripts/ci/repo_gate.py` | **Blocked by inherited failure** | Fails on pre-existing `archwiz/linear_sync.py:237` syntax, outside the scoped diff. The gate compares to `origin/master`, so it also sees inherited `master-staging` divergence. | +| `python3 scripts/proposals/validate_registry.py` | **Blocked by inherited failure** | Full YAML validation reports existing orphan active directories: `actions-refinements`, `icm-architect-integration`, and `kimi-cloud-offload`; none are part of the staged change. | + +## Unposted Draft Review for PR #177 + +> **Status: 🔴 NO-GO for the current stack.** The PR is dirty and contains a broad 161-file scope that mixes the Linguist codec with unrelated workflows, dependencies, ICM, and runtime material. The current public regex mapping, tracked pointer index, and Grimoire dictionaries do not constitute a private authorized mapper, and the diff does not establish the requested 70% metric, canonical digest, mapper version/collision policy, or A2A envelope contract. Do not force-merge or rebase this stack to regain mergeability. Preserve only isolated, tested translator improvements through the successor proposal `cedrlang-grimoire-a2a` (`LGA-01`), which adds a deterministic non-executing codec and local A2A validator while keeping CEDARscript/CID execution separate. Repository integration remains conditional on a non-author proposal review, accepted status, and resolution or explicit baseline disposition for the current gate/registry blockers. [2] [3] [7] + +This text is a draft only. It has not been posted to GitHub. + +## Required Next Decisions + +The next safe step is a non-author review of proposal `cedrlang-grimoire-a2a`. If accepted, it can be advanced through the ordinary feature-branch gate process. A later separate proposal must choose an approved private-mapper custody service, define access/rotation/audit behavior, and decide whether any canonical agent document should generate a machine projection. No migration of `AGENTS.md`, `CLAUDE.md`, ICM files, README, CID, CEDARscript, or workflows should proceed from this review alone. + +## References + +1. [GitHub title search and public PR metadata for `Linguist`](https://api.github.com/search/issues?q=repo%3Atimerloggedout-spec%2Ftermux-monorepo%20in%3Atitle%20Linguist&per_page=100) +2. [PR #177](https://github.com/timerloggedout-spec/termux-monorepo/pull/177) +3. [CEDRlang / Grimoire / A2A decision record](../../proposals/active/cedrlang-grimoire-a2a/source.md) +4. [CEDRlang / Grimoire / A2A public contract](../../CEDRLANG-GRIMOIRE-A2A.md) +5. [PR #177 exact context graph query](context-pr177.md) +6. [Context relationship index manifest](../../../workspace/llm_map/context_relationships/manifest.json) +7. [Agent-contact inventory and drift assessment](agent-contact-inventory.md) +8. [External CEDARScript boundary](external-cedarscript-boundary.md) +9. [Existing CedrLang tests](../../../tests/test_cedrlang.py) and [new protocol tests](../../../tests/test_cedrlang_protocol.py) +10. [Issue #117 — Agent2Agent Comms Proposal](https://github.com/timerloggedout-spec/termux-monorepo/issues/117) +11. [Root AGENTS.md](../../../AGENTS.md), [root CLAUDE.md](../../../CLAUDE.md), and [ICM change process](../../icm/processes/change-and-validate.md) diff --git a/docs/reviews/linguist-177/agent-contact-inventory.md b/docs/reviews/linguist-177/agent-contact-inventory.md new file mode 100644 index 000000000..aacdc5e0d --- /dev/null +++ b/docs/reviews/linguist-177/agent-contact-inventory.md @@ -0,0 +1,59 @@ +# Linguist Agent-Contact Inventory and Drift Assessment + +**Collected:** 2026-08-20 UTC + +**Repository revision inspected:** `933d65d0e2c49e28079f300f5a516932330c60e7` + +**Collection boundary:** tracked repository files, with the context-relationship scope exclusions applied. Session archives, browser/device state, secrets, generated relationship-index internals, vendor material, and runtime workspaces are not agent-contact inputs for this review. + +## Canonical and Projected Instruction Surfaces + +The root `AGENTS.md` is the controlling instruction surface. It requires proposal registration, bounded relationship reconnaissance, an `Implements:` work-item reference, and the repository gate pair before integration. `CLAUDE.md` is a short delegating projection that directs Claude-compatible agents back to `AGENTS.md`. The root `AGENTS.hum.md` is a tracked human companion, but it is not a generated CEDRlang projection: it largely mirrors the readable root content and has already drifted on at least the integration-branch guidance. + +| Surface | Current role | Compression eligibility | Finding | +|---|---|---|---| +| `AGENTS.md` | Root governance and technical instructions; authoritative for agents. | **Not eligible for lossy/public-only replacement.** A future machine projection must be generated from a readable canonical record and retain mandatory governance text. | Current root policy requires `master`, while the change process specifies `master-staging`; this must be reconciled before any generation work. | +| `AGENTS.hum.md` | Tracked human-readable companion. | **Candidate canonical source after a decision record.** | It duplicates the root surface rather than proving a reproducible source/projection pipeline. | +| `CLAUDE.md` | Claude-specific routing shim to `AGENTS.md`. | **Low-value projection.** Keep plain and short; do not compress it independently. | Its content is intentionally referential, so a generated compressed variant would add little value and risks a stale pointer. | +| `docs/icm/AGENTS.md` and `docs/icm/CLAUDE.md` | Parallel ICM system-map entry points. | **Not in the initial codec migration.** | These files are navigation artifacts and must remain directly readable; their actual sources are the cited ICM cards and governing documents. | +| `docs/icm/maintenance/{AGENTS,CLAUDE}.md` | Human-gated documentation-maintenance guidance. | **Excluded.** | The ICM map itself says maintenance requires a human gate. | +| `README.md` | Public, human-facing recovery and inventory documentation. | **Presentation-only.** | L337 styling may be editorial, but the file cannot conceal behavior, safety constraints, credentials, or materially operational instructions. | + +## Runtime, Codec, Pointer, and Dictionary Surfaces + +The current implementation contains three distinct systems that have been conflated by the Linguist PR family. The first is the CedrLang regex translator, the second is CID-backed CEDARscript command pointers, and the third is a public Grimoire presentation lexicon. They need separate ownership, APIs, tests, and security claims. + +| Surface | Actual responsibility found | Required disposition | +|---|---|---| +| `workspace/compression_sandbox/cedrlang/cedrlang.py` | Regex-based prose/document translator with symbolic and Grimoire substitution tables, formatting placeholders, rough token statistics, a CLI, and no mapper custody, CIR, A2A schema, digest, version negotiation, or 70% coverage gate. | **Refactor target.** Rename/document it as a non-executing CEDRlang codec; retain only deterministic public test mappings in the repository. | +| `tests/test_cedrlang.py` | Validates selected round trips and Markdown protection. | **Expand.** Add collision, malformed input, canonical-digest, mapper-version, coverage denominator, A2A, and contact-surface fixtures. | +| `bin/cedrlang` | Public launcher that directly invokes the current codec script. | **Compatibility surface.** Preserve as a thin stable entry point or add a documented adapter during a package migration. | +| `workspace/compression_sandbox/cedrlang/cid.py` | `CedarIndex` registry that writes short pointers for CEDARscript commands to `~/.cedar/cedar_index.json`; it registers and expands an edit-command catalog. | **Separate from CEDRlang.** Do not rename or absorb it into a document codec. It needs its own review because it is a command-pointer registry, not a CEDRlang private mapper. | +| `.cedar/cedar_index.json` | Tracked mapping file cited in Linguist discussions. | **Not private.** It must not be treated as the internal/private mapping needed for lossless CEDRlang document reconstruction. No contents were recorded in this review. | +| `harmony_hub/config/GRIMOIRE_DICTIONARY.md` and `harmony_hub/config/grimoire/1337_D1CT10N4RY.md` | Tracked public style and vocabulary references; the former also embeds pointer examples. | **Public presentation lexicon only.** Split pointer examples from diction terms in a later scoped cleanup; neither document qualifies as a protected mapper. | +| `harmony_hub/workspace/agent/LINGUIST_SPEC.md` | Current role definition assigns both CedrLang translation and CID pointer registry responsibilities to Linguist. | **Drift source.** Replace its mixed mandate with separate non-executing codec/A2A and CEDARscript-pointer responsibilities after the proposal is accepted. | +| `harmony_hub/src/patch_router.py` | Execution-capable route that can invoke CEDARscript, `sed`, or generated Python. | **Hard boundary.** It must never be reachable from CEDRlang compile/decompile or from an A2A envelope validator. | + +## Verified Drift and Blocking Findings + +| ID | Classification | Finding | Evidence | +|---|---|---|---| +| D-01 | Blocking design conflict | A public/one-way or lossy transform cannot, by itself, satisfy a perfect reconstruction claim. The current CedrLang `compile_doc` and `decompile_doc` use public in-repository regex maps, not an access-controlled mapper. | `cedrlang.py` lines 74–148 and 241–362; PR [#177](https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5273315069). | +| D-02 | Blocking security-boundary conflict | The cited `.cedar/cedar_index.json` and Grimoire dictionaries are tracked in the repository. They cannot be represented as an internal/private mapping or as an obfuscation security boundary. | `git ls-files --stage` metadata; PR [#177](https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5273357771). | +| D-03 | Blocking scope mix | CID maps CEDARscript editing commands and persists them under a user home directory; CEDRlang translates documents. Combining these responsibilities risks treating a code-editing surface as a passive communication codec. | `cid.py` lines 3–62 and 64–111; `LINGUIST_SPEC.md` lines 3–18; [CEDARScript Editor (Python)](https://github.com/CEDARScript/cedarscript-editor-python). | +| D-04 | Required correctness work | The source does not calculate the defined eligible-token substitution coverage, enforce a 70% threshold, attach a mapper version, canonicalize a CIR, or verify a digest. Existing tests cover only selected textual round trips. | `cedrlang.py` lines 328–384; `test_cedrlang.py` lines 10–149. | +| D-05 | Required protocol work | No local CEDRlang A2A envelope/schema/ACK/NACK/idempotency implementation exists. A historical Agent Mail action used an unaudited remote installation pipe and background service pattern, which is outside the initial deterministic local A2A scope. | Issue [#117](https://github.com/timerloggedout-spec/termux-monorepo/issues/117); PR [#143 files](https://github.com/timerloggedout-spec/termux-monorepo/pull/143/files). | +| D-06 | Required governance reconciliation | Root `AGENTS.md` says target `master`; the ICM change process and status board say tracked code changes target `master-staging`. | `AGENTS.md` lines 22–30; `docs/icm/processes/change-and-validate.md` lines 16–34; `docs/ARCHW1Z-STATUS.md` lines 38–45. | +| D-07 | Review disposition | PR #154 is currently open, large, and marked dirty; its latest operator guidance says to reconstruct only unique value in a small rebased hygiene-passed change. PR #177 is also open, dirty, and contains unrelated bulk changes. | PR [#154](https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5322143674); PR [#177](https://github.com/timerloggedout-spec/termux-monorepo/pull/177). | + +The initial implementation scope is therefore limited to a clean, non-executing CEDRlang foundation: canonical record/schema, deterministic codec, synthetic test mapper, coverage/digest validation, and local A2A envelope validation. It excludes CEDARscript execution, CID registry changes, external workflow installation, public obfuscated posting, and broad rewrites of the root instruction documents. + +## References + +1. [Root AGENTS.md](../../AGENTS.md) +2. [Root CLAUDE.md](../../CLAUDE.md) +3. [Change and Validate ICM process](../../docs/icm/processes/change-and-validate.md) +4. [PR #154 operator scope guidance](https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5322143674) +5. [PR #177 mapping discussion](https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5273315069) +6. [CEDARScript Editor (Python)](https://github.com/CEDARScript/cedarscript-editor-python) +7. [Agent2Agent Comms Proposal, issue #117](https://github.com/timerloggedout-spec/termux-monorepo/issues/117) diff --git a/docs/reviews/linguist-177/context-issue117.md b/docs/reviews/linguist-177/context-issue117.md new file mode 100644 index 000000000..7189c240a --- /dev/null +++ b/docs/reviews/linguist-177/context-issue117.md @@ -0,0 +1,35 @@ +# Context relationship query: `issue:117` + +## Roots + +| Kind | Match | Score | Reason | +|---|---|---:|---| +| issue | `Agent2Agent Comms Proposal` | 1.00 | exact selector | + +## Verified timeline + +| Time | Relationship | Source | Target | Evidence | +|---|---|---|---|---| +| 2026-08-09T17:25:51Z | COMMENTS_ON | `5232779728` | `Agent2Agent Comms Proposal` | https://github.com/timerloggedout-spec/termux-monorepo/issues/117#issuecomment-5232779728 | +| 2026-08-09T17:26:22Z | COMMENTS_ON | `5232781741` | `Agent2Agent Comms Proposal` | https://github.com/timerloggedout-spec/termux-monorepo/issues/117#issuecomment-5232781741 | +| 2026-08-09T21:38:59Z | COMMENTS_ON | `5233974650` | `Agent2Agent Comms Proposal` | https://github.com/timerloggedout-spec/termux-monorepo/issues/117#issuecomment-5233974650 | +| 2026-08-09T21:49:32Z | COMMENTS_ON | `5234016097` | `Agent2Agent Comms Proposal` | https://github.com/timerloggedout-spec/termux-monorepo/issues/117#issuecomment-5234016097 | +| 2026-08-10T00:14:27Z | MENTIONS | `📖 Linguist: optimize agentic communication compiler` | `Agent2Agent Comms Proposal` | https://github.com/timerloggedout-spec/termux-monorepo/issues/117 | +| 2026-08-10T15:24:48Z | MENTIONS | `Integrate MCP Agent Mail Coordination Layer in GitHub Actions` | `Agent2Agent Comms Proposal` | https://github.com/timerloggedout-spec/termux-monorepo/issues/117 | +| 2026-08-10T15:24:49Z | COMMENTS_ON | `5242322307` | `Agent2Agent Comms Proposal` | https://github.com/timerloggedout-spec/termux-monorepo/issues/117#issuecomment-5242322307 | +| 2026-08-15T22:34:55Z | REFERENCES | `docs/ops/LANE_CONSOLIDATION_SSOT.md` | `Agent2Agent Comms Proposal` | https://github.com/timerloggedout-spec/termux-monorepo/pull/222#discussion_r3790410359 | +| 2026-08-16T18:54:14Z | COMMENTS_ON | `5309114530` | `Agent2Agent Comms Proposal` | https://github.com/timerloggedout-spec/termux-monorepo/issues/117#issuecomment-5309114530 | +| 2026-08-17T21:04:38Z | MENTIONS | `ops: OPERATOR priority matrix + master functional gate (2026-08-11)` | `Agent2Agent Comms Proposal` | https://github.com/timerloggedout-spec/termux-monorepo/issues/117 | +| 2026-08-18T10:54:47Z | COMMENTS_ON | `5327174282` | `Agent2Agent Comms Proposal` | https://github.com/timerloggedout-spec/termux-monorepo/issues/117#issuecomment-5327174282 | +| 2026-08-18T21:45:13Z | COMMENTS_ON | `5334441705` | `Agent2Agent Comms Proposal` | https://github.com/timerloggedout-spec/termux-monorepo/issues/117#issuecomment-5334441705 | +| 2026-08-18T21:45:13Z | LABELED_AS | `Agent2Agent Comms Proposal` | `help wanted` | https://github.com/timerloggedout-spec/termux-monorepo/issues/117 | +| 2026-08-18T21:45:13Z | LABELED_AS | `Agent2Agent Comms Proposal` | `enhancement` | https://github.com/timerloggedout-spec/termux-monorepo/issues/117 | +| 2026-08-18T21:45:13Z | LABELED_AS | `Agent2Agent Comms Proposal` | `priority` | https://github.com/timerloggedout-spec/termux-monorepo/issues/117 | +| 2026-08-18T21:45:13Z | LABELED_AS | `Agent2Agent Comms Proposal` | `jules` | https://github.com/timerloggedout-spec/termux-monorepo/issues/117 | +| 2026-08-18T21:45:13Z | LABELED_AS | `Agent2Agent Comms Proposal` | `production` | https://github.com/timerloggedout-spec/termux-monorepo/issues/117 | +| 2026-08-19T04:21:38Z | CLOSES | `Integrate MCP Agent Mail Coordination Layer in GitHub Actions` | `Agent2Agent Comms Proposal` | https://github.com/timerloggedout-spec/termux-monorepo/pull/143 | + +## Ranked candidates + +| Score | Relationship | Source | Target | Evidence | +|---:|---|---|---|---| diff --git a/docs/reviews/linguist-177/context-pr126.md b/docs/reviews/linguist-177/context-pr126.md new file mode 100644 index 000000000..cf2814940 --- /dev/null +++ b/docs/reviews/linguist-177/context-pr126.md @@ -0,0 +1,29 @@ +# Context relationship query: `pr:126` + +## Roots + +| Kind | Match | Score | Reason | +|---|---|---:|---| +| pull_request | `📖 Linguist: optimize agentic communication compiler` | 1.00 | exact selector | + +## Verified timeline + +| Time | Relationship | Source | Target | Evidence | +|---|---|---|---|---| +| 2026-08-10T00:14:27Z | MENTIONS | `📖 Linguist: optimize agentic communication compiler` | `Agent2Agent Comms Proposal` | https://github.com/timerloggedout-spec/termux-monorepo/issues/117 | +| 2026-08-10T16:33:42Z | REFERENCES | `5243092868` | `📖 Linguist: optimize agentic communication compiler` | https://github.com/timerloggedout-spec/termux-monorepo/pull/143#issuecomment-5243092868 | +| 2026-08-10T17:23:24Z | COMMENTS_ON | `5243486486` | `📖 Linguist: optimize agentic communication compiler` | https://github.com/timerloggedout-spec/termux-monorepo/pull/126#issuecomment-5243486486 | +| 2026-08-10T17:23:24Z | REFERENCES | `5243625383` | `📖 Linguist: optimize agentic communication compiler` | https://github.com/timerloggedout-spec/termux-monorepo/issues/145#issuecomment-5243625383 | +| 2026-08-10T17:24:42Z | MENTIONS | `📖 Linguist: optimize agentic communication compiler` | `ops(jules): Programmatic session management via Actions Workflows — durable work-context keys, not ad-hoc @jules spawns` | https://github.com/timerloggedout-spec/termux-monorepo/issues/145 | +| 2026-08-10T17:24:49Z | REFERENCES | `5243639415` | `📖 Linguist: optimize agentic communication compiler` | https://github.com/timerloggedout-spec/termux-monorepo/issues/145#issuecomment-5243639415 | +| 2026-08-10T20:25:05Z | REFERENCES | `5245550465` | `📖 Linguist: optimize agentic communication compiler` | https://github.com/timerloggedout-spec/termux-monorepo/issues/124#issuecomment-5245550465 | +| 2026-08-10T23:55:51Z | REFERENCES | `5247390413` | `📖 Linguist: optimize agentic communication compiler` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247390413 | +| 2026-08-10T23:59:35Z | REFERENCES | `5247414009` | `📖 Linguist: optimize agentic communication compiler` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247414009 | +| 2026-08-13T21:34:04Z | REFERENCES | `5286645532` | `📖 Linguist: optimize agentic communication compiler` | https://github.com/timerloggedout-spec/termux-monorepo/issues/164#issuecomment-5286645532 | +| 2026-08-14T19:23:16Z | REFERENCES | `termux-multi-agent/src/team_manager.py` | `📖 Linguist: optimize agentic communication compiler` | https://github.com/timerloggedout-spec/termux-monorepo/pull/131#discussion_r3746547011 | +| 2026-08-16T00:08:37Z | REFERENCES | `ops(jules): context_key persistence + continue-only auto-jules (#145)` | `📖 Linguist: optimize agentic communication compiler` | https://github.com/timerloggedout-spec/termux-monorepo/pull/148 | + +## Ranked candidates + +| Score | Relationship | Source | Target | Evidence | +|---:|---|---|---|---| diff --git a/docs/reviews/linguist-177/context-pr154.md b/docs/reviews/linguist-177/context-pr154.md new file mode 100644 index 000000000..ce4454b98 --- /dev/null +++ b/docs/reviews/linguist-177/context-pr154.md @@ -0,0 +1,72 @@ +# Context relationship query: `pr:154` + +## Roots + +| Kind | Match | Score | Reason | +|---|---|---:|---| +| pull_request | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | 1.00 | exact selector | + +## Verified timeline + +| Time | Relationship | Source | Target | Evidence | +|---|---|---|---|---| +| 2026-08-10T23:40:52Z | HAS_COMMIT | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | `1dc2f19fed70c226c677becc2e066af9b73d2501` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154 | +| 2026-08-10T23:40:59Z | COMMENTS_ON | `5247286199` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247286199 | +| 2026-08-10T23:41:00Z | COMMENTS_ON | `5247286353` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247286353 | +| 2026-08-10T23:44:17Z | COMMENTS_ON | `workspace/compression_sandbox/cedrlang/cedrlang.py` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#discussion_r3754263387 | +| 2026-08-10T23:44:17Z | COMMENTS_ON | `workspace/compression_sandbox/cedrlang/cedrlang.py` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#discussion_r3754263042 | +| 2026-08-10T23:44:17Z | COMMENTS_ON | `bin/cedrlang` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#discussion_r3754262283 | +| 2026-08-10T23:44:17Z | COMMENTS_ON | `workspace/compression_sandbox/cedrlang/cedrlang.py` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#discussion_r3754262463 | +| 2026-08-10T23:44:17Z | REVIEWS | `4901837682` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#pullrequestreview-4901837682
https://github.com/timerloggedout-spec/termux-monorepo/pull/154#pullrequestreview-4901837682 | +| 2026-08-10T23:44:25Z | COMMENTS_ON | `5247317455` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247317455 | +| 2026-08-10T23:44:25Z | REFERENCES | `5247317455` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247317455 | +| 2026-08-10T23:44:43Z | COMMENTS_ON | `5247319394` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247319394 | +| 2026-08-10T23:45:05Z | COMMENTS_ON | `5247321731` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247321731 | +| 2026-08-10T23:55:51Z | COMMENTS_ON | `5247390413` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247390413 | +| 2026-08-10T23:55:51Z | REFERENCES | `5247390413` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247390413 | +| 2026-08-10T23:59:35Z | COMMENTS_ON | `5247414009` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247414009 | +| 2026-08-10T23:59:35Z | REFERENCES | `5247414009` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247414009 | +| 2026-08-11T00:00:21Z | HAS_COMMIT | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | `0b873d7f9c086f991c85ac6dedd5766ce7ffd23d` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154 | +| 2026-08-11T00:03:51Z | REVIEWS | `4901928947` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#pullrequestreview-4901928947 | +| 2026-08-11T00:03:52Z | COMMENTS_ON | `bin/cedrlang` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#discussion_r3754344929 | +| 2026-08-11T00:03:58Z | COMMENTS_ON | `workspace/compression_sandbox/cedrlang/cedrlang.py` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#discussion_r3754345218
https://github.com/timerloggedout-spec/termux-monorepo/pull/154#discussion_r3754345218 | +| 2026-08-11T00:03:58Z | REVIEWS | `4901929123` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#pullrequestreview-4901929123 | +| 2026-08-11T00:04:16Z | COMMENTS_ON | `5247446899` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247446899 | +| 2026-08-11T00:05:30Z | COMMENTS_ON | `5247455192` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247455192 | +| 2026-08-11T00:05:30Z | REFERENCES | `5247455192` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247455192 | +| 2026-08-11T00:06:42Z | COMMENTS_ON | `AGENTS.md` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#discussion_r3754355057 | +| 2026-08-11T00:06:42Z | REVIEWS | `4901939945` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#pullrequestreview-4901939945 | +| 2026-08-11T00:07:41Z | COMMENTS_ON | `AGENTS.md` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#discussion_r3754358448 | +| 2026-08-11T00:07:41Z | REVIEWS | `4901943530` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#pullrequestreview-4901943530 | +| 2026-08-11T00:07:48Z | COMMENTS_ON | `5247470706` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247470706
https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247470706 | +| 2026-08-11T00:07:48Z | REFERENCES | `5247470706` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247470706 | +| 2026-08-11T00:15:43Z | COMMENTS_ON | `workspace/compression_sandbox/cedrlang/cedrlang.py` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#discussion_r3754345293
https://github.com/timerloggedout-spec/termux-monorepo/pull/154#discussion_r3754345293 | +| 2026-08-11T00:15:43Z | COMMENTS_ON | `5247524291` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247524291
https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247524291 | +| 2026-08-11T00:17:52Z | COMMENTS_ON | `5247517299` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247517299
https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247517299 | +| 2026-08-11T01:25:22Z | HAS_COMMIT | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | `6226af7eb68aaa0aeec01320c582549c17cc33c9` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154 | +| 2026-08-11T01:25:28Z | COMMENTS_ON | `5247979440` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247979440 | +| 2026-08-11T01:29:01Z | COMMENTS_ON | `workspace/compression_sandbox/cedrlang/cedrlang.py` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#discussion_r3754652900 | +| 2026-08-11T01:29:01Z | REVIEWS | `4902285966` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#pullrequestreview-4902285966 | +| 2026-08-11T01:29:03Z | COMMENTS_ON | `workspace/compression_sandbox/cedrlang/cedrlang.py` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#discussion_r3754653061 | +| 2026-08-11T01:29:03Z | REVIEWS | `4902286114` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#pullrequestreview-4902286114 | +| 2026-08-11T01:29:05Z | COMMENTS_ON | `workspace/compression_sandbox/cedrlang/cedrlang.py` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#discussion_r3754653185 | +| 2026-08-11T01:29:05Z | REVIEWS | `4902286208` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#pullrequestreview-4902286208 | +| 2026-08-11T01:29:08Z | REVIEWS | `4902286351` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#pullrequestreview-4902286351 | +| 2026-08-11T01:29:09Z | COMMENTS_ON | `5247999080` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247999080 | +| 2026-08-11T01:29:09Z | REFERENCES | `5247999080` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247999080 | +| 2026-08-11T01:29:10Z | REVIEWS | `4902286473` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#pullrequestreview-4902286473 | +| 2026-08-11T01:29:13Z | COMMENTS_ON | `workspace/compression_sandbox/cedrlang/cedrlang.py` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#discussion_r3754262554 | +| 2026-08-11T01:29:14Z | COMMENTS_ON | `workspace/compression_sandbox/cedrlang/cedrlang.py` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#discussion_r3754262825 | +| 2026-08-11T01:29:15Z | COMMENTS_ON | `AGENTS.md` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#discussion_r3754345139 | +| 2026-08-11T01:29:16Z | COMMENTS_ON | `workspace/compression_sandbox/cedrlang/cedrlang.py` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#discussion_r3754263158 | +| 2026-08-11T01:29:24Z | COMMENTS_ON | `5248000274` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5248000274 | +| 2026-08-11T01:29:24Z | REVIEWS | `4902287009` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#pullrequestreview-4902287009
https://github.com/timerloggedout-spec/termux-monorepo/pull/154#pullrequestreview-4902287009 | +| 2026-08-11T01:31:15Z | COMMENTS_ON | `5248010022` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5248010022 | +| 2026-08-11T01:45:24Z | REVIEWS | `4902340423` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#pullrequestreview-4902340423 | +| 2026-08-11T01:48:11Z | COMMENTS_ON | `5248101538` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5248101538
https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5248101538 | +| 2026-08-11T01:49:26Z | REVIEWS | `4902354577` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#pullrequestreview-4902354577 | + +## Ranked candidates + +| Score | Relationship | Source | Target | Evidence | +|---:|---|---|---|---| diff --git a/docs/reviews/linguist-177/context-pr177.md b/docs/reviews/linguist-177/context-pr177.md new file mode 100644 index 000000000..e4f0e8d2e --- /dev/null +++ b/docs/reviews/linguist-177/context-pr177.md @@ -0,0 +1,86 @@ +# Context relationship query: `pr:177` + +## Roots + +| Kind | Match | Score | Reason | +|---|---|---:|---| +| pull_request | `📖 Linguist: Optimize document token compression protocol` | 1.00 | exact selector | + +## Verified timeline + +| Time | Relationship | Source | Target | Evidence | +|---|---|---|---|---| +| 2026-08-11T23:21:09Z | HAS_COMMIT | `📖 Linguist: Optimize document token compression protocol` | `054d0d69d1841392c30c6d3bfd3ae3bd06f527a9` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177 | +| 2026-08-11T23:21:15Z | COMMENTS_ON | `5259989336` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5259989336 | +| 2026-08-11T23:21:16Z | COMMENTS_ON | `5259989521` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5259989521 | +| 2026-08-11T23:21:16Z | COMMENTS_ON | `5259989506` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5259989506 | +| 2026-08-11T23:25:30Z | COMMENTS_ON | `workspace/compression_sandbox/cedrlang/cedrlang.py` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#discussion_r3762452491 | +| 2026-08-11T23:25:30Z | COMMENTS_ON | `workspace/compression_sandbox/cedrlang/cedrlang.py` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#discussion_r3762452623 | +| 2026-08-11T23:25:30Z | COMMENTS_ON | `workspace/compression_sandbox/cedrlang/cedrlang.py` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#discussion_r3762452898 | +| 2026-08-11T23:25:30Z | COMMENTS_ON | `workspace/compression_sandbox/cedrlang/cedrlang.py` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#discussion_r3762452754 | +| 2026-08-11T23:25:30Z | COMMENTS_ON | `AGENTS.md` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#discussion_r3762452711 | +| 2026-08-11T23:25:30Z | COMMENTS_ON | `workspace/compression_sandbox/cedrlang/cedrlang.py` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#discussion_r3762452545 | +| 2026-08-11T23:25:30Z | REVIEWS | `4911603158` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#pullrequestreview-4911603158 | +| 2026-08-11T23:25:40Z | COMMENTS_ON | `5260021634` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5260021634 | +| 2026-08-11T23:25:40Z | REFERENCES | `5260021634` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5260021634 | +| 2026-08-11T23:26:03Z | COMMENTS_ON | `5260024423` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5260024423 | +| 2026-08-11T23:26:22Z | COMMENTS_ON | `5260026631` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5260026631 | +| 2026-08-11T23:39:24Z | REFERENCES | `5260130886` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/issues/175#issuecomment-5260130886 | +| 2026-08-12T00:02:41Z | COMMENTS_ON | `5260297633` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5260297633 | +| 2026-08-12T00:02:41Z | REFERENCES | `5260297633` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5260297633 | +| 2026-08-12T00:04:32Z | COMMENTS_ON | `5260309573` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5260309573 | +| 2026-08-12T00:04:32Z | REFERENCES | `5260309573` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5260309573 | +| 2026-08-12T00:05:10Z | HAS_COMMIT | `📖 Linguist: Optimize document token compression protocol` | `91fcc650125d14cfe5bdd3aa4da7abb596e31690` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177 | +| 2026-08-12T00:09:08Z | COMMENTS_ON | `.jules/Linguist.md` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#discussion_r3762648088 | +| 2026-08-12T00:09:08Z | REVIEWS | `4911831390` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#pullrequestreview-4911831390 | +| 2026-08-12T00:09:25Z | COMMENTS_ON | `5260342866` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5260342866 | +| 2026-08-12T00:09:25Z | REFERENCES | `5260342866` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5260342866 | +| 2026-08-12T00:09:40Z | COMMENTS_ON | `5260344456` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5260344456 | +| 2026-08-12T00:11:14Z | COMMENTS_ON | `5260356774` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5260356774 | +| 2026-08-12T00:11:14Z | REFERENCES | `5260356774` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5260356774 | +| 2026-08-12T02:48:36Z | COMMENTS_ON | `5261585787` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5261585787 | +| 2026-08-12T02:48:36Z | REFERENCES | `5261585787` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5261585787 | +| 2026-08-12T02:50:27Z | COMMENTS_ON | `5261600817` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5261600817 | +| 2026-08-12T02:50:27Z | REFERENCES | `5261600817` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5261600817 | +| 2026-08-12T02:51:11Z | HAS_COMMIT | `📖 Linguist: Optimize document token compression protocol` | `6e776adacbfc197a3480cedb7040f91f41773817` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177 | +| 2026-08-12T02:55:15Z | COMMENTS_ON | `tests/test_cedrlang.py` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#discussion_r3763263432 | +| 2026-08-12T02:55:15Z | REVIEWS | `4912596543` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#pullrequestreview-4912596543 | +| 2026-08-12T02:55:23Z | COMMENTS_ON | `5261644169` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5261644169 | +| 2026-08-12T02:55:23Z | REFERENCES | `5261644169` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5261644169 | +| 2026-08-12T02:55:33Z | COMMENTS_ON | `5261646084` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5261646084 | +| 2026-08-12T02:56:59Z | COMMENTS_ON | `5261659889` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5261659889 | +| 2026-08-12T04:02:44Z | REFERENCES | `5262127042` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/issues/175#issuecomment-5262127042 | +| 2026-08-12T05:08:50Z | COMMENTS_ON | `5262555279` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5262555279 | +| 2026-08-12T05:08:50Z | REFERENCES | `5262555279` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5262555279 | +| 2026-08-12T05:10:24Z | COMMENTS_ON | `5262564842` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5262564842 | +| 2026-08-12T05:10:24Z | REFERENCES | `5262564842` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5262564842 | +| 2026-08-12T05:11:01Z | HAS_COMMIT | `📖 Linguist: Optimize document token compression protocol` | `0c3f04cf350a66585f107ddbd28579d85f19d6f3` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177 | +| 2026-08-12T05:14:50Z | COMMENTS_ON | `tests/test_cedrlang.py` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#discussion_r3763771351 | +| 2026-08-12T05:14:50Z | REVIEWS | `4913226777` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#pullrequestreview-4913226777 | +| 2026-08-12T05:14:53Z | COMMENTS_ON | `5262612731` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5262612731 | +| 2026-08-12T06:48:33Z | HAS_COMMIT | `📖 Linguist: Optimize document token compression protocol` | `96a99a285c6d3f2d36b854dea9df979ea3b214a0` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177 | +| 2026-08-12T06:52:31Z | REVIEWS | `4913756462` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#pullrequestreview-4913756462 | +| 2026-08-12T08:44:55Z | HAS_COMMIT | `📖 Linguist: Optimize document token compression protocol` | `5263cae236d0176b323cdf1ff51aa8fa2e950025` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177 | +| 2026-08-12T08:48:45Z | COMMENTS_ON | `workspace/compression_sandbox/cedrlang/cedrlang.py` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#discussion_r3763263352 | +| 2026-08-12T08:48:49Z | REVIEWS | `4914667171` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#pullrequestreview-4914667171 | +| 2026-08-12T10:32:26Z | HAS_COMMIT | `📖 Linguist: Optimize document token compression protocol` | `9fe613f30f017150140a3d7fa617e3d02b795754` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177 | +| 2026-08-12T12:04:22Z | HAS_COMMIT | `📖 Linguist: Optimize document token compression protocol` | `d524d430f59d4bc717a81e92a615dc99141740b2` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177 | +| 2026-08-12T13:54:35Z | HAS_COMMIT | `📖 Linguist: Optimize document token compression protocol` | `b3db82143c44942d8caed4bd03fd4ebaedf61ec8` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177 | +| 2026-08-12T13:58:58Z | COMMENTS_ON | `workspace/compression_sandbox/cedrlang/cedrlang.py` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#discussion_r3767076627 | +| 2026-08-12T13:58:58Z | REVIEWS | `4917316838` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#pullrequestreview-4917316838 | +| 2026-08-12T15:21:06Z | HAS_COMMIT | `📖 Linguist: Optimize document token compression protocol` | `02680761b0232961b7ba6830031d85dd1cab2919` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177 | +| 2026-08-12T18:05:08Z | REFERENCES | `5270702030` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/issues/175#issuecomment-5270702030 | +| 2026-08-12T18:14:49Z | HAS_COMMIT | `📖 Linguist: Optimize document token compression protocol` | `528573654b999022e3325523c20f76bee693721d` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177 | +| 2026-08-12T18:20:22Z | REVIEWS | `4919805183` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#pullrequestreview-4919805183 | +| 2026-08-12T19:47:34Z | HAS_COMMIT | `📖 Linguist: Optimize document token compression protocol` | `196c7bd209ea976a18545421a74cf2de7826d1d8` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177 | +| 2026-08-12T19:52:54Z | REVIEWS | `4920579620` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#pullrequestreview-4920579620 | +| 2026-08-12T21:12:55Z | HAS_COMMIT | `📖 Linguist: Optimize document token compression protocol` | `6cb21bfde1d054749d5d659aee08969679fc1492` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177 | +| 2026-08-12T21:18:10Z | REVIEWS | `4921212031` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#pullrequestreview-4921212031 | +| 2026-08-12T21:18:16Z | REVIEWS | `4921212443` | `📖 Linguist: Optimize document token compression protocol` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177#pullrequestreview-4921212443 | +| 2026-08-12T22:10:33Z | HAS_COMMIT | `📖 Linguist: Optimize document token compression protocol` | `09520bc6d4cbd4e97416d0c25d0b239e5201d4c7` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177 | +| 2026-08-12T22:13:25Z | HAS_COMMIT | `📖 Linguist: Optimize document token compression protocol` | `35c0b222a75ead660ebf9c83f66bf38208cee50d` | https://github.com/timerloggedout-spec/termux-monorepo/pull/177 | + +## Ranked candidates + +| Score | Relationship | Source | Target | Evidence | +|---:|---|---|---|---| diff --git a/docs/reviews/linguist-177/context-pr177.mmd b/docs/reviews/linguist-177/context-pr177.mmd new file mode 100644 index 000000000..2cb55a7a7 --- /dev/null +++ b/docs/reviews/linguist-177/context-pr177.mmd @@ -0,0 +1,83 @@ +flowchart LR + n45ffdd5d23ae["review_comment: AGENTS.md"] + n9876f1426290["review: 4911603158"] + nfe04b6c16791["commit: 054d0d69d1841392c30c6d3bfd3ae3bd06f527a9"] + nec167d6efec6["issue_comment: 5260309573"] + n2f429372a37a["review: 4911831390"] + nca30aa9393ce["pull_request: 📖 Linguist: Optimize document token compression protocol"] + na64c9478c842["commit: 91fcc650125d14cfe5bdd3aa4da7abb596e31690"] + n093518b4af16["issue_comment: 5261585787"] + n9556a484f2fe["issue_comment: 5260021634"] + n1c354d94a607["issue_comment: 5260344456"] + ncc6e44856c30["review_comment: workspace/compression_sandbox/cedrlang/cedrlang.py"] + n2f1d68702fd1["review_comment: .jules/Linguist.md"] + n758892cba2cb["issue_comment: 5259989506"] + n947def300c18["issue_comment: 5260342866"] + nca6ea077f30b["issue_comment: 5259989336"] + n2b1a7b70cd1d["issue_comment: 5259989521"] + n6c1c830078f6["issue_comment: 5260024423"] + n9af32a84481c["review_comment: workspace/compression_sandbox/cedrlang/cedrlang.py"] + n4560da884da0["issue_comment: 5260356774"] + nc638c30bdb22["review_comment: workspace/compression_sandbox/cedrlang/cedrlang.py"] + n27b24ddabed3["issue_comment: 5260130886"] + n29321cf52503["review_comment: workspace/compression_sandbox/cedrlang/cedrlang.py"] + n839bd6b4e51c["issue_comment: 5260026631"] + n40efaa7fb854["issue_comment: 5260297633"] + nb890baa5e5e3["review_comment: workspace/compression_sandbox/cedrlang/cedrlang.py"] + nca30aa9393ce -->|HAS_COMMIT| nfe04b6c16791 + nca6ea077f30b -->|COMMENTS_ON| nca30aa9393ce + n2b1a7b70cd1d -->|COMMENTS_ON| nca30aa9393ce + n758892cba2cb -->|COMMENTS_ON| nca30aa9393ce + nb890baa5e5e3 -->|COMMENTS_ON| nca30aa9393ce + n9af32a84481c -->|COMMENTS_ON| nca30aa9393ce + n9876f1426290 -->|REVIEWS| nca30aa9393ce + n29321cf52503 -->|COMMENTS_ON| nca30aa9393ce + nc638c30bdb22 -->|COMMENTS_ON| nca30aa9393ce + n45ffdd5d23ae -->|COMMENTS_ON| nca30aa9393ce + ncc6e44856c30 -->|COMMENTS_ON| nca30aa9393ce + n9556a484f2fe -->|REFERENCES| nca30aa9393ce + n9556a484f2fe -->|COMMENTS_ON| nca30aa9393ce + n6c1c830078f6 -->|COMMENTS_ON| nca30aa9393ce + n839bd6b4e51c -->|COMMENTS_ON| nca30aa9393ce + n27b24ddabed3 -->|REFERENCES| nca30aa9393ce + n40efaa7fb854 -->|COMMENTS_ON| nca30aa9393ce + n40efaa7fb854 -->|REFERENCES| nca30aa9393ce + nec167d6efec6 -->|REFERENCES| nca30aa9393ce + nec167d6efec6 -->|COMMENTS_ON| nca30aa9393ce + nca30aa9393ce -->|HAS_COMMIT| na64c9478c842 + n2f1d68702fd1 -->|COMMENTS_ON| nca30aa9393ce + n2f429372a37a -->|REVIEWS| nca30aa9393ce + n947def300c18 -->|REFERENCES| nca30aa9393ce + n947def300c18 -->|COMMENTS_ON| nca30aa9393ce + n1c354d94a607 -->|COMMENTS_ON| nca30aa9393ce + n4560da884da0 -->|REFERENCES| nca30aa9393ce + n4560da884da0 -->|COMMENTS_ON| nca30aa9393ce + n093518b4af16 -->|REFERENCES| nca30aa9393ce + n093518b4af16 -->|COMMENTS_ON| nca30aa9393ce + classDef candidate stroke-dasharray: 5 5,fill:#fff7ed; + classDef verified fill:#eff6ff; + class n45ffdd5d23ae verified; + class n9876f1426290 verified; + class nfe04b6c16791 verified; + class nec167d6efec6 verified; + class n2f429372a37a verified; + class nca30aa9393ce verified; + class na64c9478c842 verified; + class n093518b4af16 verified; + class n9556a484f2fe verified; + class n1c354d94a607 verified; + class ncc6e44856c30 verified; + class n2f1d68702fd1 verified; + class n758892cba2cb verified; + class n947def300c18 verified; + class nca6ea077f30b verified; + class n2b1a7b70cd1d verified; + class n6c1c830078f6 verified; + class n9af32a84481c verified; + class n4560da884da0 verified; + class nc638c30bdb22 verified; + class n27b24ddabed3 verified; + class n29321cf52503 verified; + class n839bd6b4e51c verified; + class n40efaa7fb854 verified; + class nb890baa5e5e3 verified; diff --git a/docs/reviews/linguist-177/diagram-validation.md b/docs/reviews/linguist-177/diagram-validation.md new file mode 100644 index 000000000..365325179 --- /dev/null +++ b/docs/reviews/linguist-177/diagram-validation.md @@ -0,0 +1,12 @@ +# Context Diagram Validation + +**Validated:** 2026-08-20 UTC + +Both graph artifacts rendered successfully from Mermaid source. + +| Artifact | Bound | Validation finding | +|---|---|---| +| `context-pr177.png` | Exact graph query `pr:177`, depth 2, maximum 25 nodes | The raw bounded graph is readable and demonstrates the root’s verified commit, issue-comment, review, and file-review relationships. It is intentionally dense because it preserves metadata-level review history. | +| `linguist-relationship-summary.png` | Curated evidence summary | The high-level diagram is readable and distinguishes solid verified relationships from dashed candidate relationships. It shows PR #126’s verified link to issue #117, PR #154/#177’s verified file/review links, the exact owner-comment references from #177 to #126/#154, and the deliberately separate CID/CEDARscript candidate scope-mix boundary. | + +The summary diagram is an evidence presentation, not a replacement for the generated index. Its verified links cite the corresponding graph outputs and exact GitHub evidence in the final evidence register. diff --git a/docs/reviews/linguist-177/external-cedarscript-boundary.md b/docs/reviews/linguist-177/external-cedarscript-boundary.md new file mode 100644 index 000000000..d3cdb3d87 --- /dev/null +++ b/docs/reviews/linguist-177/external-cedarscript-boundary.md @@ -0,0 +1,22 @@ +# External CEDARScript Boundary + +**Collected:** 2026-08-20 UTC + +**Purpose:** Establish whether upstream CEDARScript is a document-compression/A2A protocol or a separate code-analysis and code-editing system. + +The public [CEDARScript organization](https://github.com/CEDARScript) describes its work as an SQL-like language for concise code manipulation and LLM understanding of codebases. Its public repositories include a grammar, an AST parser, an editor runtime, MCP exposure, and integrations. + +The public [CEDARScript Editor (Python)](https://github.com/CEDARScript/cedarscript-editor-python) describes itself as a runtime that interprets CEDARScript scripts and performs code-analysis and code-modification operations on a codebase. Its documented interface includes command parsing and file-modifying execution, with a distinct syntax-check-only mode. + +| Verified conclusion | Evidence | +|---|---| +| CEDARScript is a separate structured language for code analysis, code transformation, and refactoring intent. | [CEDARScript organization](https://github.com/CEDARScript) | +| The upstream editor runtime can execute code-modification operations and is therefore an execution-capable boundary. | [CEDARScript Editor (Python)](https://github.com/CEDARScript/cedarscript-editor-python) | +| CEDARScript must not be conflated with the repository’s non-executing CEDRlang document codec or A2A message schema. | The two upstream descriptions above, compared with the local `workspace/compression_sandbox/cedrlang/cedrlang.py` review. | + +The implementation recommendation is to retain any CEDARScript-related examples only as an explicitly non-executable parity/reference surface. It must not be called from CEDRlang encoding, decoding, agent-document generation, or A2A envelope handling. + +## References + +1. [CEDARScript organization on GitHub](https://github.com/CEDARScript) +2. [CEDARScript Editor (Python) on GitHub](https://github.com/CEDARScript/cedarscript-editor-python) diff --git a/docs/reviews/linguist-177/linguist-relationship-summary.mmd b/docs/reviews/linguist-177/linguist-relationship-summary.mmd new file mode 100644 index 000000000..19c7c5f30 --- /dev/null +++ b/docs/reviews/linguist-177/linguist-relationship-summary.mmd @@ -0,0 +1,35 @@ +flowchart LR + pr126["PR #126\nLinguist agentic communication compiler"] + pr154["PR #154\nCedrLang v2 / Grimoire / AGENTS.hum"] + pr177["PR #177\nDocument token compression protocol"] + issue117["Issue #117\nAgent2Agent Comms Proposal"] + cedr["cedrlang.py\npublic regex translator"] + agents["AGENTS.md / AGENTS.hum.md\nagent instruction surfaces"] + cid["cid.py / .cedar index\nCEDARscript command pointers"] + pr196["PR #196\nCedrLang v2 compilation"] + pr208["PR #208\ncompile optimization"] + pr218["PR #218\nsingle-pass regex"] + pr228["PR #228\nfast-path regex"] + foundation["Clean CEDRlang foundation\nCIR + mapper contract + local A2A validation"] + + pr126 -->|"verified MENTIONS\nissue #117"| issue117 + pr154 -->|"verified file/review evidence"| cedr + pr154 -->|"verified file/review evidence"| agents + pr177 -->|"verified file/review evidence"| cedr + pr177 -->|"verified file/review evidence"| agents + pr177 -->|"exact owner comment references\n#126 and #154"| pr126 + pr177 -->|"exact owner comment references\n#126 and #154"| pr154 + cid -. "candidate scope-mix;\nseparate execution/pointer system" .-> foundation + cedr -->|"reconstructed unique value"| foundation + issue117 -->|"local-only protocol boundary"| foundation + pr196 -. "candidate: same file/history" .-> cedr + pr208 -. "candidate: same file/history" .-> cedr + pr218 -. "candidate: same file/history" .-> cedr + pr228 -. "candidate: same file/history" .-> cedr + + classDef verified fill:#eff6ff,stroke:#2563eb,color:#111827; + classDef candidate fill:#fff7ed,stroke:#c2410c,stroke-dasharray: 5 5,color:#111827; + classDef target fill:#ecfdf5,stroke:#059669,color:#111827; + class pr126,pr154,pr177,issue117,cedr,agents verified; + class pr196,pr208,pr218,pr228,cid candidate; + class foundation target; diff --git a/tests/test_cedrlang_protocol.py b/tests/test_cedrlang_protocol.py new file mode 100644 index 000000000..d6aa15f63 --- /dev/null +++ b/tests/test_cedrlang_protocol.py @@ -0,0 +1,177 @@ +from copy import deepcopy +from datetime import datetime, timedelta, timezone +from uuid import uuid4 + +import pytest + +from workspace.compression_sandbox.cedrlang.protocol import ( + A2AEnvelope, + A2AValidationError, + CanonicalRecord, + CoverageError, + GrimoireMapper, + IntegrityError, + MapperValidationError, + classify_replay, + decode_record, + encode_record, + validate_a2a_envelope, +) + + +def build_mapper() -> GrimoireMapper: + return GrimoireMapper( + mapper_id="test-grimoire", + version="1.0.0", + forward={ + "inspect": "§I§", + "system": "§S§", + "status": "§T§", + "agent": "§A§", + "send": "§N§", + "message": "§M§", + "verify": "§V§", + "unit-test": "§U§", + }, + ) + + +def build_record() -> CanonicalRecord: + return CanonicalRecord( + schema_version="cedrlang.cir/v1", + document_id="agent-instruction-001", + purpose="inspect system status", + directives=["agent send message", "verify status"], + constraints=["human approval required"], + inputs=["system status"], + outputs=["verify status"], + provenance="unit-test", + ) + + +def test_canonical_record_normalizes_and_hashes_deterministically(): + record = CanonicalRecord( + schema_version="cedrlang.cir/v1", + document_id="record-1", + purpose=" inspect system\r\n", + directives=["agent send message "], + constraints=[" human approval required\t"], + inputs=[], + outputs=[], + provenance=" test ", + ) + + equivalent = CanonicalRecord( + schema_version="cedrlang.cir/v1", + document_id="record-1", + purpose="inspect system\n", + directives=["agent send message"], + constraints=["human approval required"], + inputs=[], + outputs=[], + provenance="test", + ) + + assert record.to_dict() == equivalent.to_dict() + assert record.digest() == equivalent.digest() + + +def test_mapper_rejects_duplicate_symbol_handles(): + with pytest.raises(MapperValidationError): + GrimoireMapper( + mapper_id="invalid", + version="1.0.0", + forward={"inspect": "§D§", "system": "§D§"}, + ) + + +def test_codec_is_lossless_deterministic_and_measures_eligible_coverage(): + mapper = build_mapper() + record = build_record() + + encoded_one, report_one = encode_record(record, mapper, minimum_coverage=0.70) + encoded_two, report_two = encode_record(record, mapper, minimum_coverage=0.70) + + assert encoded_one == encoded_two + assert report_one.to_dict() == report_two.to_dict() + assert report_one.replaced_eligible_tokens == report_one.total_eligible_tokens + assert report_one.coverage_ratio == 1.0 + assert report_one.excluded_fields == ("constraints",) + assert decode_record(encoded_one, mapper) == record + + +def test_codec_preserves_literal_symbol_text_without_collision(): + mapper = build_mapper() + record = CanonicalRecord( + schema_version="cedrlang.cir/v1", + document_id="literal-handle", + purpose="literal §I§ inspect", + directives=[], + constraints=[], + inputs=[], + outputs=[], + provenance="unit-test", + ) + + encoded, _ = encode_record(record, mapper) + assert decode_record(encoded, mapper) == record + assert [segment for segment in encoded["record"]["purpose"] if "symbol" in segment] == [{"symbol": "§I§"}] + + +def test_codec_rejects_insufficient_coverage_and_integrity_tampering(): + mapper = build_mapper() + record = CanonicalRecord( + schema_version="cedrlang.cir/v1", + document_id="coverage-record", + purpose="unmapped prose", + directives=[], + constraints=[], + inputs=[], + outputs=[], + provenance="unit-test", + ) + + with pytest.raises(CoverageError): + encode_record(record, mapper, minimum_coverage=0.70) + + encoded, _ = encode_record(build_record(), mapper) + tampered = deepcopy(encoded) + tampered["record"]["purpose"][0] = {"text": "corrupted "} + + with pytest.raises(IntegrityError): + decode_record(tampered, mapper) + + +def test_a2a_envelope_validates_digest_ttl_state_and_replay_behavior(): + mapper = build_mapper() + record = build_record() + encoded, _ = encode_record(record, mapper) + now = datetime(2026, 8, 20, 0, 0, tzinfo=timezone.utc) + envelope = A2AEnvelope( + protocol_version="cedrlang.a2a/v1", + message_id=str(uuid4()), + sender_role="linguist", + recipient_role="reviewer", + correlation_id=str(uuid4()), + intent="instruction-transfer", + mapper_id=mapper.mapper_id, + mapper_version=mapper.version, + payload=encoded, + canonical_digest=record.digest(), + issued_at=now.isoformat(), + ttl_seconds=60, + ) + + decoded = validate_a2a_envelope(envelope, mapper, now=now + timedelta(seconds=30)) + assert decoded == record + assert classify_replay({}, envelope) == "new" + assert classify_replay({envelope.message_id: envelope.canonical_digest}, envelope) == "idempotent_duplicate" + assert classify_replay({envelope.message_id: "different"}, envelope) == "conflict" + + with pytest.raises(A2AValidationError): + validate_a2a_envelope(envelope, mapper, now=now + timedelta(seconds=61)) + + acknowledged = envelope.transition("ACK", acknowledgement_id="ack-001") + assert acknowledged.state == "ACK" + with pytest.raises(A2AValidationError): + acknowledged.transition("NACK", error_code="not-allowed") diff --git a/workspace/compression_sandbox/cedrlang/protocol.py b/workspace/compression_sandbox/cedrlang/protocol.py new file mode 100644 index 000000000..11405503a --- /dev/null +++ b/workspace/compression_sandbox/cedrlang/protocol.py @@ -0,0 +1,488 @@ +"""Deterministic, non-executing CEDRlang codec and local A2A envelope validator. + +This module deliberately has no filesystem mutation, subprocess, network, CEDARscript, +or CID dependency. A production mapper is supplied by an authorized caller; the repository +contains only synthetic test mappings. +""" + +from __future__ import annotations + +from dataclasses import dataclass, field +from datetime import datetime, timezone +import hashlib +import json +import re +import unicodedata +from typing import Any, Dict, List, Mapping, Optional, Sequence, Tuple +from uuid import UUID + + +CIR_SCHEMA_VERSION = "cedrlang.cir/v1" +A2A_PROTOCOL_VERSION = "cedrlang.a2a/v1" +ALLOWED_RECORD_FIELDS = ( + "purpose", + "directives", + "constraints", + "inputs", + "outputs", + "provenance", +) +ELIGIBLE_RECORD_FIELDS = ("purpose", "directives", "inputs", "outputs", "provenance") +EXCLUDED_RECORD_FIELDS = ("constraints",) +TOKEN_PATTERN = re.compile(r"\b[\w-]+\b", re.UNICODE) +HANDLE_PATTERN = re.compile(r"^§[A-Za-z0-9:_-]+§$") +ID_PATTERN = re.compile(r"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$") +ROLE_PATTERN = re.compile(r"^[a-z][a-z0-9_-]{0,63}$") +MAX_PAYLOAD_BYTES = 65_536 + + +class CedrLangError(ValueError): + """Base typed error for a rejected CEDRlang value.""" + + +class RecordValidationError(CedrLangError): + """Raised when a canonical record is malformed.""" + + +class MapperValidationError(CedrLangError): + """Raised when a mapper is malformed, ambiguous, or incompatible.""" + + +class CoverageError(CedrLangError): + """Raised when an enforced eligible-token coverage target is not met.""" + + +class IntegrityError(CedrLangError): + """Raised when an encoded record fails integrity verification.""" + + +class A2AValidationError(CedrLangError): + """Raised when a local A2A envelope is malformed or invalid.""" + + +def _normalize_text(value: str) -> str: + if not isinstance(value, str): + raise RecordValidationError("record fields must contain only text values") + normalized = unicodedata.normalize("NFC", value.replace("\r\n", "\n").replace("\r", "\n")) + if any(ord(char) < 32 and char not in "\n\t" for char in normalized): + raise RecordValidationError("record text contains unsupported control characters") + return "\n".join(line.rstrip() for line in normalized.split("\n")).strip() + + +def _normalize_identifier(value: str, label: str) -> str: + normalized = _normalize_text(value) + if not ID_PATTERN.fullmatch(normalized): + raise RecordValidationError(f"{label} must be a stable identifier") + return normalized + + +def _normalize_literal_segment(value: str) -> str: + """Validate a literal payload segment without stripping semantic whitespace.""" + if not isinstance(value, str): + raise IntegrityError("literal encoded segments must contain text") + normalized = unicodedata.normalize("NFC", value.replace("\r\n", "\n").replace("\r", "\n")) + if any(ord(char) < 32 and char not in "\n\t" for char in normalized): + raise IntegrityError("literal encoded segment contains unsupported control characters") + return normalized + + +def _sha256_text(value: str) -> str: + return hashlib.sha256(value.encode("utf-8")).hexdigest() + + +def _canonical_json(value: Mapping[str, Any]) -> str: + return json.dumps(value, ensure_ascii=False, sort_keys=True, separators=(",", ":")) + + +def _tokens(text: str) -> Tuple[str, ...]: + return tuple(match.group(0).lower() for match in TOKEN_PATTERN.finditer(text)) + + +@dataclass(frozen=True) +class CanonicalRecord: + """The authoritative normalized form for a CEDRlang instruction record.""" + + schema_version: str + document_id: str + purpose: str + directives: Sequence[str] + constraints: Sequence[str] + inputs: Sequence[str] + outputs: Sequence[str] + provenance: str + + def __post_init__(self) -> None: + if self.schema_version != CIR_SCHEMA_VERSION: + raise RecordValidationError(f"unsupported CIR schema version: {self.schema_version}") + object.__setattr__(self, "document_id", _normalize_identifier(self.document_id, "document_id")) + for field_name in ALLOWED_RECORD_FIELDS: + value = getattr(self, field_name) + if field_name in {"purpose", "provenance"}: + object.__setattr__(self, field_name, _normalize_text(value)) + else: + if not isinstance(value, Sequence) or isinstance(value, (str, bytes)): + raise RecordValidationError(f"{field_name} must be an ordered sequence of text") + object.__setattr__(self, field_name, tuple(_normalize_text(item) for item in value)) + + def to_dict(self) -> Dict[str, Any]: + return { + "schema_version": self.schema_version, + "document_id": self.document_id, + "purpose": self.purpose, + "directives": list(self.directives), + "constraints": list(self.constraints), + "inputs": list(self.inputs), + "outputs": list(self.outputs), + "provenance": self.provenance, + } + + @classmethod + def from_dict(cls, value: Mapping[str, Any]) -> "CanonicalRecord": + if set(value) != {"schema_version", "document_id", *ALLOWED_RECORD_FIELDS}: + raise RecordValidationError("CIR record has missing or unknown fields") + return cls(**dict(value)) + + def canonical_json(self) -> str: + return _canonical_json(self.to_dict()) + + def digest(self) -> str: + return _sha256_text(self.canonical_json()) + + +@dataclass(frozen=True) +class GrimoireMapper: + """Immutable bijective symbolic mapper supplied by an authorized caller.""" + + mapper_id: str + version: str + forward: Mapping[str, str] + private: bool = False + content_hash: str = field(init=False) + reverse: Mapping[str, str] = field(init=False) + + def __post_init__(self) -> None: + mapper_id = _normalize_identifier(self.mapper_id, "mapper_id") + version = _normalize_text(self.version) + if not re.fullmatch(r"\d+\.\d+\.\d+(?:[-+][A-Za-z0-9.-]+)?", version): + raise MapperValidationError("mapper version must be semantic-version shaped") + if not self.forward: + raise MapperValidationError("mapper must contain at least one mapping") + + normalized_forward: Dict[str, str] = {} + normalized_reverse: Dict[str, str] = {} + for source, handle in self.forward.items(): + source_key = _normalize_text(source).lower() + handle_value = _normalize_text(handle) + if not source_key or not HANDLE_PATTERN.fullmatch(handle_value): + raise MapperValidationError("mapper entries require a token and a well-formed symbolic handle") + if source_key in normalized_forward: + raise MapperValidationError("mapper contains duplicate normalized source tokens") + if handle_value in normalized_reverse: + raise MapperValidationError("mapper contains duplicate symbolic handles") + normalized_forward[source_key] = handle_value + normalized_reverse[handle_value] = source_key + + material = _canonical_json({"mapper_id": mapper_id, "version": version, "forward": normalized_forward}) + object.__setattr__(self, "mapper_id", mapper_id) + object.__setattr__(self, "version", version) + object.__setattr__(self, "forward", normalized_forward) + object.__setattr__(self, "reverse", normalized_reverse) + object.__setattr__(self, "content_hash", _sha256_text(material)) + + +@dataclass(frozen=True) +class CoverageReport: + mapper_id: str + mapper_version: str + mapper_content_hash: str + canonical_digest: str + replaced_eligible_tokens: int + total_eligible_tokens: int + excluded_fields: Tuple[str, ...] + + @property + def coverage_ratio(self) -> float: + if self.total_eligible_tokens == 0: + return 1.0 + return self.replaced_eligible_tokens / self.total_eligible_tokens + + def to_dict(self) -> Dict[str, Any]: + return { + "mapper_id": self.mapper_id, + "mapper_version": self.mapper_version, + "mapper_content_hash": self.mapper_content_hash, + "canonical_digest": self.canonical_digest, + "replaced_eligible_tokens": self.replaced_eligible_tokens, + "total_eligible_tokens": self.total_eligible_tokens, + "coverage_ratio": self.coverage_ratio, + "excluded_fields": list(self.excluded_fields), + } + + +def _encode_text(text: str, mapper: GrimoireMapper, eligible: bool) -> Tuple[List[Dict[str, str]], int, int]: + segments: List[Dict[str, str]] = [] + cursor = 0 + replaced = 0 + total = 0 + for match in TOKEN_PATTERN.finditer(text): + if match.start() > cursor: + segments.append({"text": text[cursor:match.start()]}) + token = match.group(0) + normalized = token.lower() + if eligible: + total += 1 + if eligible and normalized in mapper.forward: + segments.append({"symbol": mapper.forward[normalized]}) + replaced += 1 + else: + segments.append({"text": token}) + cursor = match.end() + if cursor < len(text) or not segments: + segments.append({"text": text[cursor:]}) + return segments, replaced, total + + +def _decode_text(segments: Any, mapper: GrimoireMapper) -> str: + if not isinstance(segments, list): + raise IntegrityError("encoded text must be a list of literal or symbolic segments") + decoded: List[str] = [] + for segment in segments: + if not isinstance(segment, Mapping) or set(segment) not in ({"text"}, {"symbol"}): + raise IntegrityError("encoded segment has an invalid shape") + if "text" in segment: + decoded.append(_normalize_literal_segment(segment["text"])) + else: + handle = segment["symbol"] + if handle not in mapper.reverse: + raise IntegrityError("encoded record references an unknown symbolic handle") + decoded.append(mapper.reverse[handle]) + return "".join(decoded) + + +def _encoded_record_from_canonical(record: CanonicalRecord, mapper: GrimoireMapper) -> Tuple[Dict[str, Any], int, int]: + encoded: Dict[str, Any] = {"schema_version": record.schema_version, "document_id": record.document_id} + replaced = 0 + total = 0 + for field_name in ALLOWED_RECORD_FIELDS: + value = getattr(record, field_name) + eligible = field_name in ELIGIBLE_RECORD_FIELDS + if field_name in {"purpose", "provenance"}: + segments, field_replaced, field_total = _encode_text(value, mapper, eligible) + encoded[field_name] = segments + replaced += field_replaced + total += field_total + else: + encoded_values: List[List[Dict[str, str]]] = [] + for item in value: + segments, field_replaced, field_total = _encode_text(item, mapper, eligible) + encoded_values.append(segments) + replaced += field_replaced + total += field_total + encoded[field_name] = encoded_values + return encoded, replaced, total + + +def encode_record( + record: CanonicalRecord, + mapper: GrimoireMapper, + *, + minimum_coverage: Optional[float] = None, +) -> Tuple[Dict[str, Any], CoverageReport]: + """Encode a CIR record and produce integrity and coverage evidence.""" + if not isinstance(record, CanonicalRecord): + raise RecordValidationError("encode_record requires a CanonicalRecord") + encoded_record, replaced, total = _encoded_record_from_canonical(record, mapper) + report = CoverageReport( + mapper_id=mapper.mapper_id, + mapper_version=mapper.version, + mapper_content_hash=mapper.content_hash, + canonical_digest=record.digest(), + replaced_eligible_tokens=replaced, + total_eligible_tokens=total, + excluded_fields=EXCLUDED_RECORD_FIELDS, + ) + if minimum_coverage is not None: + if not 0.0 <= minimum_coverage <= 1.0: + raise CoverageError("minimum coverage must be in the inclusive range [0, 1]") + if report.coverage_ratio < minimum_coverage: + raise CoverageError( + f"eligible-token coverage {report.coverage_ratio:.3f} is below required {minimum_coverage:.3f}" + ) + return ( + { + "codec_version": CIR_SCHEMA_VERSION, + "mapper": { + "mapper_id": mapper.mapper_id, + "version": mapper.version, + "content_hash": mapper.content_hash, + "private": mapper.private, + }, + "canonical_digest": record.digest(), + "record": encoded_record, + }, + report, + ) + + +def decode_record(encoded: Mapping[str, Any], mapper: GrimoireMapper) -> CanonicalRecord: + """Decode an authorized record and fail closed on mapper or integrity mismatch.""" + if not isinstance(encoded, Mapping): + raise IntegrityError("encoded record must be an object") + expected_fields = {"codec_version", "mapper", "canonical_digest", "record"} + if set(encoded) != expected_fields: + raise IntegrityError("encoded record has missing or unknown top-level fields") + if encoded["codec_version"] != CIR_SCHEMA_VERSION: + raise IntegrityError("unsupported codec version") + mapper_info = encoded["mapper"] + if not isinstance(mapper_info, Mapping): + raise IntegrityError("encoded mapper metadata is invalid") + if ( + mapper_info.get("mapper_id") != mapper.mapper_id + or mapper_info.get("version") != mapper.version + or mapper_info.get("content_hash") != mapper.content_hash + ): + raise IntegrityError("authorized mapper does not match encoded record metadata") + raw = encoded["record"] + if not isinstance(raw, Mapping) or set(raw) != {"schema_version", "document_id", *ALLOWED_RECORD_FIELDS}: + raise IntegrityError("encoded CIR record has missing or unknown fields") + decoded: Dict[str, Any] = {"schema_version": raw["schema_version"], "document_id": raw["document_id"]} + for field_name in ALLOWED_RECORD_FIELDS: + if field_name in {"purpose", "provenance"}: + decoded[field_name] = _decode_text(raw[field_name], mapper) + else: + if not isinstance(raw[field_name], list): + raise IntegrityError(f"encoded {field_name} must be a list") + decoded[field_name] = [_decode_text(item, mapper) for item in raw[field_name]] + record = CanonicalRecord.from_dict(decoded) + if record.digest() != encoded["canonical_digest"]: + raise IntegrityError("canonical digest mismatch") + return record + + +def _parse_utc(value: str) -> datetime: + if not isinstance(value, str): + raise A2AValidationError("issued_at must be an ISO-8601 string") + try: + parsed = datetime.fromisoformat(value.replace("Z", "+00:00")) + except ValueError as exc: + raise A2AValidationError("issued_at is not an ISO-8601 timestamp") from exc + if parsed.tzinfo is None: + raise A2AValidationError("issued_at must include a UTC offset") + return parsed.astimezone(timezone.utc) + + +def _validate_uuid(value: str, label: str) -> str: + try: + return str(UUID(value)) + except (TypeError, ValueError, AttributeError) as exc: + raise A2AValidationError(f"{label} must be a UUID") from exc + + +@dataclass(frozen=True) +class A2AEnvelope: + """Local-only A2A envelope carrying an encoded and integrity-bound CIR record.""" + + protocol_version: str + message_id: str + sender_role: str + recipient_role: str + correlation_id: str + intent: str + mapper_id: str + mapper_version: str + payload: Mapping[str, Any] + canonical_digest: str + issued_at: str + ttl_seconds: int + state: str = "PENDING" + acknowledgement_id: Optional[str] = None + error_code: Optional[str] = None + + def __post_init__(self) -> None: + if self.protocol_version != A2A_PROTOCOL_VERSION: + raise A2AValidationError(f"unsupported A2A protocol version: {self.protocol_version}") + object.__setattr__(self, "message_id", _validate_uuid(self.message_id, "message_id")) + object.__setattr__(self, "correlation_id", _validate_uuid(self.correlation_id, "correlation_id")) + for field_name in ("sender_role", "recipient_role"): + value = _normalize_text(getattr(self, field_name)) + if not ROLE_PATTERN.fullmatch(value): + raise A2AValidationError(f"{field_name} must be a bounded role identifier") + object.__setattr__(self, field_name, value) + object.__setattr__(self, "intent", _normalize_identifier(self.intent, "intent")) + object.__setattr__(self, "mapper_id", _normalize_identifier(self.mapper_id, "mapper_id")) + object.__setattr__(self, "mapper_version", _normalize_text(self.mapper_version)) + if not re.fullmatch(r"[0-9a-f]{64}", self.canonical_digest): + raise A2AValidationError("canonical_digest must be a SHA-256 hexadecimal digest") + if not isinstance(self.ttl_seconds, int) or not 1 <= self.ttl_seconds <= 86_400: + raise A2AValidationError("ttl_seconds must be between 1 and 86400") + if self.state not in {"PENDING", "ACK", "NACK"}: + raise A2AValidationError("state must be PENDING, ACK, or NACK") + if self.state == "ACK" and not self.acknowledgement_id: + raise A2AValidationError("ACK envelopes require acknowledgement_id") + if self.state == "NACK" and not self.error_code: + raise A2AValidationError("NACK envelopes require error_code") + payload_bytes = len(_canonical_json(dict(self.payload)).encode("utf-8")) + if payload_bytes > MAX_PAYLOAD_BYTES: + raise A2AValidationError("payload exceeds the local A2A size limit") + _parse_utc(self.issued_at) + + def transition( + self, + state: str, + *, + acknowledgement_id: Optional[str] = None, + error_code: Optional[str] = None, + ) -> "A2AEnvelope": + if self.state != "PENDING": + raise A2AValidationError("only PENDING envelopes may transition") + if state not in {"ACK", "NACK"}: + raise A2AValidationError("PENDING envelopes may transition only to ACK or NACK") + return A2AEnvelope( + protocol_version=self.protocol_version, + message_id=self.message_id, + sender_role=self.sender_role, + recipient_role=self.recipient_role, + correlation_id=self.correlation_id, + intent=self.intent, + mapper_id=self.mapper_id, + mapper_version=self.mapper_version, + payload=self.payload, + canonical_digest=self.canonical_digest, + issued_at=self.issued_at, + ttl_seconds=self.ttl_seconds, + state=state, + acknowledgement_id=acknowledgement_id, + error_code=error_code, + ) + + +def validate_a2a_envelope( + envelope: A2AEnvelope, + mapper: GrimoireMapper, + *, + now: Optional[datetime] = None, +) -> CanonicalRecord: + """Validate an envelope locally and return its integrity-verified canonical record.""" + if envelope.mapper_id != mapper.mapper_id or envelope.mapper_version != mapper.version: + raise A2AValidationError("envelope mapper metadata does not match the authorized mapper") + now = now or datetime.now(timezone.utc) + if now.tzinfo is None: + raise A2AValidationError("validation time must include a UTC offset") + issued = _parse_utc(envelope.issued_at) + now_utc = now.astimezone(timezone.utc) + if now_utc > issued and (now_utc - issued).total_seconds() > envelope.ttl_seconds: + raise A2AValidationError("envelope TTL has expired") + record = decode_record(envelope.payload, mapper) + if record.digest() != envelope.canonical_digest: + raise A2AValidationError("envelope canonical digest does not match payload") + return record + + +def classify_replay(seen_messages: Mapping[str, str], envelope: A2AEnvelope) -> str: + """Classify a message ID without any persistence or side effects.""" + observed = seen_messages.get(envelope.message_id) + if observed is None: + return "new" + if observed == envelope.canonical_digest: + return "idempotent_duplicate" + return "conflict" From b9cabbeca51b45e445c21f7d42ec1d4ecfe97a04 Mon Sep 17 00:00:00 2001 From: Manus Date: Thu, 20 Aug 2026 20:43:53 +0000 Subject: [PATCH 2/8] docs(linguist): publish research and graph reuse guide Agent-Identity: Manus Task-Ref: LGA-05 Signed-off-by: Manus --- .../active/cedrlang-grimoire-a2a/MANIFEST.md | 12 ++++- .../active/cedrlang-grimoire-a2a/RESEARCH.md | 40 ++++++++++++++++ .../active/cedrlang-grimoire-a2a/source.md | 6 ++- .../linguist-177/LINGUIST-REVIEW-PACKET.md | 6 ++- .../context-relationship-graph-reuse.md | 47 +++++++++++++++++++ 5 files changed, 106 insertions(+), 5 deletions(-) create mode 100644 docs/proposals/active/cedrlang-grimoire-a2a/RESEARCH.md create mode 100644 docs/reviews/linguist-177/context-relationship-graph-reuse.md diff --git a/docs/proposals/active/cedrlang-grimoire-a2a/MANIFEST.md b/docs/proposals/active/cedrlang-grimoire-a2a/MANIFEST.md index 93ebc7f6b..cd7bda66e 100644 --- a/docs/proposals/active/cedrlang-grimoire-a2a/MANIFEST.md +++ b/docs/proposals/active/cedrlang-grimoire-a2a/MANIFEST.md @@ -11,7 +11,7 @@ reviewers: role: operator-authorizer status: requested related_prs: [126, 154, 177, 196, 208, 218, 228] -related_issues: [117] +related_issues: [117, 175, 274] related_branches: [feature/cedrlang-grimoire-a2a] gates_required: [repo-gate, termux-smoke] --- @@ -36,6 +36,11 @@ This proposal reconstructs the useful, independently testable core of the Lingui - 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. + ## Checklist (process) - [x] Registered in `docs/proposals/registry.yaml` on this feature branch @@ -50,5 +55,8 @@ This proposal reconstructs the useful, independently testable core of the Lingui - ITEMS: ./ITEMS.md - Source: ./source.md -- Evidence: `../../reviews/linguist-177/` +- 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 diff --git a/docs/proposals/active/cedrlang-grimoire-a2a/RESEARCH.md b/docs/proposals/active/cedrlang-grimoire-a2a/RESEARCH.md new file mode 100644 index 000000000..41acfdf82 --- /dev/null +++ b/docs/proposals/active/cedrlang-grimoire-a2a/RESEARCH.md @@ -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 `draft` 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. | +| _Unassigned_ | non-author technical reviewer | pending | — | 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) diff --git a/docs/proposals/active/cedrlang-grimoire-a2a/source.md b/docs/proposals/active/cedrlang-grimoire-a2a/source.md index 52f1dea36..96bc9e43b 100644 --- a/docs/proposals/active/cedrlang-grimoire-a2a/source.md +++ b/docs/proposals/active/cedrlang-grimoire-a2a/source.md @@ -28,4 +28,8 @@ The following are excluded from this proposal: migrating the root `AGENTS.md` or ## Evidence Basis -The decision is based on the bounded graph rooted at PR #177, all-state title inventory, local source inventory, and the operator scope guidance for the dirty Linguist PRs. It preserves the valid requirements for deterministic translation and A2A protocol development while correcting the current scope mix between a document translator and an execution-capable code-editing system. +The decision is based on the bounded graph rooted at PR #177, all-state title inventory, local source inventory, and the operator scope guidance for the dirty Linguist PRs. It preserves the valid requirements for deterministic translation and A2A protocol development while correcting the current scope mix between a document translator and an execution-capable code-editing system. The published evidence packet and implementation are tracked through [issue #274](https://github.com/timerloggedout-spec/termux-monorepo/issues/274), which is cross-linked to the A2A proposal [#117](https://github.com/timerloggedout-spec/termux-monorepo/issues/117) and operator gate record [#175](https://github.com/timerloggedout-spec/termux-monorepo/issues/175). + +## Pending Approval Boundary + +This record governs only the deterministic local foundation. It does **not** authorize a private mapper service, a public obfuscation claim, authenticated transport, CEDARscript/CID integration, external installation, or a migration of agent-contact documents. `RESEARCH.md` records the outstanding custody, canonical-source, transport, coverage, baseline-remediation, review, and vote requirements. The proposal remains `draft` until those decisions and a non-author review are recorded. diff --git a/docs/reviews/linguist-177/LINGUIST-REVIEW-PACKET.md b/docs/reviews/linguist-177/LINGUIST-REVIEW-PACKET.md index e6e4bd68c..1ee6fe3da 100644 --- a/docs/reviews/linguist-177/LINGUIST-REVIEW-PACKET.md +++ b/docs/reviews/linguist-177/LINGUIST-REVIEW-PACKET.md @@ -90,11 +90,11 @@ The new work is registered as proposal `cedrlang-grimoire-a2a` and its first wor > **Status: 🔴 NO-GO for the current stack.** The PR is dirty and contains a broad 161-file scope that mixes the Linguist codec with unrelated workflows, dependencies, ICM, and runtime material. The current public regex mapping, tracked pointer index, and Grimoire dictionaries do not constitute a private authorized mapper, and the diff does not establish the requested 70% metric, canonical digest, mapper version/collision policy, or A2A envelope contract. Do not force-merge or rebase this stack to regain mergeability. Preserve only isolated, tested translator improvements through the successor proposal `cedrlang-grimoire-a2a` (`LGA-01`), which adds a deterministic non-executing codec and local A2A validator while keeping CEDARscript/CID execution separate. Repository integration remains conditional on a non-author proposal review, accepted status, and resolution or explicit baseline disposition for the current gate/registry blockers. [2] [3] [7] -This text is a draft only. It has not been posted to GitHub. +This full text remains the review packet's canonical draft. A concise, evidence-linked disposition summary was posted to [PR #177](https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5361408055), [PR #154](https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5361406746), [issue #117](https://github.com/timerloggedout-spec/termux-monorepo/issues/117#issuecomment-5361410703), and [issue #175](https://github.com/timerloggedout-spec/termux-monorepo/issues/175#issuecomment-5361403327). The complete evidence bundle and subtasks are published in [issue #274](https://github.com/timerloggedout-spec/termux-monorepo/issues/274). None of those cross-references is an approval, formal review verdict, merge, or private-mapper authorization. ## Required Next Decisions -The next safe step is a non-author review of proposal `cedrlang-grimoire-a2a`. If accepted, it can be advanced through the ordinary feature-branch gate process. A later separate proposal must choose an approved private-mapper custody service, define access/rotation/audit behavior, and decide whether any canonical agent document should generate a machine projection. No migration of `AGENTS.md`, `CLAUDE.md`, ICM files, README, CID, CEDARscript, or workflows should proceed from this review alone. +The next safe step is a non-author review of proposal `cedrlang-grimoire-a2a`, recorded through [issue #274](https://github.com/timerloggedout-spec/termux-monorepo/issues/274) and `RESEARCH.md`. If accepted, it can be advanced through the ordinary feature-branch gate process. A later separate proposal must choose an approved private-mapper custody service, define access/rotation/audit behavior, and decide whether any canonical agent document should generate a machine projection. No migration of `AGENTS.md`, `CLAUDE.md`, ICM files, README, CID, CEDARscript, or workflows should proceed from this review alone. Agents repeating or improving this evidence process should follow the linked [context-relationship graph reuse case study](context-relationship-graph-reuse.md). ## References @@ -109,3 +109,5 @@ The next safe step is a non-author review of proposal `cedrlang-grimoire-a2a`. I 9. [Existing CedrLang tests](../../../tests/test_cedrlang.py) and [new protocol tests](../../../tests/test_cedrlang_protocol.py) 10. [Issue #117 — Agent2Agent Comms Proposal](https://github.com/timerloggedout-spec/termux-monorepo/issues/117) 11. [Root AGENTS.md](../../../AGENTS.md), [root CLAUDE.md](../../../CLAUDE.md), and [ICM change process](../../icm/processes/change-and-validate.md) +12. [Context-relationship graph reuse case study](context-relationship-graph-reuse.md) +13. [Linguist publication and subtask tracker, issue #274](https://github.com/timerloggedout-spec/termux-monorepo/issues/274) diff --git a/docs/reviews/linguist-177/context-relationship-graph-reuse.md b/docs/reviews/linguist-177/context-relationship-graph-reuse.md new file mode 100644 index 000000000..a9504887a --- /dev/null +++ b/docs/reviews/linguist-177/context-relationship-graph-reuse.md @@ -0,0 +1,47 @@ +# Reuse Case: Context Relationship Graph for Linguist Review + +## Why This Exists + +This review used the repository-native [`context-relationship-graph` skill](../../../.agents/skills/context-relationship-graph/SKILL.md) to reconstruct the decision context for Linguist PR #177 before proposing a change. It is a reusable example for agents reviewing a broad pull request, a disputed architecture decision, related GitHub history, or a potentially stale work item. + +> The graph is an evidence aid, not a source of authority. It does not authorize a merge, a Linear update, a secret change, or a repository mutation merely because a relationship was found. + +## Reuse Recipe + +| Step | Required action | Linguist example | +|---|---|---| +| 1. Establish bounds | Read agent instructions, active proposals, graph scope registry, and index manifest. | The review excluded session stores, credentials, browser state, generated internals, and unbounded history. | +| 2. Start exact | Query the PR, issue, file, symbol, or permalink that is the actual root. | `pr:177` was the root; `pr:126`, `pr:154`, and `issue:117` were verified follow-up roots. | +| 3. Preserve evidence classes | Keep direct API/permalink/index evidence as **verified**; use shared-file history only as **candidate**. | PR #126’s link to issue #117 is verified; PRs #196/#208/#218/#228 are candidate optimization context. | +| 4. Inspect the smallest source set | Read only the cited implementation, test, role, dictionary, and governance files. | `cedrlang.py`, `cid.py`, tests, `LINGUIST_SPEC.md`, Grimoire dictionaries, AGENTS/CLAUDE, and proposal records were assessed. | +| 5. Render only on request | Produce bounded Mermaid only when a person requests visual output. | [`context-pr177.mmd`](context-pr177.mmd) and [`linguist-relationship-summary.mmd`](linguist-relationship-summary.mmd) are source artifacts. | +| 6. Close out precisely | Report the root, verified links, candidate links, history bound, and unresolved decisions. | [`LINGUIST-REVIEW-PACKET.md`](LINGUIST-REVIEW-PACKET.md) records the no-go disposition, successor scope, and gate blockers. | + +## Commands + +Run from the repository root. Use narrow selectors and state bounds in the resulting report. + +```bash +python3 -m archwiz.context_relationships.query \ + --index workspace/llm_map/context_relationships \ + --query pr:177 --depth 2 --max-nodes 25 --format markdown + +python3 -m archwiz.context_relationships.query \ + --index workspace/llm_map/context_relationships \ + --file-review-timeline workspace/compression_sandbox/cedrlang/cedrlang.py \ + --max-nodes 50 --format markdown +``` + +The graph may be refreshed only through its trusted publisher or bounded manual reconciliation. Do not hand-edit generated records, persist comment/review bodies, widen a query after a no-match, or represent a candidate as a fact. + +## Review and Upgrade Path + +An agent seeking to extend the method should first read the skill, [`docs/icm/objects/knowledge/context-relationship-index.md`](../../icm/objects/knowledge/context-relationship-index.md), and the active [Context Relationship Graph proposal](../../proposals/active/context-relationship-graph/MANIFEST.md). Changes to graph code require the dedicated deterministic contract suite before a proposal or workflow change. Review requests or method-improvement proposals should cite this case study, the exact root, and an evidence URL rather than pasting private discussion content. + +## Linguist Evidence Links + +- [Review packet](LINGUIST-REVIEW-PACKET.md) +- [Agent-contact inventory](agent-contact-inventory.md) +- [Diagram validation](diagram-validation.md) +- [Published follow-up issue #274](https://github.com/timerloggedout-spec/termux-monorepo/issues/274) +- [Proposal research and vote record](../../proposals/active/cedrlang-grimoire-a2a/RESEARCH.md) From 815a6a2b9f32c2eaa8e2edc87ab628f4ca10a64e Mon Sep 17 00:00:00 2001 From: Manus Date: Thu, 20 Aug 2026 20:49:42 +0000 Subject: [PATCH 3/8] feat(cedrlang): validate strict A2A envelope objects Agent-Identity: Manus Task-Ref: LGA-06 Signed-off-by: Manus --- docs/CEDRLANG-GRIMOIRE-A2A.md | 3 +- .../active/cedrlang-grimoire-a2a/ITEMS.md | 1 + tests/test_cedrlang_protocol.py | 55 +++++++++++++++++++ .../compression_sandbox/cedrlang/protocol.py | 55 ++++++++++++++++++- 4 files changed, 111 insertions(+), 3 deletions(-) diff --git a/docs/CEDRLANG-GRIMOIRE-A2A.md b/docs/CEDRLANG-GRIMOIRE-A2A.md index 2fe58e013..d4462ee4a 100644 --- a/docs/CEDRLANG-GRIMOIRE-A2A.md +++ b/docs/CEDRLANG-GRIMOIRE-A2A.md @@ -37,7 +37,7 @@ It is a codec-coverage metric, not a claim about proprietary model tokenization, ## 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`. +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 | |---|---| @@ -47,6 +47,7 @@ The initial Agent2Agent contract is local validation only. An envelope carries i | 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. diff --git a/docs/proposals/active/cedrlang-grimoire-a2a/ITEMS.md b/docs/proposals/active/cedrlang-grimoire-a2a/ITEMS.md index 198ad6175..65af1319a 100644 --- a/docs/proposals/active/cedrlang-grimoire-a2a/ITEMS.md +++ b/docs/proposals/active/cedrlang-grimoire-a2a/ITEMS.md @@ -7,3 +7,4 @@ | 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. | diff --git a/tests/test_cedrlang_protocol.py b/tests/test_cedrlang_protocol.py index d6aa15f63..e8d70a8fd 100644 --- a/tests/test_cedrlang_protocol.py +++ b/tests/test_cedrlang_protocol.py @@ -175,3 +175,58 @@ def test_a2a_envelope_validates_digest_ttl_state_and_replay_behavior(): assert acknowledged.state == "ACK" with pytest.raises(A2AValidationError): acknowledged.transition("NACK", error_code="not-allowed") + + +def test_a2a_envelope_serialization_rejects_unknown_missing_and_malformed_payloads(): + mapper = build_mapper() + record = build_record() + encoded, _ = encode_record(record, mapper) + envelope = A2AEnvelope( + protocol_version="cedrlang.a2a/v1", + message_id=str(uuid4()), + sender_role="linguist", + recipient_role="reviewer", + correlation_id=str(uuid4()), + intent="instruction-transfer", + mapper_id=mapper.mapper_id, + mapper_version=mapper.version, + payload=encoded, + canonical_digest=record.digest(), + issued_at=datetime(2026, 8, 20, tzinfo=timezone.utc).isoformat(), + ttl_seconds=60, + ) + + serialized = envelope.to_dict() + assert A2AEnvelope.from_dict(serialized) == envelope + assert set(serialized) == { + "protocol_version", + "message_id", + "sender_role", + "recipient_role", + "correlation_id", + "intent", + "mapper_id", + "mapper_version", + "payload", + "canonical_digest", + "issued_at", + "ttl_seconds", + "state", + "acknowledgement_id", + "error_code", + } + + missing = dict(serialized) + missing.pop("payload") + with pytest.raises(A2AValidationError): + A2AEnvelope.from_dict(missing) + + unknown = dict(serialized) + unknown["unexpected"] = "value" + with pytest.raises(A2AValidationError): + A2AEnvelope.from_dict(unknown) + + malformed = dict(serialized) + malformed["payload"] = ["not", "an", "object"] + with pytest.raises(A2AValidationError): + A2AEnvelope.from_dict(malformed) diff --git a/workspace/compression_sandbox/cedrlang/protocol.py b/workspace/compression_sandbox/cedrlang/protocol.py index 11405503a..3f0f077d5 100644 --- a/workspace/compression_sandbox/cedrlang/protocol.py +++ b/workspace/compression_sandbox/cedrlang/protocol.py @@ -19,6 +19,25 @@ CIR_SCHEMA_VERSION = "cedrlang.cir/v1" A2A_PROTOCOL_VERSION = "cedrlang.a2a/v1" +A2A_ENVELOPE_FIELDS = frozenset( + { + "protocol_version", + "message_id", + "sender_role", + "recipient_role", + "correlation_id", + "intent", + "mapper_id", + "mapper_version", + "payload", + "canonical_digest", + "issued_at", + "ttl_seconds", + "state", + "acknowledgement_id", + "error_code", + } +) ALLOWED_RECORD_FIELDS = ( "purpose", "directives", @@ -411,7 +430,9 @@ def __post_init__(self) -> None: object.__setattr__(self, "intent", _normalize_identifier(self.intent, "intent")) object.__setattr__(self, "mapper_id", _normalize_identifier(self.mapper_id, "mapper_id")) object.__setattr__(self, "mapper_version", _normalize_text(self.mapper_version)) - if not re.fullmatch(r"[0-9a-f]{64}", self.canonical_digest): + if not isinstance(self.payload, Mapping): + raise A2AValidationError("payload must be an encoded record object") + if not isinstance(self.canonical_digest, str) or not re.fullmatch(r"[0-9a-f]{64}", self.canonical_digest): raise A2AValidationError("canonical_digest must be a SHA-256 hexadecimal digest") if not isinstance(self.ttl_seconds, int) or not 1 <= self.ttl_seconds <= 86_400: raise A2AValidationError("ttl_seconds must be between 1 and 86400") @@ -421,11 +442,41 @@ def __post_init__(self) -> None: raise A2AValidationError("ACK envelopes require acknowledgement_id") if self.state == "NACK" and not self.error_code: raise A2AValidationError("NACK envelopes require error_code") - payload_bytes = len(_canonical_json(dict(self.payload)).encode("utf-8")) + try: + payload_bytes = len(_canonical_json(dict(self.payload)).encode("utf-8")) + except (TypeError, ValueError) as exc: + raise A2AValidationError("payload must be JSON-serializable") from exc if payload_bytes > MAX_PAYLOAD_BYTES: raise A2AValidationError("payload exceeds the local A2A size limit") _parse_utc(self.issued_at) + def to_dict(self) -> Dict[str, Any]: + """Return a transport-safe, explicit representation of this local envelope.""" + return { + "protocol_version": self.protocol_version, + "message_id": self.message_id, + "sender_role": self.sender_role, + "recipient_role": self.recipient_role, + "correlation_id": self.correlation_id, + "intent": self.intent, + "mapper_id": self.mapper_id, + "mapper_version": self.mapper_version, + "payload": dict(self.payload), + "canonical_digest": self.canonical_digest, + "issued_at": self.issued_at, + "ttl_seconds": self.ttl_seconds, + "state": self.state, + "acknowledgement_id": self.acknowledgement_id, + "error_code": self.error_code, + } + + @classmethod + def from_dict(cls, value: Mapping[str, Any]) -> "A2AEnvelope": + """Parse only an exact serialized local-envelope schema; reject extras and omissions.""" + if not isinstance(value, Mapping) or set(value) != A2A_ENVELOPE_FIELDS: + raise A2AValidationError("A2A envelope has missing or unknown fields") + return cls(**dict(value)) + def transition( self, state: str, From a2ca1c0b8fd1a385789935ffd72f15aabc0746da Mon Sep 17 00:00:00 2001 From: Manus Date: Thu, 20 Aug 2026 20:51:46 +0000 Subject: [PATCH 4/8] docs(linguist): record strict envelope validation Agent-Identity: Manus Task-Ref: LGA-06 Signed-off-by: Manus --- docs/reviews/linguist-177/LINGUIST-REVIEW-PACKET.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/reviews/linguist-177/LINGUIST-REVIEW-PACKET.md b/docs/reviews/linguist-177/LINGUIST-REVIEW-PACKET.md index 1ee6fe3da..90eafe670 100644 --- a/docs/reviews/linguist-177/LINGUIST-REVIEW-PACKET.md +++ b/docs/reviews/linguist-177/LINGUIST-REVIEW-PACKET.md @@ -67,8 +67,8 @@ The new work is registered as proposal `cedrlang-grimoire-a2a` and its first wor | Delivered component | What it does | What it deliberately does not do | |---|---|---| -| `protocol.py` | Canonical record normalization, deterministic serialization, SHA-256 digest, mapper collision validation, segment-safe encode/decode, coverage report, A2A envelope/TTL/state/replay validation. | No filesystem writes, subprocesses, network, external service, CID, CEDARscript, or patch routing. | -| `test_cedrlang_protocol.py` | Six focused tests for deterministic round trips, collisions, literal handles, coverage enforcement, tamper failure, A2A TTL/state/replay behavior. | No real/private mapper test data. | +| `protocol.py` | Canonical record normalization, deterministic serialization, SHA-256 digest, mapper collision validation, segment-safe encode/decode, coverage report, strict serialized A2A object parsing, and A2A TTL/state/replay validation. | No filesystem writes, subprocesses, network, external service, CID, CEDARscript, or patch routing. | +| `test_cedrlang_protocol.py` | Seven focused tests for deterministic round trips, collisions, literal handles, coverage enforcement, tamper failure, strict serialized-envelope rejection, and A2A TTL/state/replay behavior. | No real/private mapper test data. | | `CEDRLANG-GRIMOIRE-A2A.md` | Public specification of canonical source, mapper boundary, 70% coverage definition, local A2A schema, and CEDARscript separation. | No private mapper custody instructions or operational automation. | | Proposal and review evidence | Item ledger, decision record, source inventory, graph outputs, external-boundary record, and review packet. | No PR comment, approval, merge, external workflow, secret, or repository configuration write. | @@ -76,7 +76,7 @@ The new work is registered as proposal `cedrlang-grimoire-a2a` and its first wor | Validation | Result | Notes | |---|---|---| -| `python3 -m pytest tests/test_cedrlang.py tests/test_cedrlang_protocol.py -q` | **Pass: 17 tests** | 11 historical translator tests plus 6 new foundation tests passed. | +| `python3 -m pytest tests/test_cedrlang.py tests/test_cedrlang_protocol.py -q` | **Pass: 18 tests** | 11 historical translator tests plus 7 new foundation tests passed. | | `python3 -m compileall -q workspace/compression_sandbox/cedrlang/protocol.py tests/test_cedrlang_protocol.py` | **Pass** | New implementation and tests compile. | | `ruff check --select F,E9 …` | **Pass** | Compatibility-focused linting is clean. The repository’s global Ruff defaults suggest modern typing rewrites that are not adopted because the documented Python floor is 3.9. | | Dependency boundary scan | **Pass** | No execution, network, CID, or CEDARscript import/invocation pattern exists in `protocol.py`. | From 3e2b6679ccd1d1ddc1041eb2d3819988dbe197f9 Mon Sep 17 00:00:00 2001 From: Manus Date: Thu, 20 Aug 2026 20:53:19 +0000 Subject: [PATCH 5/8] docs(linguist): record cross-system publication links Agent-Identity: Manus Task-Ref: LGA-05 Signed-off-by: Manus --- .../linguist-177/PUBLICATION-RECORD.md | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 docs/reviews/linguist-177/PUBLICATION-RECORD.md diff --git a/docs/reviews/linguist-177/PUBLICATION-RECORD.md b/docs/reviews/linguist-177/PUBLICATION-RECORD.md new file mode 100644 index 000000000..051ad2308 --- /dev/null +++ b/docs/reviews/linguist-177/PUBLICATION-RECORD.md @@ -0,0 +1,41 @@ +# Linguist Publication Record + +**Published:** 2026-08-20 UTC + +**Evidence branch:** [`feature/cedrlang-grimoire-a2a`](https://github.com/timerloggedout-spec/termux-monorepo/tree/feature/cedrlang-grimoire-a2a) + +**Latest evidence commit:** [`fbe7785`](https://github.com/timerloggedout-spec/termux-monorepo/commit/fbe7785) + +## GitHub Publication Map + +| Target | Published record | Purpose | +|---|---|---| +| New tracked issue | [#274](https://github.com/timerloggedout-spec/termux-monorepo/issues/274) | Labels: `Linguist`, `documentation`, `agent`, `priority`, `high-priority`; contains subtask checklist, evidence links, Mermaid sources/images, Python implementation/test links, research/vote links, and related history. | +| Draft successor PR | [#275](https://github.com/timerloggedout-spec/termux-monorepo/pull/275) | Draft from `feature/cedrlang-grimoire-a2a` to `master-staging`; references `LGA-01`–`LGA-04` and `LGA-06`; no merge claim. | +| Operator gate record | [#175 comment](https://github.com/timerloggedout-spec/termux-monorepo/issues/175#issuecomment-5361403327) | Connects the review findings, branch, blockers, and A2A follow-up. | +| A2A proposal | [#117 comment](https://github.com/timerloggedout-spec/termux-monorepo/issues/117#issuecomment-5361410703) | Connects the local A2A envelope foundation while preserving the no-external-install boundary. | +| Open Linguist stacks | [#154 comment](https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5361406746) and [#177 comment](https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5361408055) | Records the successor relationship and no-force-merge disposition without submitting a PR approval or review verdict. | + +## Published Evidence and Reuse Assets + +| Artifact | Canonical path | +|---|---| +| Review packet | [`LINGUIST-REVIEW-PACKET.md`](LINGUIST-REVIEW-PACKET.md) | +| CEDRlang/A2A contract | [`../../CEDRLANG-GRIMOIRE-A2A.md`](../../CEDRLANG-GRIMOIRE-A2A.md) | +| Strict codec and A2A implementation | [`../../../workspace/compression_sandbox/cedrlang/protocol.py`](../../../workspace/compression_sandbox/cedrlang/protocol.py) | +| Focused tests | [`../../../tests/test_cedrlang_protocol.py`](../../../tests/test_cedrlang_protocol.py) | +| Generated Mermaid | [`context-pr177.mmd`](context-pr177.mmd) | +| Curated Mermaid | [`linguist-relationship-summary.mmd`](linguist-relationship-summary.mmd) | +| Visual render validation | [`diagram-validation.md`](diagram-validation.md) | +| Reusable graph-method case study | [`context-relationship-graph-reuse.md`](context-relationship-graph-reuse.md) | +| Proposal research/vote requests | [`../../proposals/active/cedrlang-grimoire-a2a/RESEARCH.md`](../../proposals/active/cedrlang-grimoire-a2a/RESEARCH.md) | + +## Cross-System Tracking Outcome + +A Linear project update was published on the active **termux-monorepo hardening** project as comment `53c0195e-828e-43da-82ce-4c7f48e4656e`; it links issues #274/#275, the branch, the review packet, and the context-relationship reuse material. Creation of a dedicated Linear issue was attempted, but the workspace returned an explicit free-issue-limit error. The project comment is the durable Linear cross-reference until capacity is available. + +GitHub Project v2 discovery was attempted with the authenticated token, but the GitHub GraphQL endpoint returned `Resource not accessible by integration`. Because no project number or writable target could be discovered safely, issue #274 was **not** added to a GitHub Project. This is an access limitation, not an omitted task; the issue and PR remain fully cross-linked through GitHub and Linear. + +## Validation State + +The successor branch passed 18 focused/regression tests, compilation, compatibility lint, dependency-boundary scanning, credential-signature scanning, staged whitespace validation, and Termux smoke. The repository gate remains blocked by inherited `archwiz/linear_sync.py:237` syntax, and full proposal-registry validation remains blocked by pre-existing orphan active directories. Proposal status remains `draft`; independent non-author review and operator acceptance are still required before any merge or integration claim. From f809ce881c58b6e822f5c5142c55f602c1612add Mon Sep 17 00:00:00 2001 From: Manus Date: Fri, 21 Aug 2026 17:59:02 +0000 Subject: [PATCH 6/8] docs(linguist): consolidate current review path Agent-Identity: Manus Task-Ref: LGA-05 Signed-off-by: Manus --- .../active/cedrlang-grimoire-a2a/MANIFEST.md | 19 ++++++-- docs/proposals/registry.yaml | 9 ++-- .../CURRENT-INTEGRATION-RECONCILIATION.md | 48 +++++++++++++++++++ .../current-integration-relationships.mmd | 29 +++++++++++ 4 files changed, 98 insertions(+), 7 deletions(-) create mode 100644 docs/reviews/linguist-177/CURRENT-INTEGRATION-RECONCILIATION.md create mode 100644 docs/reviews/linguist-177/current-integration-relationships.mmd diff --git a/docs/proposals/active/cedrlang-grimoire-a2a/MANIFEST.md b/docs/proposals/active/cedrlang-grimoire-a2a/MANIFEST.md index cd7bda66e..8d02c884b 100644 --- a/docs/proposals/active/cedrlang-grimoire-a2a/MANIFEST.md +++ b/docs/proposals/active/cedrlang-grimoire-a2a/MANIFEST.md @@ -4,14 +4,17 @@ title: "CEDRlang deterministic codec, Grimoire boundary, and local A2A envelope author: Manus AI posted_at: 2026-08-20 source: source.md -status: draft +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] -related_issues: [117, 175, 274] +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] --- @@ -27,7 +30,8 @@ This proposal reconstructs the useful, independently testable core of the Lingui | 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 | requested | 2026-08-20 | Formal proposal acceptance is required before an integration claim or merge. | +| 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 @@ -41,6 +45,11 @@ This proposal reconstructs the useful, independently testable core of the Lingui - 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` and validated with 18 focused/regression tests and 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 Grimiore/CID/CEDR naming root; issue #117 remains the A2A design root. See `CURRENT-INTEGRATION-RECONCILIATION.md` and `current-integration-relationships.mmd`. The inherited registry-orphan failure remains a documented blocker; it is not waived. + ## Checklist (process) - [x] Registered in `docs/proposals/registry.yaml` on this feature branch @@ -60,3 +69,5 @@ This proposal reconstructs the useful, independently testable core of the Lingui - 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` diff --git a/docs/proposals/registry.yaml b/docs/proposals/registry.yaml index 1f9d5deaa..d8f1781fa 100644 --- a/docs/proposals/registry.yaml +++ b/docs/proposals/registry.yaml @@ -133,7 +133,7 @@ proposals: - id: cedrlang-grimoire-a2a title: "CEDRlang deterministic codec, Grimoire boundary, and local A2A envelope foundation" author: Manus AI - status: draft + status: in_review priority: P1 path: active/cedrlang-grimoire-a2a/ reviewers: @@ -142,8 +142,11 @@ proposals: status: posted - id: timerloggedout-spec role: operator-authorizer + status: in_review + - id: google-labs-jules + role: non-author implementation reviewer status: requested - related_issues: [117] - related_prs: [126, 154, 177, 196, 208, 218, 228] + related_issues: [117, 175, 182, 274] + related_prs: [126, 154, 177, 196, 208, 218, 228, 275] related_branches: [feature/cedrlang-grimoire-a2a] gates_required: [repo-gate, termux-smoke] diff --git a/docs/reviews/linguist-177/CURRENT-INTEGRATION-RECONCILIATION.md b/docs/reviews/linguist-177/CURRENT-INTEGRATION-RECONCILIATION.md new file mode 100644 index 000000000..02242b116 --- /dev/null +++ b/docs/reviews/linguist-177/CURRENT-INTEGRATION-RECONCILIATION.md @@ -0,0 +1,48 @@ +# Current Linguist / Grimiore / A2A Integration Reconciliation + +**As of:** 2026-08-21 UTC + +**Decision:** Use [PR #275](https://github.com/timerloggedout-spec/termux-monorepo/pull/275) as the **single reviewable integration candidate**. Do not merge, rebase, or append new implementation to the conflicted Jules stacks [PR #154](https://github.com/timerloggedout-spec/termux-monorepo/pull/154) and [PR #177](https://github.com/timerloggedout-spec/termux-monorepo/pull/177). + +> This is a consolidation decision, not a merge authorization. The proposal is moved into formal review so independent reviewers can assess a bounded successor. Private-mapper custody, document-projection migration, and networked A2A transport remain excluded pending separate acceptance. + +## Live PR Assessment + +| PR | Live state | Scope signal | Integration disposition | +|---|---|---:|---| +| [#154](https://github.com/timerloggedout-spec/termux-monorepo/pull/154) | Open; `DIRTY` and `CONFLICTING` | 165 files; 10,678 additions; 97 commits | Keep as historical/review context only. Its CEDRlang, Grimoire, and agent-contact content is inseparable from unrelated drift. | +| [#177](https://github.com/timerloggedout-spec/termux-monorepo/pull/177) | Open; `DIRTY` and `CONFLICTING` | 161 files; 10,718 additions; 100 commits | Keep as the principal evidence root. Its live workflow and repository changes are not an integration source. | +| [#275](https://github.com/timerloggedout-spec/termux-monorepo/pull/275) | Open; rebased on `master-staging`; mergeable | 20 files; 1,651 additions; 5 focused commits | **Selected integration candidate.** It contains the deterministic codec, local A2A validation, bounded review evidence, and explicit non-goals. | + +The successor branch was refreshed onto current `master-staging` commit `21ac9e3`, and its focused translator/protocol suite passes 18 tests with clean selected lint. The current GitHub registry-validation check remains blocked by three inherited orphan proposal directories: `kimi-cloud-offload`, `icm-architect-integration`, and `actions-refinements`. That blocker is unrelated to the successor diff and must not be hidden or waived by a Linguist change. + +## Bounded Relationship Context + +| Root | Evidence class | Current interpretation | +|---|---|---| +| [Issue #182](https://github.com/timerloggedout-spec/termux-monorepo/issues/182) — `Grimiore, CID.py, Lang[CEDR{rename,}]` | Verified title and direct `#177` reference | The explicit Grimiore naming/custody discussion root. Its visible body contains only the `#177` pointer; it does not authorize implementation or expose a mapper. | +| [Issue #117](https://github.com/timerloggedout-spec/termux-monorepo/issues/117) — Agent2Agent Comms Proposal | Verified title and issue metadata | The protocol-design root. PR #275 preserves only local schema validation; no transport, remote mailbox, workflow, or install behavior is adopted. | +| [Issue #181](https://github.com/timerloggedout-spec/termux-monorepo/issues/181) — Compression & Security | Candidate, based on topic; no direct graph edge in the current partial index | Security-review destination for any future mapper custody or authenticated transport proposal, not a reason to extend #275. | +| [Issue #201](https://github.com/timerloggedout-spec/termux-monorepo/issues/201) — AGENTS.md | Candidate, based on the `Linguist` label; no direct graph edge in the current partial index | Tracks the eventual human/machine contact-point migration decision. It remains outside the current implementation. | +| [PR #153](https://github.com/timerloggedout-spec/termux-monorepo/pull/153) — Consolidate upgrades and timing quotas SSOT | Candidate, closed PR; no direct graph edge in the current partial index | A historical SSOT precedent, not a dependency of codec or A2A work. | + +The repository-native index was queried at `pr:177`. The current manifest covers only history page 1 and reports `next_start_page: 2`; exact roots for #153, #181, #182, and #201 were absent. The relationships above therefore distinguish direct live GitHub evidence from candidates rather than inferring missing history. + +## Integration Boundary + +The only work proposed for review is the non-executing foundation in #275. It uses a typed canonical intermediate record, deterministic normalization, synthetic test mapper, integrity digest, measurable eligible-token coverage, strict local A2A-envelope parsing, TTL/state/replay validation, and no CID/CEDARscript or external-service dependency. The current required constraints are documented in [`CEDRLANG-GRIMOIRE-A2A.md`](../../CEDRLANG-GRIMOIRE-A2A.md) and the outstanding human decisions remain in [`RESEARCH.md`](../../proposals/active/cedrlang-grimoire-a2a/RESEARCH.md). + +A later proposal, not PR #275, must decide private-mapper custody, canonical human source, generated instruction projections, AGENTS/CLAUDE/ICM/README migration, authenticated transport, and workflow integration. The controlled separation prevents the active Jules work from reintroducing the original document-code-workflow conflation. + +## Required Review Path + +The selected PR is made ready for review after this reconciliation and refreshed branch validation. Reviewers should assess the narrow implementation, the non-executing boundary, the exact coverage definition, the current graph bounds, and the inherited registry failure. They should not treat a review of #275 as approval for the unresolved custody, migration, or remote-transport decisions. + +## References + +1. [PR #154 live metadata](https://github.com/timerloggedout-spec/termux-monorepo/pull/154) +2. [PR #177 live metadata](https://github.com/timerloggedout-spec/termux-monorepo/pull/177) +3. [PR #275 selected successor](https://github.com/timerloggedout-spec/termux-monorepo/pull/275) +4. [Issue #182 Grimiore naming root](https://github.com/timerloggedout-spec/termux-monorepo/issues/182) +5. [Issue #117 Agent2Agent Comms Proposal](https://github.com/timerloggedout-spec/termux-monorepo/issues/117) +6. [Context-relationship graph method](../../../.agents/skills/context-relationship-graph/SKILL.md) diff --git a/docs/reviews/linguist-177/current-integration-relationships.mmd b/docs/reviews/linguist-177/current-integration-relationships.mmd new file mode 100644 index 000000000..141edacc7 --- /dev/null +++ b/docs/reviews/linguist-177/current-integration-relationships.mmd @@ -0,0 +1,29 @@ +flowchart TD + classDef selected fill:#0f766e,color:#ffffff,stroke:#115e59,stroke-width:2px + classDef verified fill:#e0f2fe,color:#0c4a6e,stroke:#0284c7 + classDef candidate fill:#fef3c7,color:#78350f,stroke:#d97706,stroke-dasharray: 5 4 + classDef blocked fill:#fee2e2,color:#7f1d1d,stroke:#dc2626 + classDef boundary fill:#f3f4f6,color:#374151,stroke:#6b7280 + + I182[Issue #182
Grimiore / CID / CEDR rename]:::verified + PR177[PR #177
Linguist compression root
open, dirty, conflicting]:::blocked + PR154[PR #154
Linguist / Grimoire stack
open, dirty, conflicting]:::blocked + I117[Issue #117
Agent2Agent Comms]:::verified + PR275[PR #275
selected successor
review candidate]:::selected + P[CEDRlang proposal
in formal review]:::selected + I181[Issue #181
Compression & Security]:::candidate + I201[Issue #201
AGENTS.md]:::candidate + PR153[PR #153
closed SSOT precedent]:::candidate + B[Future separate proposal
mapper custody, document projection,
authenticated transport]:::boundary + + I182 -->|explicit #177 reference| PR177 + PR177 -->|evidence root only| PR275 + PR154 -->|historical review context only| PR275 + I117 -->|local A2A schema boundary| PR275 + PR275 -->|implements bounded foundation| P + P -->|requires separate acceptance| B + I181 -.->|candidate security-review destination| B + I201 -.->|candidate migration destination| B + PR153 -.->|candidate SSOT precedent| P + + linkStyle 4,5,6 stroke:#d97706,stroke-dasharray: 5 4 From 1c757222b32f59f1e46b5aef650571cf65a94cc7 Mon Sep 17 00:00:00 2001 From: Manus Date: Fri, 21 Aug 2026 18:59:09 +0000 Subject: [PATCH 7/8] fix(cedrlang): resolve codec and envelope review findings Agent-Identity: Manus Task-Ref: LGA-01 Signed-off-by: Manus --- .../active/cedrlang-grimoire-a2a/source.md | 2 +- .../CURRENT-INTEGRATION-RECONCILIATION.md | 6 +- .../linguist-177/LINGUIST-REVIEW-PACKET.md | 11 +-- .../linguist-177/PUBLICATION-RECORD.md | 4 +- tests/test_cedrlang_protocol.py | 72 ++++++++++++++++ .../compression_sandbox/cedrlang/protocol.py | 85 ++++++++++++++----- 6 files changed, 147 insertions(+), 33 deletions(-) diff --git a/docs/proposals/active/cedrlang-grimoire-a2a/source.md b/docs/proposals/active/cedrlang-grimoire-a2a/source.md index 96bc9e43b..56deb5a23 100644 --- a/docs/proposals/active/cedrlang-grimoire-a2a/source.md +++ b/docs/proposals/active/cedrlang-grimoire-a2a/source.md @@ -32,4 +32,4 @@ The decision is based on the bounded graph rooted at PR #177, all-state title in ## Pending Approval Boundary -This record governs only the deterministic local foundation. It does **not** authorize a private mapper service, a public obfuscation claim, authenticated transport, CEDARscript/CID integration, external installation, or a migration of agent-contact documents. `RESEARCH.md` records the outstanding custody, canonical-source, transport, coverage, baseline-remediation, review, and vote requirements. The proposal remains `draft` until those decisions and a non-author review are recorded. +This record governs only the deterministic local foundation. It does **not** authorize a private mapper service, a public obfuscation claim, authenticated transport, CEDARscript/CID integration, external installation, or a migration of agent-contact documents. `RESEARCH.md` records the outstanding custody, canonical-source, transport, coverage, baseline-remediation, review, and vote requirements. The proposal is `in_review`; it cannot advance to `accepted` until requested findings are resolved and the required non-author review and acceptance evidence are recorded. diff --git a/docs/reviews/linguist-177/CURRENT-INTEGRATION-RECONCILIATION.md b/docs/reviews/linguist-177/CURRENT-INTEGRATION-RECONCILIATION.md index 02242b116..6d665f6f3 100644 --- a/docs/reviews/linguist-177/CURRENT-INTEGRATION-RECONCILIATION.md +++ b/docs/reviews/linguist-177/CURRENT-INTEGRATION-RECONCILIATION.md @@ -12,9 +12,9 @@ |---|---|---:|---| | [#154](https://github.com/timerloggedout-spec/termux-monorepo/pull/154) | Open; `DIRTY` and `CONFLICTING` | 165 files; 10,678 additions; 97 commits | Keep as historical/review context only. Its CEDRlang, Grimoire, and agent-contact content is inseparable from unrelated drift. | | [#177](https://github.com/timerloggedout-spec/termux-monorepo/pull/177) | Open; `DIRTY` and `CONFLICTING` | 161 files; 10,718 additions; 100 commits | Keep as the principal evidence root. Its live workflow and repository changes are not an integration source. | -| [#275](https://github.com/timerloggedout-spec/termux-monorepo/pull/275) | Open; rebased on `master-staging`; mergeable | 20 files; 1,651 additions; 5 focused commits | **Selected integration candidate.** It contains the deterministic codec, local A2A validation, bounded review evidence, and explicit non-goals. | +| [#275](https://github.com/timerloggedout-spec/termux-monorepo/pull/275) | Open; non-draft; requested review changes pending | Bounded successor scope; current head is under review remediation | **Selected integration candidate.** It contains the deterministic codec, local A2A validation, bounded review evidence, and explicit non-goals; no integration claim is made until requested findings are resolved and review is accepted. | -The successor branch was refreshed onto current `master-staging` commit `21ac9e3`, and its focused translator/protocol suite passes 18 tests with clean selected lint. The current GitHub registry-validation check remains blocked by three inherited orphan proposal directories: `kimi-cloud-offload`, `icm-architect-integration`, and `actions-refinements`. That blocker is unrelated to the successor diff and must not be hidden or waived by a Linguist change. +The successor branch was refreshed onto current `master-staging` commit `21ac9e3`; its pre-review translator/protocol suite passed 18 tests with clean selected lint. PR #275 currently reports a failing external `ci/gitlab/gitlab.com` status and requested CodeRabbit changes. The external status is recorded for visibility rather than classified as repository-owned validation, and it does not waive any local or repository gate. The inherited syntax and registry blockers are now isolated in PRs #288 and #290 respectively; until those focused remediations are independently integrated, they remain baseline dependencies outside the successor diff. ## Bounded Relationship Context @@ -36,7 +36,7 @@ A later proposal, not PR #275, must decide private-mapper custody, canonical hum ## Required Review Path -The selected PR is made ready for review after this reconciliation and refreshed branch validation. Reviewers should assess the narrow implementation, the non-executing boundary, the exact coverage definition, the current graph bounds, and the inherited registry failure. They should not treat a review of #275 as approval for the unresolved custody, migration, or remote-transport decisions. +The selected PR is non-draft and has requested CodeRabbit changes under resolution. Reviewers should assess the narrow implementation, the non-executing boundary, exact phrase/token coverage and lossless casing behavior, envelope isolation and time validation, the current graph bounds, the observed external GitLab status, and the separately scoped baseline remediations. They should not treat a review of #275 as approval for the unresolved custody, migration, or remote-transport decisions. ## References diff --git a/docs/reviews/linguist-177/LINGUIST-REVIEW-PACKET.md b/docs/reviews/linguist-177/LINGUIST-REVIEW-PACKET.md index 90eafe670..330dd0fb8 100644 --- a/docs/reviews/linguist-177/LINGUIST-REVIEW-PACKET.md +++ b/docs/reviews/linguist-177/LINGUIST-REVIEW-PACKET.md @@ -12,7 +12,7 @@ The Linguist workstream contains a useful performance-oriented public document translator, but its present implementation does not substantiate the requested internal-mapper, measured-70%, clean-transmission, or Agent2Agent protocol claims. The current regex codec, tracked CEDARscript pointer index, and public Grimoire diction sources represent separate concerns that have drifted into one role. The two open focal pull requests are both broad, dirty stacks and are unsuitable targets for incremental repair. The evidence-supported disposition is to preserve only isolated value in a clean, governed successor branch rather than amend or force-merge those stacks. [1] [2] -A bounded implementation has been added on the successor branch. It introduces a deterministic, non-executing CIR codec, bijective synthetic mapper contract, integrity digest, measurable eligible-token coverage report, and local A2A envelope validator. It deliberately excludes private mapper contents, CEDARscript/CID execution, public transformed postings, workflow changes, external installation, and any migration of root agent contact files. The work remains **conditional** because the repository gate and full proposal-registry validator have inherited baseline blockers, and proposal acceptance/non-author review remain pending. +A bounded implementation has been added on the successor branch. It introduces a deterministic, non-executing CIR codec, bijective synthetic mapper contract, integrity digest, measurable eligible-token coverage report, and local A2A envelope validator. It deliberately excludes private mapper contents, CEDARscript/CID execution, public transformed postings, workflow changes, external installation, and any migration of root agent contact files. The work remains **conditional**: PR #275 is non-draft but has requested review changes pending resolution, it reports a failing external GitLab status, and proposal acceptance/non-author review remain pending. The external status is preserved as observed context, not treated as a repository-owned gate or a waiver. The former syntax and registry baseline blockers are now isolated in PRs #288 and #290, pending their independent integration. | Disposition | Rationale | |---|---| @@ -63,7 +63,7 @@ The Mermaid source for both the generated raw graph and the concise evidence sum ## Successor Implementation -The new work is registered as proposal `cedrlang-grimoire-a2a` and its first work item, `LGA-01`. The proposal remains **draft** pending required non-author review and formal acceptance; the feature branch is a Tier-0 implementation/research artifact, not a merge request or an institutional acceptance claim. +The new work is registered as proposal `cedrlang-grimoire-a2a` and its first work item, `LGA-01`. The proposal is **in review** pending resolution of requested findings, required non-author review, and formal acceptance; the feature branch is a Tier-0 implementation/research artifact, not an institutional acceptance claim. | Delivered component | What it does | What it deliberately does not do | |---|---|---| @@ -76,15 +76,16 @@ The new work is registered as proposal `cedrlang-grimoire-a2a` and its first wor | Validation | Result | Notes | |---|---|---| -| `python3 -m pytest tests/test_cedrlang.py tests/test_cedrlang_protocol.py -q` | **Pass: 18 tests** | 11 historical translator tests plus 7 new foundation tests passed. | +| `python3 -m pytest tests/test_cedrlang.py tests/test_cedrlang_protocol.py -q` | **Pass: 20 tests** | 11 historical translator tests plus 9 foundation/regression tests passed, including phrase matching, mixed-case preservation, immutable payload snapshots, future-time rejection, and exact-TTL expiry. | | `python3 -m compileall -q workspace/compression_sandbox/cedrlang/protocol.py tests/test_cedrlang_protocol.py` | **Pass** | New implementation and tests compile. | | `ruff check --select F,E9 …` | **Pass** | Compatibility-focused linting is clean. The repository’s global Ruff defaults suggest modern typing rewrites that are not adopted because the documented Python floor is 3.9. | | Dependency boundary scan | **Pass** | No execution, network, CID, or CEDARscript import/invocation pattern exists in `protocol.py`. | | Scoped credential-signature scan | **Pass** | No credential signatures or private mapper contents were found in new implementation/docs/evidence files. | | `git diff --cached --check` | **Pass** | No staged whitespace error remains. | | `python3 scripts/ci/termux_smoke.py` | **Pass** | Smoke gate passed on Linux with Python 3.12.3; Termux-specific checks were reported as non-blocking environment notes. | -| `python3 scripts/ci/repo_gate.py` | **Blocked by inherited failure** | Fails on pre-existing `archwiz/linear_sync.py:237` syntax, outside the scoped diff. The gate compares to `origin/master`, so it also sees inherited `master-staging` divergence. | -| `python3 scripts/proposals/validate_registry.py` | **Blocked by inherited failure** | Full YAML validation reports existing orphan active directories: `actions-refinements`, `icm-architect-integration`, and `kimi-cloud-offload`; none are part of the staged change. | +| `python3 scripts/ci/repo_gate.py` | **Baseline dependency remediated separately** | The inherited `archwiz/linear_sync.py:237` syntax is repaired in focused PR #288, which passes the index-based gate; it remains a dependency until independently integrated. | +| `python3 scripts/proposals/validate_registry.py` | **Baseline dependency remediated separately** | The orphan active directories are registered in focused PR #290, where validation reports 11 proposals consistent with disk; it remains a dependency until independently integrated. | +| `ci/gitlab/gitlab.com` on PR #275 | **External status failure observed** | The current GitLab status is failing. It is recorded for reviewer visibility, is not repository-owned evidence, and does not waive local or repository gates. | ## Unposted Draft Review for PR #177 diff --git a/docs/reviews/linguist-177/PUBLICATION-RECORD.md b/docs/reviews/linguist-177/PUBLICATION-RECORD.md index 051ad2308..41d0d6308 100644 --- a/docs/reviews/linguist-177/PUBLICATION-RECORD.md +++ b/docs/reviews/linguist-177/PUBLICATION-RECORD.md @@ -11,7 +11,7 @@ | Target | Published record | Purpose | |---|---|---| | New tracked issue | [#274](https://github.com/timerloggedout-spec/termux-monorepo/issues/274) | Labels: `Linguist`, `documentation`, `agent`, `priority`, `high-priority`; contains subtask checklist, evidence links, Mermaid sources/images, Python implementation/test links, research/vote links, and related history. | -| Draft successor PR | [#275](https://github.com/timerloggedout-spec/termux-monorepo/pull/275) | Draft from `feature/cedrlang-grimoire-a2a` to `master-staging`; references `LGA-01`–`LGA-04` and `LGA-06`; no merge claim. | +| Review successor PR | [#275](https://github.com/timerloggedout-spec/termux-monorepo/pull/275) | Non-draft successor from `feature/cedrlang-grimoire-a2a` to `master-staging`; references `LGA-01`–`LGA-04` and `LGA-06`; no merge claim. | | Operator gate record | [#175 comment](https://github.com/timerloggedout-spec/termux-monorepo/issues/175#issuecomment-5361403327) | Connects the review findings, branch, blockers, and A2A follow-up. | | A2A proposal | [#117 comment](https://github.com/timerloggedout-spec/termux-monorepo/issues/117#issuecomment-5361410703) | Connects the local A2A envelope foundation while preserving the no-external-install boundary. | | Open Linguist stacks | [#154 comment](https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5361406746) and [#177 comment](https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5361408055) | Records the successor relationship and no-force-merge disposition without submitting a PR approval or review verdict. | @@ -38,4 +38,4 @@ GitHub Project v2 discovery was attempted with the authenticated token, but the ## Validation State -The successor branch passed 18 focused/regression tests, compilation, compatibility lint, dependency-boundary scanning, credential-signature scanning, staged whitespace validation, and Termux smoke. The repository gate remains blocked by inherited `archwiz/linear_sync.py:237` syntax, and full proposal-registry validation remains blocked by pre-existing orphan active directories. Proposal status remains `draft`; independent non-author review and operator acceptance are still required before any merge or integration claim. +The successor’s pre-review baseline passed 18 focused/regression tests, compilation, compatibility lint, dependency-boundary scanning, credential-signature scanning, staged whitespace validation, and Termux smoke. As of 2026-08-21, PR #275 is non-draft and the CodeRabbit review has requested changes; those findings are being resolved on the successor branch before any acceptance claim. The PR also reports a failing external `ci/gitlab/gitlab.com` status. That status is recorded as external context rather than represented as a repository-owned validation result, and it does not waive any repository gate. The inherited `archwiz/linear_sync.py:237` syntax and proposal-registry orphan blockers have separately scoped remediation PRs #288 and #290; until integrated, they remain baseline dependencies outside the CEDRlang diff. The proposal status is `in_review`; independent non-author review and operator acceptance remain required before any merge or integration claim. diff --git a/tests/test_cedrlang_protocol.py b/tests/test_cedrlang_protocol.py index e8d70a8fd..4c803e391 100644 --- a/tests/test_cedrlang_protocol.py +++ b/tests/test_cedrlang_protocol.py @@ -85,6 +85,51 @@ def test_mapper_rejects_duplicate_symbol_handles(): ) +def test_codec_encodes_multi_word_mapper_sources_deterministically(): + mapper = GrimoireMapper( + mapper_id="phrase-grimoire", + version="1.0.0", + forward={"inspect system": "§IS§", "status": "§T§", "unit-test": "§U§"}, + ) + record = CanonicalRecord( + schema_version="cedrlang.cir/v1", + document_id="phrase-record", + purpose="inspect system status", + directives=[], + constraints=[], + inputs=[], + outputs=[], + provenance="unit-test", + ) + + encoded, report = encode_record(record, mapper, minimum_coverage=1.0) + + assert encoded["record"]["purpose"] == [{"symbol": "§IS§"}, {"text": " "}, {"symbol": "§T§"}] + assert report.coverage_ratio == 1.0 + assert decode_record(encoded, mapper) == record + + +def test_codec_retains_mixed_case_tokens_when_mapper_cannot_reconstruct_case(): + mapper = build_mapper() + record = CanonicalRecord( + schema_version="cedrlang.cir/v1", + document_id="mixed-case-record", + purpose="Inspect system status", + directives=[], + constraints=[], + inputs=[], + outputs=[], + provenance="unit-test", + ) + + encoded, _ = encode_record(record, mapper) + decoded = decode_record(encoded, mapper) + + assert encoded["record"]["purpose"][0] == {"text": "Inspect "} + assert decoded == record + assert decoded.digest() == encoded["canonical_digest"] + + def test_codec_is_lossless_deterministic_and_measures_eligible_coverage(): mapper = build_mapper() record = build_record() @@ -168,9 +213,15 @@ def test_a2a_envelope_validates_digest_ttl_state_and_replay_behavior(): assert classify_replay({envelope.message_id: envelope.canonical_digest}, envelope) == "idempotent_duplicate" assert classify_replay({envelope.message_id: "different"}, envelope) == "conflict" + with pytest.raises(A2AValidationError): + validate_a2a_envelope(envelope, mapper, now=now + timedelta(seconds=60)) + with pytest.raises(A2AValidationError): validate_a2a_envelope(envelope, mapper, now=now + timedelta(seconds=61)) + with pytest.raises(A2AValidationError): + validate_a2a_envelope(envelope, mapper, now=now - timedelta(seconds=1)) + acknowledged = envelope.transition("ACK", acknowledgement_id="ack-001") assert acknowledged.state == "ACK" with pytest.raises(A2AValidationError): @@ -196,6 +247,27 @@ def test_a2a_envelope_serialization_rejects_unknown_missing_and_malformed_payloa ttl_seconds=60, ) + source_payload = deepcopy(encoded) + isolated = A2AEnvelope( + protocol_version="cedrlang.a2a/v1", + message_id=str(uuid4()), + sender_role="linguist", + recipient_role="reviewer", + correlation_id=str(uuid4()), + intent="instruction-transfer", + mapper_id=mapper.mapper_id, + mapper_version=mapper.version, + payload=source_payload, + canonical_digest=record.digest(), + issued_at=datetime(2026, 8, 20, tzinfo=timezone.utc).isoformat(), + ttl_seconds=60, + ) + source_payload["record"]["purpose"][0] = {"text": "mutated source"} + detached = isolated.to_dict() + detached["payload"]["record"]["purpose"][0] = {"text": "mutated serialization"} + assert isolated.to_dict()["payload"] == encoded + assert isolated.transition("ACK", acknowledgement_id="ack-001").to_dict()["payload"] == encoded + serialized = envelope.to_dict() assert A2AEnvelope.from_dict(serialized) == envelope assert set(serialized) == { diff --git a/workspace/compression_sandbox/cedrlang/protocol.py b/workspace/compression_sandbox/cedrlang/protocol.py index 3f0f077d5..68612c434 100644 --- a/workspace/compression_sandbox/cedrlang/protocol.py +++ b/workspace/compression_sandbox/cedrlang/protocol.py @@ -7,13 +7,15 @@ from __future__ import annotations +from collections.abc import Mapping, Sequence from dataclasses import dataclass, field from datetime import datetime, timezone import hashlib import json import re +from types import MappingProxyType import unicodedata -from typing import Any, Dict, List, Mapping, Optional, Sequence, Tuple +from typing import Any, Dict, List, Optional, Tuple from uuid import UUID @@ -117,6 +119,35 @@ def _tokens(text: str) -> Tuple[str, ...]: return tuple(match.group(0).lower() for match in TOKEN_PATTERN.finditer(text)) +def _freeze_json(value: Any) -> Any: + """Return a deeply immutable representation of a JSON-native value.""" + if isinstance(value, Mapping): + return MappingProxyType({key: _freeze_json(item) for key, item in value.items()}) + if isinstance(value, list): + return tuple(_freeze_json(item) for item in value) + return value + + +def _thaw_json(value: Any) -> Any: + """Return a detached, mutable JSON-compatible copy of a frozen snapshot.""" + if isinstance(value, Mapping): + return {key: _thaw_json(item) for key, item in value.items()} + if isinstance(value, tuple): + return [_thaw_json(item) for item in value] + return value + + +def _snapshot_json_object(value: Mapping[str, Any]) -> Mapping[str, Any]: + """Canonicalize, validate, and deeply freeze an object for envelope storage.""" + try: + snapshot = json.loads(_canonical_json(_thaw_json(value))) + except (TypeError, ValueError) as exc: + raise A2AValidationError("payload must be JSON-serializable") from exc + if not isinstance(snapshot, dict): + raise A2AValidationError("payload must be an encoded record object") + return _freeze_json(snapshot) + + @dataclass(frozen=True) class CanonicalRecord: """The authoritative normalized form for a CEDRlang instruction record.""" @@ -192,8 +223,10 @@ def __post_init__(self) -> None: for source, handle in self.forward.items(): source_key = _normalize_text(source).lower() handle_value = _normalize_text(handle) - if not source_key or not HANDLE_PATTERN.fullmatch(handle_value): - raise MapperValidationError("mapper entries require a token and a well-formed symbolic handle") + if not source_key or not re.fullmatch(r"[\w-]+(?:[ \t]+[\w-]+)*", source_key, re.UNICODE): + raise MapperValidationError("mapper sources must be normalized tokens or whitespace-separated phrases") + if not HANDLE_PATTERN.fullmatch(handle_value): + raise MapperValidationError("mapper entries require a well-formed symbolic handle") if source_key in normalized_forward: raise MapperValidationError("mapper contains duplicate normalized source tokens") if handle_value in normalized_reverse: @@ -239,30 +272,37 @@ def to_dict(self) -> Dict[str, Any]: def _encode_text(text: str, mapper: GrimoireMapper, eligible: bool) -> Tuple[List[Dict[str, str]], int, int]: + """Encode exact-case mapper tokens or phrases while retaining non-lossless literals.""" + if not eligible: + return [{"text": text}], 0, 0 + + source_keys = sorted(mapper.forward, key=lambda source: (-len(_tokens(source)), -len(source), source)) + phrase_pattern = re.compile( + r"(? cursor: segments.append({"text": text[cursor:match.start()]}) - token = match.group(0) - normalized = token.lower() - if eligible: - total += 1 - if eligible and normalized in mapper.forward: - segments.append({"symbol": mapper.forward[normalized]}) - replaced += 1 + phrase = match.group(0) + # A lower-cased mapper key cannot reconstruct mixed-case source text. Retain + # that literal rather than silently changing the canonical digest on decode. + if phrase in mapper.forward: + segments.append({"symbol": mapper.forward[phrase]}) + replaced += len(_tokens(phrase)) else: - segments.append({"text": token}) + segments.append({"text": phrase}) cursor = match.end() if cursor < len(text) or not segments: segments.append({"text": text[cursor:]}) - return segments, replaced, total + return segments, replaced, len(_tokens(text)) def _decode_text(segments: Any, mapper: GrimoireMapper) -> str: - if not isinstance(segments, list): + if not isinstance(segments, Sequence) or isinstance(segments, (str, bytes)): raise IntegrityError("encoded text must be a list of literal or symbolic segments") decoded: List[str] = [] for segment in segments: @@ -369,7 +409,7 @@ def decode_record(encoded: Mapping[str, Any], mapper: GrimoireMapper) -> Canonic if field_name in {"purpose", "provenance"}: decoded[field_name] = _decode_text(raw[field_name], mapper) else: - if not isinstance(raw[field_name], list): + if not isinstance(raw[field_name], Sequence) or isinstance(raw[field_name], (str, bytes)): raise IntegrityError(f"encoded {field_name} must be a list") decoded[field_name] = [_decode_text(item, mapper) for item in raw[field_name]] record = CanonicalRecord.from_dict(decoded) @@ -442,12 +482,11 @@ def __post_init__(self) -> None: raise A2AValidationError("ACK envelopes require acknowledgement_id") if self.state == "NACK" and not self.error_code: raise A2AValidationError("NACK envelopes require error_code") - try: - payload_bytes = len(_canonical_json(dict(self.payload)).encode("utf-8")) - except (TypeError, ValueError) as exc: - raise A2AValidationError("payload must be JSON-serializable") from exc + payload_snapshot = _snapshot_json_object(self.payload) + payload_bytes = len(_canonical_json(_thaw_json(payload_snapshot)).encode("utf-8")) if payload_bytes > MAX_PAYLOAD_BYTES: raise A2AValidationError("payload exceeds the local A2A size limit") + object.__setattr__(self, "payload", payload_snapshot) _parse_utc(self.issued_at) def to_dict(self) -> Dict[str, Any]: @@ -461,7 +500,7 @@ def to_dict(self) -> Dict[str, Any]: "intent": self.intent, "mapper_id": self.mapper_id, "mapper_version": self.mapper_version, - "payload": dict(self.payload), + "payload": _thaw_json(self.payload), "canonical_digest": self.canonical_digest, "issued_at": self.issued_at, "ttl_seconds": self.ttl_seconds, @@ -521,7 +560,9 @@ def validate_a2a_envelope( raise A2AValidationError("validation time must include a UTC offset") issued = _parse_utc(envelope.issued_at) now_utc = now.astimezone(timezone.utc) - if now_utc > issued and (now_utc - issued).total_seconds() > envelope.ttl_seconds: + if now_utc < issued: + raise A2AValidationError("envelope issued_at is in the future") + if (now_utc - issued).total_seconds() >= envelope.ttl_seconds: raise A2AValidationError("envelope TTL has expired") record = decode_record(envelope.payload, mapper) if record.digest() != envelope.canonical_digest: From 771f2b665c637fc747c12d92423cee4af9ffe216 Mon Sep 17 00:00:00 2001 From: Manus Date: Fri, 21 Aug 2026 19:05:29 +0000 Subject: [PATCH 8/8] fix(cedrlang): harden review invariants and evidence Agent-Identity: Manus Task-Ref: LGA-01, LGA-02, LGA-03, LGA-04, LGA-06 Signed-off-by: Manus --- docs/CEDRLANG-GRIMOIRE-A2A.md | 2 +- .../active/cedrlang-grimoire-a2a/MANIFEST.md | 2 +- .../active/cedrlang-grimoire-a2a/RESEARCH.md | 4 +- .../CURRENT-INTEGRATION-RECONCILIATION.md | 2 +- .../linguist-177/LINGUIST-REVIEW-PACKET.md | 6 +-- .../linguist-177/agent-contact-inventory.md | 6 +-- docs/reviews/linguist-177/context-pr154.md | 2 +- .../current-integration-relationships.mmd | 4 +- tests/test_cedrlang_protocol.py | 52 +++++++++++++++++++ .../compression_sandbox/cedrlang/protocol.py | 49 +++++++++++------ 10 files changed, 98 insertions(+), 31 deletions(-) diff --git a/docs/CEDRLANG-GRIMOIRE-A2A.md b/docs/CEDRLANG-GRIMOIRE-A2A.md index d4462ee4a..a1b4d2037 100644 --- a/docs/CEDRLANG-GRIMOIRE-A2A.md +++ b/docs/CEDRLANG-GRIMOIRE-A2A.md @@ -69,7 +69,7 @@ CEDARscript / CID / patch router ## Implementation Reference -The initial implementation is `workspace/compression_sandbox/cedrlang/protocol.py`. Its focused tests are `tests/test_cedrlang_protocol.py`. Work is tracked as proposal `cedrlang-grimoire-a2a`, item `LGA-01`; later migration work must receive separately scoped work items. +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 diff --git a/docs/proposals/active/cedrlang-grimoire-a2a/MANIFEST.md b/docs/proposals/active/cedrlang-grimoire-a2a/MANIFEST.md index 8d02c884b..451488df6 100644 --- a/docs/proposals/active/cedrlang-grimoire-a2a/MANIFEST.md +++ b/docs/proposals/active/cedrlang-grimoire-a2a/MANIFEST.md @@ -48,7 +48,7 @@ This proposal reconstructs the useful, independently testable core of the Lingui ### 2026-08-21 — consolidation and formal-review request - Disposition: in_review -- Notes: The successor branch was rebased onto current `master-staging` and validated with 18 focused/regression tests and 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 Grimiore/CID/CEDR naming root; issue #117 remains the A2A design root. See `CURRENT-INTEGRATION-RECONCILIATION.md` and `current-integration-relationships.mmd`. The inherited registry-orphan failure remains a documented blocker; it is not waived. +- 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) diff --git a/docs/proposals/active/cedrlang-grimoire-a2a/RESEARCH.md b/docs/proposals/active/cedrlang-grimoire-a2a/RESEARCH.md index 41acfdf82..0d623f80f 100644 --- a/docs/proposals/active/cedrlang-grimoire-a2a/RESEARCH.md +++ b/docs/proposals/active/cedrlang-grimoire-a2a/RESEARCH.md @@ -14,7 +14,7 @@ ## Required Independent Review -A non-author reviewer must evaluate the following before the proposal status can move from `draft` to `accepted`: +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. @@ -27,7 +27,7 @@ A non-author reviewer must evaluate the following before the proposal status can | 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. | -| _Unassigned_ | non-author technical reviewer | pending | — | Required before acceptance. | +| 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 diff --git a/docs/reviews/linguist-177/CURRENT-INTEGRATION-RECONCILIATION.md b/docs/reviews/linguist-177/CURRENT-INTEGRATION-RECONCILIATION.md index 6d665f6f3..ab1819eb0 100644 --- a/docs/reviews/linguist-177/CURRENT-INTEGRATION-RECONCILIATION.md +++ b/docs/reviews/linguist-177/CURRENT-INTEGRATION-RECONCILIATION.md @@ -1,4 +1,4 @@ -# Current Linguist / Grimiore / A2A Integration Reconciliation +# Current Linguist / Grimoire / A2A Integration Reconciliation **As of:** 2026-08-21 UTC diff --git a/docs/reviews/linguist-177/LINGUIST-REVIEW-PACKET.md b/docs/reviews/linguist-177/LINGUIST-REVIEW-PACKET.md index 330dd0fb8..0c8b8f822 100644 --- a/docs/reviews/linguist-177/LINGUIST-REVIEW-PACKET.md +++ b/docs/reviews/linguist-177/LINGUIST-REVIEW-PACKET.md @@ -39,9 +39,7 @@ The authenticated GitHub CLI could not be used because its configured credential The generated graph used the exact root `pr:177`, depth `2`, and a 25-node limit. It contains verified commit, review, review-comment, issue-comment, and source-file relationships. The canonical index is current to 2026-08-19 but has a retained **partial** GitHub history window with `next_start_page: 2`; this packet therefore does not claim complete historical graph coverage. [5] [6] -![Curated Linguist relationship summary](linguist-relationship-summary.png) - -The Mermaid source for both the generated raw graph and the concise evidence summary is committed under this directory. The PNG render artifacts remain intentionally ignored by the repository and are supplied as task attachments. The raw graph, rendering validation, evidence bounds, and candidate separation are documented in `context-pr177.md`, `context-pr177.mmd`, `linguist-relationship-summary.mmd`, and `diagram-validation.md`. +The Mermaid source for both the generated raw graph and the concise evidence summary is committed under this directory. Rendered PNG artifacts are intentionally not linked from tracked Markdown because they are ignored by the repository; the raw graph, rendering validation, evidence bounds, and candidate separation are documented in `context-pr177.md`, `context-pr177.mmd`, `linguist-relationship-summary.mmd`, and `diagram-validation.md`. | Verified relationship | Evidence | |---|---| @@ -76,7 +74,7 @@ The new work is registered as proposal `cedrlang-grimoire-a2a` and its first wor | Validation | Result | Notes | |---|---|---| -| `python3 -m pytest tests/test_cedrlang.py tests/test_cedrlang_protocol.py -q` | **Pass: 20 tests** | 11 historical translator tests plus 9 foundation/regression tests passed, including phrase matching, mixed-case preservation, immutable payload snapshots, future-time rejection, and exact-TTL expiry. | +| `python3 -m pytest tests/test_cedrlang.py tests/test_cedrlang_protocol.py -q` | **Pass: 21 tests** | 11 historical translator tests plus 10 foundation/regression tests passed, including immutable mapper snapshots, phrase matching, mixed-case preservation, strict JSON payloads, typed envelope metadata, immutable payload snapshots, future-time rejection, and exact-TTL expiry. | | `python3 -m compileall -q workspace/compression_sandbox/cedrlang/protocol.py tests/test_cedrlang_protocol.py` | **Pass** | New implementation and tests compile. | | `ruff check --select F,E9 …` | **Pass** | Compatibility-focused linting is clean. The repository’s global Ruff defaults suggest modern typing rewrites that are not adopted because the documented Python floor is 3.9. | | Dependency boundary scan | **Pass** | No execution, network, CID, or CEDARscript import/invocation pattern exists in `protocol.py`. | diff --git a/docs/reviews/linguist-177/agent-contact-inventory.md b/docs/reviews/linguist-177/agent-contact-inventory.md index aacdc5e0d..e61526801 100644 --- a/docs/reviews/linguist-177/agent-contact-inventory.md +++ b/docs/reviews/linguist-177/agent-contact-inventory.md @@ -50,9 +50,9 @@ The initial implementation scope is therefore limited to a clean, non-executing ## References -1. [Root AGENTS.md](../../AGENTS.md) -2. [Root CLAUDE.md](../../CLAUDE.md) -3. [Change and Validate ICM process](../../docs/icm/processes/change-and-validate.md) +1. [Root AGENTS.md](../../../AGENTS.md) +2. [Root CLAUDE.md](../../../CLAUDE.md) +3. [Change and Validate ICM process](../../icm/processes/change-and-validate.md) 4. [PR #154 operator scope guidance](https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5322143674) 5. [PR #177 mapping discussion](https://github.com/timerloggedout-spec/termux-monorepo/pull/177#issuecomment-5273315069) 6. [CEDARScript Editor (Python)](https://github.com/CEDARScript/cedarscript-editor-python) diff --git a/docs/reviews/linguist-177/context-pr154.md b/docs/reviews/linguist-177/context-pr154.md index ce4454b98..6bc0d3a31 100644 --- a/docs/reviews/linguist-177/context-pr154.md +++ b/docs/reviews/linguist-177/context-pr154.md @@ -17,7 +17,7 @@ | 2026-08-10T23:44:17Z | COMMENTS_ON | `workspace/compression_sandbox/cedrlang/cedrlang.py` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#discussion_r3754263042 | | 2026-08-10T23:44:17Z | COMMENTS_ON | `bin/cedrlang` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#discussion_r3754262283 | | 2026-08-10T23:44:17Z | COMMENTS_ON | `workspace/compression_sandbox/cedrlang/cedrlang.py` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#discussion_r3754262463 | -| 2026-08-10T23:44:17Z | REVIEWS | `4901837682` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#pullrequestreview-4901837682
https://github.com/timerloggedout-spec/termux-monorepo/pull/154#pullrequestreview-4901837682 | +| 2026-08-10T23:44:17Z | REVIEWS | `4901837682` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#pullrequestreview-4901837682 | | 2026-08-10T23:44:25Z | COMMENTS_ON | `5247317455` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247317455 | | 2026-08-10T23:44:25Z | REFERENCES | `5247317455` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247317455 | | 2026-08-10T23:44:43Z | COMMENTS_ON | `5247319394` | `📖 Linguist: Overhaul CedrLang v2 compression, map grimoire & build AGENTS.hum.md` | https://github.com/timerloggedout-spec/termux-monorepo/pull/154#issuecomment-5247319394 | diff --git a/docs/reviews/linguist-177/current-integration-relationships.mmd b/docs/reviews/linguist-177/current-integration-relationships.mmd index 141edacc7..85be41d8f 100644 --- a/docs/reviews/linguist-177/current-integration-relationships.mmd +++ b/docs/reviews/linguist-177/current-integration-relationships.mmd @@ -5,7 +5,7 @@ flowchart TD classDef blocked fill:#fee2e2,color:#7f1d1d,stroke:#dc2626 classDef boundary fill:#f3f4f6,color:#374151,stroke:#6b7280 - I182[Issue #182
Grimiore / CID / CEDR rename]:::verified + I182[Issue #182
Grimoire / CID / CEDR rename]:::verified PR177[PR #177
Linguist compression root
open, dirty, conflicting]:::blocked PR154[PR #154
Linguist / Grimoire stack
open, dirty, conflicting]:::blocked I117[Issue #117
Agent2Agent Comms]:::verified @@ -26,4 +26,4 @@ flowchart TD I201 -.->|candidate migration destination| B PR153 -.->|candidate SSOT precedent| P - linkStyle 4,5,6 stroke:#d97706,stroke-dasharray: 5 4 + linkStyle 6,7,8 stroke:#d97706,stroke-dasharray: 5 4 diff --git a/tests/test_cedrlang_protocol.py b/tests/test_cedrlang_protocol.py index 4c803e391..d8abc926d 100644 --- a/tests/test_cedrlang_protocol.py +++ b/tests/test_cedrlang_protocol.py @@ -85,6 +85,19 @@ def test_mapper_rejects_duplicate_symbol_handles(): ) +def test_mapper_snapshots_are_immutable_and_hash_stable_after_source_mutation(): + source_mapping = {"inspect": "§I§"} + mapper = GrimoireMapper(mapper_id="immutable-mapper", version="1.0.0", forward=source_mapping) + original_hash = mapper.content_hash + + source_mapping["system"] = "§S§" + + assert dict(mapper.forward) == {"inspect": "§I§"} + assert mapper.content_hash == original_hash + with pytest.raises(TypeError): + mapper.forward["system"] = "§S§" + + def test_codec_encodes_multi_word_mapper_sources_deterministically(): mapper = GrimoireMapper( mapper_id="phrase-grimoire", @@ -302,3 +315,42 @@ def test_a2a_envelope_serialization_rejects_unknown_missing_and_malformed_payloa malformed["payload"] = ["not", "an", "object"] with pytest.raises(A2AValidationError): A2AEnvelope.from_dict(malformed) + + non_json_payload = dict(serialized) + non_json_payload["payload"] = {"value": float("nan")} + with pytest.raises(A2AValidationError): + A2AEnvelope.from_dict(non_json_payload) + + bool_ttl = dict(serialized) + bool_ttl["ttl_seconds"] = True + with pytest.raises(A2AValidationError): + A2AEnvelope.from_dict(bool_ttl) + + invalid_role = dict(serialized) + invalid_role["sender_role"] = "invalid\x00role" + with pytest.raises(A2AValidationError): + A2AEnvelope.from_dict(invalid_role) + + pending_metadata = dict(serialized) + pending_metadata["acknowledgement_id"] = "ack-001" + with pytest.raises(A2AValidationError): + A2AEnvelope.from_dict(pending_metadata) + + invalid_ack = dict(serialized) + invalid_ack["state"] = "ACK" + invalid_ack["acknowledgement_id"] = 7 + with pytest.raises(A2AValidationError): + A2AEnvelope.from_dict(invalid_ack) + + contradictory_ack = dict(serialized) + contradictory_ack["state"] = "ACK" + contradictory_ack["acknowledgement_id"] = "ack-001" + contradictory_ack["error_code"] = "not-allowed" + with pytest.raises(A2AValidationError): + A2AEnvelope.from_dict(contradictory_ack) + + invalid_nack = dict(serialized) + invalid_nack["state"] = "NACK" + invalid_nack["error_code"] = "not allowed" + with pytest.raises(A2AValidationError): + A2AEnvelope.from_dict(invalid_nack) diff --git a/workspace/compression_sandbox/cedrlang/protocol.py b/workspace/compression_sandbox/cedrlang/protocol.py index 68612c434..df9620bb4 100644 --- a/workspace/compression_sandbox/cedrlang/protocol.py +++ b/workspace/compression_sandbox/cedrlang/protocol.py @@ -112,7 +112,7 @@ def _sha256_text(value: str) -> str: def _canonical_json(value: Mapping[str, Any]) -> str: - return json.dumps(value, ensure_ascii=False, sort_keys=True, separators=(",", ":")) + return json.dumps(value, ensure_ascii=False, sort_keys=True, separators=(",", ":"), allow_nan=False) def _tokens(text: str) -> Tuple[str, ...]: @@ -237,8 +237,8 @@ def __post_init__(self) -> None: material = _canonical_json({"mapper_id": mapper_id, "version": version, "forward": normalized_forward}) object.__setattr__(self, "mapper_id", mapper_id) object.__setattr__(self, "version", version) - object.__setattr__(self, "forward", normalized_forward) - object.__setattr__(self, "reverse", normalized_reverse) + object.__setattr__(self, "forward", MappingProxyType(dict(normalized_forward))) + object.__setattr__(self, "reverse", MappingProxyType(dict(normalized_reverse))) object.__setattr__(self, "content_hash", _sha256_text(material)) @@ -462,26 +462,43 @@ def __post_init__(self) -> None: raise A2AValidationError(f"unsupported A2A protocol version: {self.protocol_version}") object.__setattr__(self, "message_id", _validate_uuid(self.message_id, "message_id")) object.__setattr__(self, "correlation_id", _validate_uuid(self.correlation_id, "correlation_id")) - for field_name in ("sender_role", "recipient_role"): - value = _normalize_text(getattr(self, field_name)) - if not ROLE_PATTERN.fullmatch(value): - raise A2AValidationError(f"{field_name} must be a bounded role identifier") - object.__setattr__(self, field_name, value) - object.__setattr__(self, "intent", _normalize_identifier(self.intent, "intent")) - object.__setattr__(self, "mapper_id", _normalize_identifier(self.mapper_id, "mapper_id")) - object.__setattr__(self, "mapper_version", _normalize_text(self.mapper_version)) + try: + for field_name in ("sender_role", "recipient_role"): + value = _normalize_text(getattr(self, field_name)) + if not ROLE_PATTERN.fullmatch(value): + raise A2AValidationError(f"{field_name} must be a bounded role identifier") + object.__setattr__(self, field_name, value) + object.__setattr__(self, "intent", _normalize_identifier(self.intent, "intent")) + object.__setattr__(self, "mapper_id", _normalize_identifier(self.mapper_id, "mapper_id")) + object.__setattr__(self, "mapper_version", _normalize_text(self.mapper_version)) + except RecordValidationError as exc: + raise A2AValidationError("envelope text fields are invalid") from exc if not isinstance(self.payload, Mapping): raise A2AValidationError("payload must be an encoded record object") if not isinstance(self.canonical_digest, str) or not re.fullmatch(r"[0-9a-f]{64}", self.canonical_digest): raise A2AValidationError("canonical_digest must be a SHA-256 hexadecimal digest") - if not isinstance(self.ttl_seconds, int) or not 1 <= self.ttl_seconds <= 86_400: + if type(self.ttl_seconds) is not int or not 1 <= self.ttl_seconds <= 86_400: raise A2AValidationError("ttl_seconds must be between 1 and 86400") if self.state not in {"PENDING", "ACK", "NACK"}: raise A2AValidationError("state must be PENDING, ACK, or NACK") - if self.state == "ACK" and not self.acknowledgement_id: - raise A2AValidationError("ACK envelopes require acknowledgement_id") - if self.state == "NACK" and not self.error_code: - raise A2AValidationError("NACK envelopes require error_code") + try: + if self.state == "PENDING": + if self.acknowledgement_id is not None or self.error_code is not None: + raise A2AValidationError("PENDING envelopes cannot include acknowledgement or error metadata") + elif self.state == "ACK": + if self.error_code is not None or not isinstance(self.acknowledgement_id, str): + raise A2AValidationError("ACK envelopes require only a string acknowledgement_id") + object.__setattr__( + self, + "acknowledgement_id", + _normalize_identifier(self.acknowledgement_id, "acknowledgement_id"), + ) + else: + if self.acknowledgement_id is not None or not isinstance(self.error_code, str): + raise A2AValidationError("NACK envelopes require only a string error_code") + object.__setattr__(self, "error_code", _normalize_identifier(self.error_code, "error_code")) + except RecordValidationError as exc: + raise A2AValidationError("envelope acknowledgement or error metadata is invalid") from exc payload_snapshot = _snapshot_json_object(self.payload) payload_bytes = len(_canonical_json(_thaw_json(payload_snapshot)).encode("utf-8")) if payload_bytes > MAX_PAYLOAD_BYTES: