@@ -16,15 +16,24 @@ It is a proof-preserving context compression and validation workflow for softwar
1616
1717CompText turns noisy project state into structured, reviewable artifacts:
1818
19- ``` text
20- Repository state
21- -> Context Pack
22- -> Policy Gate
23- -> Provider Boundary
24- -> Proposal Artifact
25- -> Apply Gate
26- -> Local Validation
27- -> Report / Evidence
19+ ``` mermaid
20+ flowchart TD
21+ A[Repository state] --> B[Context Inspect]
22+ B --> C[Schema-checked Context Pack]
23+ C --> D[Policy Gate]
24+ D --> E{Provider Intent?}
25+ E -->|dry-run| F[Model Request Artifact]
26+ E -->|dummy| G[Deterministic Dummy Provider]
27+ E -->|local/cloud provider| H[Provider Boundary]
28+ H --> I[Untrusted Provider Response]
29+ G --> I
30+ F --> J[Reviewable Evidence]
31+ I --> K[Proposal Artifact]
32+ K --> L{Human Review}
33+ L -->|approved| M[Apply Gate]
34+ L -->|rejected| N[Stop]
35+ M --> O[Local Validation]
36+ O --> P[Report / Evidence]
2837```
2938
3039The goal is not to send more context to a model.
@@ -33,6 +42,65 @@ The goal is to send the right context, preserve the proof, and keep every risky
3342
3443---
3544
45+ ## Architecture at a Glance
46+
47+ ``` mermaid
48+ flowchart LR
49+ subgraph Source[Project Source]
50+ R[Repository Files]
51+ A[AGENTS.md]
52+ P[PROJEKT.md]
53+ D[docs/]
54+ end
55+
56+ subgraph CompText[ctxt CLI]
57+ CI[context inspect]
58+ CP[context pack]
59+ PG[policy gate]
60+ PA[provider adapter]
61+ PR[propose]
62+ AG[apply gate]
63+ VA[validate]
64+ end
65+
66+ subgraph Artifacts[Proof Artifacts]
67+ CPK[.comptext/context_pack.latest.json]
68+ MR[.comptext/model_request.latest.json]
69+ MS[.comptext/model_response.latest.json]
70+ PP[proposals/*.json]
71+ RP[reports/phase_*_status.md]
72+ end
73+
74+ subgraph Providers[Provider Boundary]
75+ DU[dummy]
76+ OL[ollama-local]
77+ OC[ollama-cloud-direct]
78+ OA[openai-compatible]
79+ end
80+
81+ R --> CI
82+ A --> CI
83+ P --> CI
84+ D --> CI
85+ CI --> CP
86+ CP --> PG
87+ PG --> PA
88+ PA --> DU
89+ PA --> OL
90+ PA --> OC
91+ PA --> OA
92+ PA --> MS
93+ CP --> CPK
94+ PG --> MR
95+ MS --> PR
96+ PR --> PP
97+ PP --> AG
98+ AG --> VA
99+ VA --> RP
100+ ```
101+
102+ ---
103+
36104## Core Principles
37105
38106- Deterministic Context Packs before provider calls
@@ -48,6 +116,60 @@ The goal is to send the right context, preserve the proof, and keep every risky
48116
49117---
50118
119+ ## Trust Boundaries
120+
121+ CompText separates context, provider calls, proposals, and mutation into explicit trust zones.
122+
123+ ``` mermaid
124+ flowchart TD
125+ subgraph Trusted[Trusted Project Inputs]
126+ AG[AGENTS.md]
127+ PJ[PROJEKT.md]
128+ SRC[Source files]
129+ DOC[Docs]
130+ end
131+
132+ subgraph Controlled[Controlled CompText Artifacts]
133+ CP[Context Pack]
134+ REQ[Provider Request Artifact]
135+ PROP[Proposal Artifact]
136+ REP[Validation Report]
137+ end
138+
139+ subgraph Untrusted[Untrusted Inputs]
140+ MOD[Model Output]
141+ PROV[Provider Response]
142+ TOOL[Tool Output]
143+ MCP[MCP Server Output]
144+ PATCH[Generated Patch]
145+ end
146+
147+ subgraph Gates[Policy Gates]
148+ PG[Policy Gate]
149+ HR[Human Review]
150+ AP[Apply Gate]
151+ VAL[Local Validation]
152+ end
153+
154+ Trusted --> CP
155+ CP --> PG
156+ PG --> REQ
157+ REQ --> PROV
158+ PROV --> PROP
159+ MOD --> PROP
160+ TOOL --> PROP
161+ MCP --> PROP
162+ PATCH --> PROP
163+ PROP --> HR
164+ HR --> AP
165+ AP --> VAL
166+ VAL --> REP
167+
168+ Untrusted -.must be reviewed.-> HR
169+ ```
170+
171+ ---
172+
51173## Current Status
52174
53175``` text
@@ -59,6 +181,35 @@ Last green phase: Phase 4C
59181Status: active
60182```
61183
184+ ``` mermaid
185+ stateDiagram-v2
186+ [*] --> Phase0
187+ Phase0: Repo Genesis & Bootstrap
188+ Phase1: CLI Shell Hardening
189+ Phase2: Context Pack Contract
190+ Phase3: Provider Adapter Layer / Dummy Provider
191+ Phase4: Ollama Local Adapter
192+ Phase4B: Skill Registry Normalization
193+ Phase4C: Long-Run Autonomy Hardening
194+ Phase5: Proposal Mode
195+ Phase6: Apply Gate
196+ Phase7: Provider Config Layer
197+ Phase8: OpenAI-Compatible Adapter
198+ Phase9: Validate and Benchmark
199+
200+ Phase0 --> Phase1: complete
201+ Phase1 --> Phase2: complete
202+ Phase2 --> Phase3: complete
203+ Phase3 --> Phase4: complete
204+ Phase4 --> Phase4B: complete
205+ Phase4B --> Phase4C: complete
206+ Phase4C --> Phase5: active
207+ Phase5 --> Phase6: queued
208+ Phase6 --> Phase7: queued
209+ Phase7 --> Phase8: queued
210+ Phase8 --> Phase9: queued
211+ ```
212+
62213Completed:
63214
64215``` text
@@ -116,6 +267,29 @@ Not every command may be available in the current phase. The roadmap is intentio
116267
117268## Example Workflow
118269
270+ ``` mermaid
271+ sequenceDiagram
272+ participant User
273+ participant CLI as ctxt CLI
274+ participant CP as Context Pack
275+ participant Provider
276+ participant Proposal
277+ participant Gate as Apply Gate
278+ participant Tests as Local Validation
279+
280+ User->>CLI: ctxt context inspect
281+ CLI->>CP: collect bounded project context
282+ User->>CLI: ctxt ask --dry-run "..."
283+ CLI->>CP: render provider request artifact
284+ User->>CLI: ctxt propose --provider dummy "..."
285+ CLI->>Provider: send bounded request
286+ Provider-->>CLI: untrusted response
287+ CLI->>Proposal: write reviewable proposal JSON
288+ User->>Gate: approve selected proposal
289+ Gate->>Tests: run validation
290+ Tests-->>User: report / evidence
291+ ```
292+
119293### 1. Inspect the repository context
120294
121295``` bash
@@ -176,6 +350,23 @@ It must not apply changes.
176350
177351CompText produces artifacts that help preserve evidence without trusting logs alone.
178352
353+ ``` mermaid
354+ flowchart TD
355+ CTX[ctxt command] --> CP[.comptext/context_pack.latest.json]
356+ CTX --> MR[.comptext/model_request.latest.json]
357+ CTX --> MS[.comptext/model_response.latest.json]
358+ CTX --> PR[.comptext/provider_request.latest.json]
359+ CTX --> PP[proposals/*.json]
360+ CTX --> RP[reports/phase_*_status.md]
361+
362+ CP --> Proof[Proof Trail]
363+ MR --> Proof
364+ MS --> Proof
365+ PR --> Proof
366+ PP --> Proof
367+ RP --> Proof
368+ ```
369+
179370Common runtime paths:
180371
181372``` text
@@ -233,6 +424,18 @@ A proposal is an inspectable artifact.
233424
234425It is not an applied patch.
235426
427+ ``` mermaid
428+ flowchart LR
429+ A[Context Pack] --> B[Provider Request]
430+ B --> C[Untrusted Provider Response]
431+ C --> D[Proposal JSON]
432+ D --> E{Review Required}
433+ E -->|approve| F[Apply Gate]
434+ E -->|reject| G[No Mutation]
435+ F --> H[Validation Commands]
436+ H --> I[Phase Report]
437+ ```
438+
236439Recommended proposal shape:
237440
238441``` json
@@ -287,6 +490,24 @@ future-gemini
287490custom
288491```
289492
493+ ``` mermaid
494+ flowchart TD
495+ PA[Provider Adapter] --> DU[dummy]
496+ PA --> OL[ollama-local]
497+ PA --> OVL[ollama-cloud-via-local]
498+ PA --> OCD[ollama-cloud-direct]
499+ PA --> OAI[openai-compatible]
500+ PA --> FO[future-openai]
501+ PA --> FG[future-gemini]
502+ PA --> CU[custom]
503+
504+ DU --> OFF[offline / deterministic]
505+ OL --> LOC[localhost boundary]
506+ OVL --> MIX[local API plus cloud model boundary]
507+ OCD --> NET[remote network boundary]
508+ OAI --> API[normalized API boundary]
509+ ```
510+
290511### Dummy Provider
291512
292513Offline, deterministic, and intended for local testing.
@@ -394,6 +615,18 @@ proposals/
394615.agents/skills/
395616```
396617
618+ ``` mermaid
619+ flowchart TD
620+ AG[AGENTS.md] --> GOV[Governance]
621+ PJ[PROJEKT.md] --> STATE[State Machine]
622+ DOC[docs/] --> SPEC[Contracts / Architecture]
623+ SK1[.agent/skills/] --> SK[Agent Skills]
624+ SK2[.agents/skills/] --> SK
625+ CMP[.comptext/] --> RUN[Runtime Artifacts]
626+ PROP[proposals/] --> REV[Review Artifacts]
627+ REP[reports/] --> EVD[Evidence]
628+ ```
629+
397630` PROJEKT.md ` is the project state machine.
398631
399632` AGENTS.md ` is the safety constitution.
@@ -408,6 +641,18 @@ proposals/
408641
409642## Roadmap
410643
644+ ``` mermaid
645+ flowchart LR
646+ P5[Phase 5<br/>Proposal Mode] --> P6[Phase 6<br/>Apply Gate]
647+ P6 --> P7[Phase 7<br/>Provider Config Layer]
648+ P7 --> P8[Phase 8<br/>OpenAI-Compatible Adapter]
649+ P8 --> P9[Phase 9<br/>Validate and Benchmark]
650+ P9 --> P10[Phase 10<br/>MCP Provider Boundary]
651+ P10 --> P11[Phase 11<br/>Hook / Workflow Governance]
652+ P11 --> P12[Phase 12<br/>Token Compression Intercepts]
653+ P12 --> P13[Phase 13<br/>Skill Bundle Registry]
654+ ```
655+
411656``` text
412657Phase 5 Proposal Mode
413658Phase 6 Apply Gate
@@ -477,6 +722,14 @@ NEXT:
477722
478723CompText is part of a wider project family.
479724
725+ ``` mermaid
726+ flowchart TD
727+ CORE[Comptextv7<br/>core / research / replay validation] --> CLI[comptext-cli<br/>product CLI / terminal UX]
728+ SPARK[comptext-sparkctl<br/>validation / benchmark / evidence] --> CLI
729+ SKILLS[antigravity-skills<br/>progressive workflow capsules] --> CLI
730+ CLI --> USER[reviewable engineering workflow]
731+ ```
732+
480733### comptext-cli
481734
482735Product CLI, terminal UX, provider adapters, Context Packs, proposals, apply gate, validation workflow.
0 commit comments