Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .agents/skills/caveman/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ prose.
7. **Return shape** follows register block: verdict, changed paths, commands
run, evidence pointers, open questions.
8. **Evidence** follows register block, same wording: evidence above 58 lines or
1500 tokens -> file in the evidence directory the block names; return
1500 tokens -> file in the directory the register block names, which the
repository's register policy can configure; return
`evidence: <path> sha256:<12 hex> lines:<n>`, fetch only when decision needs
it. Manifest may tighten both numbers; block in AGENTS.md prints values in
force.
Expand Down
3 changes: 2 additions & 1 deletion .claude/skills/caveman/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ prose.
7. **Return shape** follows register block: verdict, changed paths, commands
run, evidence pointers, open questions.
8. **Evidence** follows register block, same wording: evidence above 58 lines or
1500 tokens -> file in the evidence directory the block names; return
1500 tokens -> file in the directory the register block names, which the
repository's register policy can configure; return
`evidence: <path> sha256:<12 hex> lines:<n>`, fetch only when decision needs
it. Manifest may tighten both numbers; block in AGENTS.md prints values in
force.
Expand Down
51 changes: 26 additions & 25 deletions .codex/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,36 @@ Before concluding any turn:
make verify-all
```

`make verify-all` fails until project build + test commands exist; reasons in footer.
`make verify-all` = repository-owned gate; adoption kept it unread + unexecuted. Steps live in `Makefile`: read there, never restate. Footer commands = project markers only.
Pass = exit 0. Signed Ed25519 Exit-0 receipt only from `praetorctl gate run`; report no receipt it did not mint. Fail -> SARIF diagnostic distillation (<= 1500 tokens).

## Core Directives & Invariants

Adopted check = check adoption generated here (generated `make verify-all` + praetor `lefthook.yml`), as written at adoption; later edits to those files not reflected. `not enforced` = rule binds, no generated check decides it for repository languages.
Adopted check = coverage state + mechanism; else audit scanner; else `unknown`. Gates = (praetor `lefthook.yml`); edits not reflected.

| Invariant | Rule | Adopted check | On fail |
| :--- | :--- | :--- | :--- |
| **HISS-01** control flow | recursion prohibited; call graph = DAG; Go, C/C++: zero `goto` | `praetorctl audit` HISS scan in verify-all + lefthook pre-commit/pre-push: Go `goto`, recursion + plain-function call cycles; Rust, Python direct recursion; C `goto` | new finding fails verify-all, blocks commit, blocks push |
| **HISS-02** loops, I/O | scalar upper bound on every loop; explicit deadline on every I/O call; Go: I/O takes `context.Context` deadline | `praetorctl audit` HISS scan in verify-all + lefthook pre-commit/pre-push: unbounded loop shapes in Go, C, Rust, Python; I/O deadlines unchecked | new finding fails verify-all, blocks commit, blocks push |
| **HISS-03** memory | Go, Rust, C/C++: zero heap allocation in hot simulation/tick loops | not enforced | advisory |
| **HISS-04** complexity | McCabe cyclomatic <= 10, cognitive <= 15, statements <= 50; func LOC <= 60 (audit ceiling) | `praetorctl audit` HISS scan in verify-all + lefthook pre-commit/pre-push: function length only; other caps need repository linter | new finding fails verify-all, blocks commit, blocks push |
| **HISS-05** scoping | declare every identifier in smallest lexical scope serving it | not enforced | advisory |
| **HISS-06** concurrency | explicit scalar upper bound on every worker pool + concurrent fan-out | not enforced | advisory |
| **HISS-07** errors | every error handled or wrapped with context; Go: zero unchecked `error` return; Rust: zero `.unwrap()` / `.expect()` outside tests | `praetorctl audit` HISS scan in verify-all + lefthook pre-commit/pre-push: partial in Go, Rust, Python | new finding fails verify-all, blocks commit, blocks push |
| **HISS-08** determinism | zero dynamic code execution (`eval` / `exec`); C/C++: zero banned libc (`gets` / `strcpy` / `sprintf`) | `praetorctl audit` HISS scan in verify-all + lefthook pre-commit/pre-push: C banned calls, Python `eval` / `exec`; Go unchecked | new finding fails verify-all, blocks commit, blocks push |
| **HISS-09** reference safety | Go, Rust: `// SAFETY:` proof before every `unsafe` block | `praetorctl audit` HISS scan in verify-all + lefthook pre-commit/pre-push: Go, Rust `unsafe` without proof; C, Python unchecked | new finding fails verify-all, blocks commit, blocks push |
| **HISS-10** warnings | zero warnings: compiler, linter, format sweeps | `go vet` + `gofmt` in lefthook pre-commit: Go only | vet finding blocks commit |
| **HISS-11** supply chain | pinned lockfiles; zero floating tags; signed provenance | not enforced | advisory |
| **HISS-12** secrets | zero credentials in Git history | not enforced | advisory |
| **HISS-13** debt ratchet | recorded infractions never grow vs committed baseline | `praetorctl audit` ratchet vs `.standards-baseline.json` in verify-all + lefthook pre-commit/pre-push | growth fails verify-all, blocks commit, blocks push |
| **HISS-14** append-only ABI | public API append-only; breaking change = `!` subject + `Migration:` footer | not enforced | advisory |
| **HISS-15** 3D testing | positive + negative + boundary tests, every public interface | not enforced | advisory |
| **HISS-16** context integrity | single canonical `AGENTS.md`; vendor files compiled via `praetorctl compile-context` | `praetorctl compile-context --verify` in verify-all + lefthook pre-commit | drift fails verify-all, blocks commit |
| **HISS-01** control flow | recursion prohibited; call graph = DAG | `praetorctl audit` HISS scan in lefthook pre-commit/pre-push: Go `goto`, recursion + plain-function call cycles; Rust, Python direct recursion; C `goto` | new finding blocks commit, blocks push |
| **HISS-02** loops, I/O | scalar upper bound on every loop; explicit deadline on every I/O call | `praetorctl audit` HISS scan in lefthook pre-commit/pre-push: unbounded loop shapes in Go, C, Rust, Python; I/O deadlines unchecked | new finding blocks commit, blocks push |
| **HISS-03** memory | Rust: zero heap allocation in hot simulation/tick loops | unknown | advisory |
| **HISS-04** complexity | McCabe cyclomatic <= 10, cognitive <= 15, statements <= 50; func LOC <= 60 (audit ceiling) | `praetorctl audit` HISS scan in lefthook pre-commit/pre-push: function length only; other caps need repository linter | new finding blocks commit, blocks push |
| **HISS-05** scoping | declare every identifier in smallest lexical scope serving it | unknown | advisory |
| **HISS-06** concurrency | explicit scalar upper bound on every worker pool + concurrent fan-out | unknown | advisory |
| **HISS-07** errors | every error handled or wrapped with context; Rust: zero `.unwrap()` / `.expect()` outside tests | `praetorctl audit` HISS scan in lefthook pre-commit/pre-push: partial in Go, Rust, Python | new finding blocks commit, blocks push |
| **HISS-08** determinism | zero dynamic code execution (`eval` / `exec`); a process signal's target is bounded above 1 (`killpg`, `kill(-pid)`, Go `syscall.Kill`) | unknown | advisory |
| **HISS-09** reference safety | Rust: `// SAFETY:` proof before every `unsafe` block | `praetorctl audit` HISS scan in lefthook pre-commit/pre-push: Go, Rust `unsafe` without proof; C, Python unchecked | new finding blocks commit, blocks push |
| **HISS-10** warnings | zero warnings: compiler, linter, format sweeps | unknown | advisory |
| **HISS-11** supply chain | pinned lockfiles; zero floating tags; signed provenance | unknown | advisory |
| **HISS-12** secrets | zero credentials in Git history | unknown | advisory |
| **HISS-13** debt ratchet | recorded infractions never grow vs committed baseline | `praetorctl audit` ratchet vs `.standards-baseline.json` in lefthook pre-commit/pre-push | growth blocks commit, blocks push |
| **HISS-14** append-only ABI | public API append-only; breaking change = `!` subject + `Migration:` footer | unknown | advisory |
| **HISS-15** 3D testing | positive + negative + boundary tests, every public interface | unknown | advisory |
| **HISS-16** context integrity | single canonical `AGENTS.md`; vendor files compiled via `praetorctl compile-context` | `praetorctl compile-context --verify` in lefthook pre-commit | drift blocks commit |
| **HISS-17** state ledger | turn start `praetorctl state status`; turn end `praetorctl state sync .` | `praetorctl state sync .` in lefthook post-commit | none; records only |
| **HISS-18** CI efficiency | diff-aware gating via `praetorctl ci filter` | not enforced | advisory |
| **HISS-19** reuse before writing | one behavior = one implementation; extend or call existing code | not enforced | advisory |
| **HISS-20** replayable evidence | every enforcement claim backed by fixtures replayed both directions | not enforced | advisory |
| **HISS-21** platform neutrality | gates, hooks, emitted templates run on Linux, macOS, Windows, or skip with stated reason | not enforced | advisory |
| **HISS-18** CI efficiency | diff-aware gating via `praetorctl ci filter` | unknown | advisory |
| **HISS-19** reuse before writing | one behavior = one implementation; extend or call existing code | unknown | advisory |
| **HISS-20** replayable evidence | every enforcement claim backed by fixtures replayed both directions | unknown | advisory |
| **HISS-21** platform neutrality | gates, hooks, emitted templates run on Linux, macOS, Windows, or skip with stated reason | unknown | advisory |

## Operational Rules

Expand All @@ -57,7 +57,7 @@ Adopted check = check adoption generated here (generated `make verify-all` + pra

4. **SARIF diagnostic distillation.** Compiler/linter errors -> distill to $\le 1,500$ tokens ($< 60$ lines): top 3 root-cause failures with file/line pointers; full SARIF logs -> ephemeral storage.

5. **No evasion.** Never attempt `--no-verify`, `LEFTHOOK=0`, or modifying `.git/hooks`. Hooks = local gate adoption installs. Adoption adds no server-side `praetorctl` gate run. Scaffolded CI: `.github/workflows/reuse.yml` runs step `Stop on a draft pull request`; `.github/workflows/ci.yml` runs step `Stop on a draft pull request`, step `Install the stable toolchain`, `cargo fmt --all -- --check`, `cargo clippy --all-targets --all-features -- -D warnings`, `cargo test --all-features`.
5. **No evasion.** Never attempt `--no-verify`, `LEFTHOOK=0`, or modifying `.git/hooks`. Hooks = local gate adoption installs. Adoption adds no server-side `praetorctl` gate run. Scaffolded CI: `.github/workflows/reuse.yml` runs step `Stop on a draft pull request`.

6. **Anti-loop interception.** Same AST diff + error category repeats $\ge 3$ times -> halt immediately. Re-evaluate design; no micro-textual retries.

Expand All @@ -81,8 +81,9 @@ Register follows the audience, then the task label of your brief (`register:` in

```bash
# Fast local test suite
# Project verification unavailable: No supported build-system marker or explicit test runner was found; define and exercise a project verify-all target. A required build or test command is absent; define and exercise the project's verify-all contract.
exit 1
# Declared commands only; run them before claiming application verification.
'cargo' 'build' '--locked'
'cargo' 'test' '--locked'

# Recompile and verify cross-agent context outputs
praetorctl compile-context --verify
Expand Down
1 change: 1 addition & 0 deletions .config/agent/hooks/block_evasion.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: EUPL-1.2
"""Agent PreToolUse evasion interceptor (HISS), written by praetorctl adopt.

Wire this script as a PreToolUse hook of the agent harness's shell tool. The harness passes
Expand Down
Loading