Skip to content

Commit ee16d97

Browse files
committed
Add autonomous project state machine
1 parent 44b0039 commit ee16d97

1 file changed

Lines changed: 73 additions & 27 deletions

File tree

PROJEKT.md

Lines changed: 73 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,40 +15,86 @@ CompText CLI is an experimental terminal context client for building determinist
1515

1616
---
1717

18-
## Phase Roadmap Status
18+
## Autonomous State Machine Configuration
19+
20+
### Current State
21+
```text
22+
CURRENT_PHASE: 4
23+
CURRENT_TASK: Ollama Local Adapter with explicit network boundary
24+
LAST_GREEN_PHASE: 3
25+
STATUS: active
26+
```
27+
28+
### Autonomy Contract
29+
- **Allowed Modifications**: May edit source code (`src/**`), tests (`tests/**`), docs (`docs/**`), skills (`.agent/skills/**`, `.agents/skills/**`), prompts (`prompts/**`), and configurations (`Cargo.toml`, `comptext.example.toml`).
30+
- **Allowed Commands**: May run local compilation, lint checks, tests, and formatting validation.
31+
- **Error Remediation**: May automatically modify code to fix local build, format, test, or clippy failures.
32+
- **Phase Transition**: May commit and push changes after all validation passes for a green phase, and automatically proceed to the next phase queue item.
33+
34+
### Forbidden Rules
35+
- **No Private Keys / Secrets**: Forbidden to read or parse `.env`, `.env.*`, `.netrc`, `.git-credentials`, private keys (`*.key`, `*.pem`), or credentials.
36+
- **No Secret Leakage**: Forbidden to print environment variables, dump secrets in stdout/stderr, or write them to logs/reports/artifacts.
37+
- **No Untrusted Provider Action**: Forbidden to execute real cloud API provider calls during coding/validation phases (unless explicitly approved for live integration runs).
38+
- **No Destructive/Out-of-Scope Commands**: Forbidden to run shell operations outside the repo root.
39+
- **No Overwriting Remote History**: Forbidden to run `git push -f` or force push unless explicitly approved.
40+
- **No Compliance Claims**: Forbidden to claim production/enterprise readiness, certified status, full autonomy, or official SPARK compatibility.
41+
42+
### Stop Conditions
43+
The agent must halt execution and yield to the user when:
44+
1. API credentials or auth keys are required to proceed.
45+
2. Real cloud provider execution / live network calls are needed.
46+
3. Git merge conflicts arise that cannot be resolved safely.
47+
4. Validation fails and cannot be resolved with small, safe changes.
48+
5. Codebase requirements or user requests are contradictory.
49+
6. Target files outside the repository root need to be accessed or created.
50+
51+
### Global Validation Suite
52+
The agent must run and satisfy the following validation suite before completing any phase:
53+
```bash
54+
cargo fmt --all --check
55+
cargo check
56+
cargo test
57+
cargo clippy -- -D warnings
58+
```
59+
60+
### Git Progression Rule
61+
Upon achieving green status for any phase, the agent must execute:
62+
```bash
63+
git status
64+
git add .
65+
git commit -m "<phase commit message>"
66+
git push
67+
```
68+
69+
---
70+
71+
## Phase Queue & Roadmap Status
1972

2073
| Phase | Description | Goal / Scope | Status |
2174
|---|---|---|---|
2275
| **Phase 0** | Repo Genesis & Bootstrap | Scaffold Rust project, basic commands (`help`, `doctor`, `providers list`, `version`), verify CI | **COMPLETE** |
2376
| **Phase 1** | CLI Shell Hardening | Hardening argument parsing, input handling, and errors for the base shell commands | **COMPLETE** |
2477
| **Phase 2** | Context Pack Contract | Implement `ctxt context inspect`, `ctxt context pack --task "..."`, and `ctxt ask --dry-run "..."` | **COMPLETE** |
2578
| **Phase 3** | Provider Adapter Layer | Define provider interface and Dummy offline test provider | **COMPLETE** |
26-
| **Phase 4** | Ollama Local Adapter | Support local Ollama integrations with explicit network boundaries | *PLANNED* |
27-
| **Phase 5** | Proposal Apply Gate | Implement proposal files, approval checks, and validation flow | *PLANNED* |
79+
| **Phase 4** | Ollama Local Adapter | Support local Ollama integrations with explicit network boundaries | **ACTIVE** |
80+
| **Phase 5** | Proposal Mode | Implement `ctxt propose` to output changes as structured proposals | *QUEUED* |
81+
| **Phase 6** | Apply Gate | Implement `ctxt apply` to confirm/apply changes and run verification | *QUEUED* |
82+
| **Phase 7** | Provider Config Layer | Support dynamic provider profile switching and configurations | *QUEUED* |
83+
| **Phase 8** | OpenAI-Compatible Adapter | Implement OpenAI adapter skeleton | *QUEUED* |
84+
| **Phase 9** | Validate and Benchmark | Local validation, dry-runs, and deterministic benchmark flows | *QUEUED* |
2885

2986
---
3087

31-
## Active Phase Details
32-
33-
### Phase 1: CLI Shell Hardening
34-
- **Objective**: Harden command parsing in `src/cli.rs`.
35-
- **Target commands**:
36-
- `ctxt --help` (or `-h`)
37-
- `ctxt doctor`
38-
- `ctxt version` (or `-V` / `version`)
39-
- `ctxt providers list`
40-
- **Validation**:
41-
- `cargo fmt --all --check`
42-
- `cargo check`
43-
- `cargo test`
44-
- `cargo clippy -- -D warnings`
45-
46-
### Phase 2: Context Pack Contract
47-
- **Objective**: Build deterministic JSON Context Packs.
48-
- **Target commands**:
49-
- `ctxt context inspect`
50-
- `ctxt context pack --task "<TASK>"`
51-
- `ctxt ask --dry-run "<PROMPT>"`
52-
- **Artifacts**:
53-
- `.comptext/context_pack.latest.json`
54-
- `.comptext/model_request.latest.json`
88+
## Standard Phase Return Format
89+
All phase transitions must output their status report using the following schema:
90+
```text
91+
PHASE: <Phase Number and Title>
92+
STATUS: <success | blocked>
93+
FILES_CHANGED: <list of changed files>
94+
COMMANDS_RUN: <list of commands executed>
95+
VALIDATION: <validation output summary>
96+
ARTIFACTS: <list of generated artifacts>
97+
GIT: <git commit and push hash/result>
98+
RISKS: <analysis of potential risks>
99+
NEXT: <next action or phase name>
100+
```

0 commit comments

Comments
 (0)