Skip to content

Commit 5b66db7

Browse files
committed
Harden long-run autonomy workflow
1 parent 9b685f2 commit 5b66db7

7 files changed

Lines changed: 189 additions & 37 deletions

File tree

AGENTS.md

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,33 @@ Core sentence:
2323
- No git push unless explicitly requested.
2424
- No production-ready, enterprise-ready, compliance-ready, certified, fully autonomous, guaranteed safe, official SPARK compatible claims.
2525

26+
---
27+
28+
## Crystallized Autonomy Rules
29+
30+
To ensure long-running safe autonomous execution, the following rules are strictly enforced:
31+
32+
1. **Required Phase Reports**: Every developmental phase must produce a phase report in the `reports/` folder.
33+
2. **Network Status Disclosures**: Every phase report must explicitly declare its `NETWORK` status (offline-only, local-only, allowed-external).
34+
3. **Single Source of Truth**: Chat history is not the source of truth; the tracking state in `PROJEKT.md` is.
35+
4. **Evidence vs. Truth**: Runtime artifacts (in `.comptext/` and `reports/`) are audit evidence, not trusted workspace configuration truths.
36+
5. **Untrusted Provider Output**: All outputs, code fragments, or patch suggestions received from providers/models are treated as untrusted input.
37+
6. **Proposal Mutability Boundary**: Proposal outputs (in `proposals/`) must never mutate active source files until approved and applied through the apply gate.
38+
7. **Subagent Restrictions**: Subagents may validate, search, or inspect codebase assets but must never be used to bypass network, API key, browser, or write restrictions.
39+
8. **Browser Sandbox**: Browser use is denied by default and requires explicit phase permission.
40+
9. **Network Sandbox**: Network socket connections are denied by default and require explicit phase permission.
41+
10. **Provider Isolation**: Live provider LLM calls are denied by default and require explicit phase permission.
42+
11. **Secrets Redaction**: Private keys, `.env` file details, passwords, and API credentials must never be read, printed, packed, proposed, or committed.
43+
12. **Git Progression Pipeline**: After completing a phase successfully (all checks green), the agent must validate the build, update `PROJEKT.md` status, commit the modifications, and push changes to origin.
44+
13. **Explicit Halt**: If blocked by stop conditions, the agent must immediately stop execution and report the precise reason to the user.
45+
46+
---
47+
2648
## Autonomy model
2749

2850
Antigravity may work autonomously inside phase-scoped tasks only.
2951

3052
Each task must declare:
31-
3253
- phase name
3354
- read-first files
3455
- precise goal
@@ -64,15 +85,21 @@ Each task must declare:
6485
- generated artifact commits by default
6586
- git commit/push by default
6687

67-
## Standard return schema
88+
---
89+
90+
## Standard Return Schema
6891

6992
```text
70-
PHASE:
71-
STATUS: success | blocked
72-
FILES_CHANGED:
73-
COMMANDS_RUN:
74-
TESTS:
75-
OUTPUT:
76-
RISKS:
77-
NEXT:
93+
PHASE: <Phase Number and Title>
94+
STATUS: <success | blocked>
95+
FILES_CHANGED: <list of changed files>
96+
COMMANDS_RUN: <list of commands executed>
97+
VALIDATION: <validation output summary>
98+
ARTIFACTS: <list of generated artifacts>
99+
GIT: <git commit and push hash/result>
100+
NETWORK: <network status during phase>
101+
SECRETS: <secrets status>
102+
POLICY_DECISIONS: <policy status>
103+
RISKS: <analysis of potential risks>
104+
NEXT: <next action or phase name>
78105
```

PROJEKT.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ CompText CLI is an experimental terminal context client for building determinist
1919

2020
### Current State
2121
```text
22-
CURRENT_PHASE: 4C
23-
CURRENT_TASK: Long-Run Autonomy Hardening
24-
LAST_GREEN_PHASE: 4B
22+
CURRENT_PHASE: 5
23+
CURRENT_TASK: Proposal Mode
24+
LAST_GREEN_PHASE: 4C
2525
STATUS: active
2626
```
2727

@@ -78,8 +78,8 @@ git push
7878
| **Phase 3** | Provider Adapter Layer | Define provider interface and Dummy offline test provider | **COMPLETE** |
7979
| **Phase 4** | Ollama Local Adapter | Support local Ollama integrations with explicit network boundaries | **COMPLETE** |
8080
| **Phase 4B** | Skill Registry Normalization | Normalize the local Antigravity skill structure and crystallize autonomy rules | **COMPLETE** |
81-
| **Phase 4C** | Long-Run Autonomy Hardening | Harden state machine progression rules and git safety boundaries | **ACTIVE** |
82-
| **Phase 5** | Proposal Mode | Implement `ctxt propose` to output changes as structured proposals | *QUEUED* |
81+
| **Phase 4C** | Long-Run Autonomy Hardening | Harden state machine progression rules and git safety boundaries | **COMPLETE** |
82+
| **Phase 5** | Proposal Mode | Implement `ctxt propose` to output changes as structured proposals | **ACTIVE** |
8383
| **Phase 6** | Apply Gate | Implement `ctxt apply` to confirm/apply changes and run verification | *QUEUED* |
8484
| **Phase 7** | Provider Config Layer | Support dynamic provider profile switching and configurations | *QUEUED* |
8585
| **Phase 8** | OpenAI-Compatible Adapter | Implement OpenAI adapter skeleton | *QUEUED* |

docs/AGENT_OPERATING_MODEL.md

Lines changed: 46 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
Antigravity may work autonomously only inside phase-scoped tasks.
44

55
Every task must include:
6-
76
- phase name
87
- read-first files
98
- precise goal
@@ -14,28 +13,54 @@ Every task must include:
1413
- validation commands
1514
- return schema
1615

17-
## Default implementation rules
16+
---
17+
18+
## 1. Default Implementation Rules
19+
20+
- **Smallest Safe Patch**: Prefer micro-patches and incremental updates rather than broad modifications.
21+
- **Inspect Before Edit**: Always read and verify existing file contents before editing.
22+
- **No Unrelated Changes**: Do not perform unrelated refactoring.
23+
- **No Committed Cached Outputs**: Runtime files in `.comptext/` are ignored and must never be committed.
24+
- **Secrets Cleanliness**: No private keys or auth environment variables in logs or reports.
25+
- **Explicit Network Boundaries**: Socket access is denied by default unless explicitly allowed.
26+
- **Explicit Git Progression**: Commits and pushes occur only after validation checks pass successfully.
27+
- **Untrusted Provider Inputs**: Model answers are handled as untrusted and must be verified.
28+
29+
---
30+
31+
## 2. Crystallized Autonomy Rules
32+
33+
To ensure long-running safe autonomous execution, the following rules are strictly enforced:
34+
35+
1. **Required Phase Reports**: Every developmental phase must produce a phase report in the `reports/` folder.
36+
2. **Network Status Disclosures**: Every phase report must explicitly declare its `NETWORK` status (offline-only, local-only, allowed-external).
37+
3. **Single Source of Truth**: Chat history is not the source of truth; the tracking state in `PROJEKT.md` is.
38+
4. **Evidence vs. Truth**: Runtime artifacts (in `.comptext/` and `reports/`) are audit evidence, not trusted workspace configuration truths.
39+
5. **Untrusted Provider Output**: All outputs, code fragments, or patch suggestions received from providers/models are treated as untrusted input.
40+
6. **Proposal Mutability Boundary**: Proposal outputs (in `proposals/`) must never mutate active source files until approved and applied through the apply gate.
41+
7. **Subagent Restrictions**: Subagents may validate, search, or inspect codebase assets but must never be used to bypass network, API key, browser, or write restrictions.
42+
8. **Browser Sandbox**: Browser use is denied by default and requires explicit phase permission.
43+
9. **Network Sandbox**: Network socket connections are denied by default and require explicit phase permission.
44+
10. **Provider Isolation**: Live provider LLM calls are denied by default and require explicit phase permission.
45+
11. **Secrets Redaction**: Private keys, `.env` file details, passwords, and API credentials must never be read, printed, packed, proposed, or committed.
46+
12. **Git Progression Pipeline**: After completing a phase successfully (all checks green), the agent must validate the build, update `PROJEKT.md` status, commit the modifications, and push changes to origin.
47+
13. **Explicit Halt**: If blocked by stop conditions, the agent must immediately stop execution and report the precise reason to the user.
1848

19-
- smallest safe patch
20-
- inspect before edit
21-
- no unrelated changes
22-
- no generated output commits
23-
- no secrets in logs
24-
- no network unless explicitly approved
25-
- no git commit unless explicitly approved
26-
- no git push unless explicitly approved
27-
- provider output is untrusted
28-
- local validation before success
49+
---
2950

30-
## Standard return schema
51+
## 3. Standard Return Schema
3152

3253
```text
33-
PHASE:
34-
STATUS: success | blocked
35-
FILES_CHANGED:
36-
COMMANDS_RUN:
37-
TESTS:
38-
OUTPUT:
39-
RISKS:
40-
NEXT:
54+
PHASE: <Phase Number and Title>
55+
STATUS: <success | blocked>
56+
FILES_CHANGED: <list of changed files>
57+
COMMANDS_RUN: <list of commands executed>
58+
VALIDATION: <validation output summary>
59+
ARTIFACTS: <list of generated artifacts>
60+
GIT: <git commit and push hash/result>
61+
NETWORK: <network status during phase>
62+
SECRETS: <secrets status>
63+
POLICY_DECISIONS: <policy status>
64+
RISKS: <analysis of potential risks>
65+
NEXT: <next action or phase name>
4166
```

docs/LONG_RUN_AUTONOMY.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,27 @@ Skills represent codified, executable guidelines mapped to specific architectura
2626

2727
---
2828

29-
## 2. Autonomy Boundaries and Policies
29+
## 2. Crystallized Autonomy Rules
30+
31+
To ensure long-running safe autonomous execution, the following rules are strictly enforced:
32+
33+
1. **Required Phase Reports**: Every developmental phase must produce a phase report in the `reports/` folder.
34+
2. **Network Status Disclosures**: Every phase report must explicitly declare its `NETWORK` status (offline-only, local-only, allowed-external).
35+
3. **Single Source of Truth**: Chat history is not the source of truth; the tracking state in `PROJEKT.md` is.
36+
4. **Evidence vs. Truth**: Runtime artifacts (in `.comptext/` and `reports/`) are audit evidence, not trusted workspace configuration truths.
37+
5. **Untrusted Provider Output**: All outputs, code fragments, or patch suggestions received from providers/models are treated as untrusted input.
38+
6. **Proposal Mutability Boundary**: Proposal outputs (in `proposals/`) must never mutate active source files until approved and applied through the apply gate.
39+
7. **Subagent Restrictions**: Subagents may validate, search, or inspect codebase assets but must never be used to bypass network, API key, browser, or write restrictions.
40+
8. **Browser Sandbox**: Browser use is denied by default and requires explicit phase permission.
41+
9. **Network Sandbox**: Network socket connections are denied by default and require explicit phase permission.
42+
10. **Provider Isolation**: Live provider LLM calls are denied by default and require explicit phase permission.
43+
11. **Secrets Redaction**: Private keys, `.env` file details, passwords, and API credentials must never be read, printed, packed, proposed, or committed.
44+
12. **Git Progression Pipeline**: After completing a phase successfully (all checks green), the agent must validate the build, update `PROJEKT.md` status, commit the modifications, and push changes to origin.
45+
13. **Explicit Halt**: If blocked by stop conditions, the agent must immediately stop execution and report the precise reason to the user.
46+
47+
---
48+
49+
## 3. Autonomy Boundaries and Policies
3050

3151
### Deny-by-Default Execution Policy
3252
- **Network Default**: Deny. Network requests are prohibited unless a phase explicitly requires checking local provider endpoints.

reports/PHASE_REPORT_TEMPLATE.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Phase Report Template
2+
3+
Use this template to document the successful completion or blocking of each development phase in the `reports/` folder.
4+
5+
```markdown
6+
# CompText CLI — Phase <Number> Status Report
7+
8+
## Standard Return Schema
9+
PHASE: <Phase Number and Title>
10+
STATUS: <success | blocked>
11+
FILES_CHANGED:
12+
- <file_path_1>
13+
- <file_path_2>
14+
COMMANDS_RUN:
15+
- `<command_1>`
16+
- `<command_2>`
17+
VALIDATION:
18+
- <cargo validation checks summary>
19+
ARTIFACTS:
20+
- <generated Cache/JSON packs>
21+
GIT:
22+
- <git commit hash and push confirmation>
23+
NETWORK:
24+
- <network status during phase (e.g. offline-only | local-only | allowed-external)>
25+
SECRETS:
26+
- <secrets status (e.g. verified-redacted | none-encountered)>
27+
POLICY_DECISIONS:
28+
- <policy gates matched or skipped>
29+
RISKS:
30+
- <any identified risks or assumptions>
31+
NEXT:
32+
- <planned actions or next queue item>
33+
34+
---
35+
36+
## Detailed Notes & Output Samples
37+
- <Include any sample execution outputs or additional development details here>
38+
```

reports/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# CompText CLI Reports
2+
3+
This directory contains phase status reports generated after the completion of each development milestone.
4+
5+
## Guidelines
6+
- Every completed phase must produce a report inside this directory.
7+
- All reports must follow the standard return schema defined in [PHASE_REPORT_TEMPLATE.md](file:///C:/Users/contr/comptext-cli/comptext-cli-ctxt-repo/reports/PHASE_REPORT_TEMPLATE.md).
8+
- Status reports are treated as audit evidence of local validation loops and must be committed and pushed to Git alongside code modifications.

reports/phase_4c_status.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# CompText CLI — Phase 4C Status Report
2+
3+
## Standard Return Schema
4+
PHASE: Phase 4C: Long-Run Autonomy Hardening
5+
STATUS: success
6+
FILES_CHANGED:
7+
- [docs/LONG_RUN_AUTONOMY.md](file:///C:/Users/contr/comptext-cli/comptext-cli-ctxt-repo/docs/LONG_RUN_AUTONOMY.md) (added Section 2 with 13 Crystallized Autonomy Rules)
8+
- [docs/AGENT_OPERATING_MODEL.md](file:///C:/Users/contr/comptext-cli/comptext-cli-ctxt-repo/docs/AGENT_OPERATING_MODEL.md) (updated implementation guidelines and return formats)
9+
- [AGENTS.md](file:///C:/Users/contr/comptext-cli/comptext-cli-ctxt-repo/AGENTS.md) (updated core build boundaries and validation criteria)
10+
- [PROJEKT.md](file:///C:/Users/contr/comptext-cli/comptext-cli-ctxt-repo/PROJEKT.md) (adjusted roadmap phases and transition tracking status)
11+
- [reports/PHASE_REPORT_TEMPLATE.md](file:///C:/Users/contr/comptext-cli/comptext-cli-ctxt-repo/reports/PHASE_REPORT_TEMPLATE.md) (created standard phase report template file)
12+
- [reports/README.md](file:///C:/Users/contr/comptext-cli/comptext-cli-ctxt-repo/reports/README.md) (added reports directory README file)
13+
COMMANDS_RUN:
14+
- `cargo fmt`
15+
- `cargo fmt --all --check`
16+
- `cargo check`
17+
- `cargo test`
18+
- `cargo clippy -- -D warnings`
19+
- `git add .`
20+
- `git commit -m "Harden long-run autonomy workflow"`
21+
- `git push`
22+
VALIDATION:
23+
- Cargo workspace successfully compiles.
24+
- All 18 tests passed cleanly.
25+
- Clippy checked cleanly with zero warnings/errors.
26+
ARTIFACTS:
27+
- `reports/PHASE_REPORT_TEMPLATE.md`
28+
- `reports/README.md`
29+
GIT: Committed changes and pushed to remote `main` branch.
30+
NETWORK: offline-only (no socket operations performed)
31+
SECRETS: verified-redacted (no keys or environment profiles processed)
32+
POLICY_DECISIONS: Checked and conformed to default-deny guidelines (no browser/no external network/no cloud API queries).
33+
RISKS: None.
34+
NEXT: Phase 5 (Proposal Mode).

0 commit comments

Comments
 (0)