Skip to content

Commit b9191af

Browse files
authored
feat: complete Sparkctl CLI command surface
Complete the local Sparkctl CLI command surface and synchronize documentation. Includes: - wire package compress and adversarial commands - add report export backend and CLI command - add notebook bundle backend and CLI command - synchronize README and SPARK alignment docs - preserve Antigravity workspace/context assets - harden report/notebook output path handling - remove remaining review-noted unwrap in package verification - fix CI color handling for plain replay output tests Validation: - GitHub Actions green - Gemini review threads resolved - synthetic-only / human-review / non-certified boundaries preserved
1 parent 34cff22 commit b9191af

57 files changed

Lines changed: 3770 additions & 849 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agent/skills/00_project_system.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ This skill defines the repository structure, active directories, permissions, an
44

55
## 1. Operating Boundaries
66

7-
- **Sandbox Root:** `C:\Users\contr\sandbox_workspace\Antigravity-Comptextv7-unified`
7+
- **Sandbox Root:** current workspace clone
88
- **Allowed Write Paths:**
99
- `agy7rust/` (Rust crate)
1010
- `examples/spark/` (Synthetic SPARK-style fixtures)
1111
- `artifacts/spark/` (Verification and demo outputs)
1212
- `.agent/skills/` (Local agent instructions)
13-
- **Forbidden Paths:** Any parent directory (e.g. `C:\Users\contr`), desktop (`C:\Users\contr\Desktop`), sibling workspaces (e.g., `rustcomptext`), and the `.git` metadata of the system.
13+
- **Forbidden Paths:** Any parent directory, desktop, sibling workspaces, and the `.git` metadata of the system. Agents must not inspect, modify, copy, move, delete, or index any CompText-related files outside the current workspace clone.
14+
- **Historical Evidence Paths:** Old Antigravity-Comptextv7 paths, `C:\Users\contr` paths, Termux paths, `git_post_push_verification` paths, and `file:///C:/` links are historical evidence only and must not be used as valid active paths.
1415
- **Search Boundaries:** Do NOT perform global searches, recursive searches, or file indexing outside the sandbox root.
1516

1617
## 2. Command Permissions

.agent/skills/05_claim_hygiene.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,17 @@ Never write, log, or state the following claims:
1818
- **SPARK JSON Compatibility:** Do not claim compatibility with official SPARK JSON extractors or schemas.
1919
- **EU AI Act Compliance:** Do not claim the tool certifies or is compliant with the EU AI Act. Mention only "Art.-12-oriented record keeping support" as a design pattern.
2020
- **Legal or Judicial Proof:** Do not claim that packages constitute court-admissible evidence, legally binding proofs, or legal validation.
21-
- **Forensic Certainty:** Avoid terms like "100% forensic security" or "invulnerable tamper resistance". Use "tamper-sensitive validation".
21+
- **Forensic Certainty & Recovery:** Avoid terms like "100% forensic security", "invulnerable tamper resistance", or automated forensic recovery/repair. Use "tamper-sensitive validation" only.
2222
- **MCP Integration:** Do not claim MCP capability or server features unless explicitly built in a future phase.
23+
- **Production Readiness:** The system is a mock prototype only. No production or enterprise setup readiness.
24+
- **Autonomous Decisions:** The tool does not make autonomous planning or administrative decisions.
25+
26+
## 3. Technology Boundaries (Legacy & Future Exclusions)
27+
28+
The following concepts are legacy/future design ideas only and are **not** supported by the current BMDS/SPARK alignment scope:
29+
- **XENTRY/OBD Log Engine:** XENTRY X-Engine/OBD X X-Engine log parsing is not supported.
30+
- **Consonant Signature Mapping:** Consonant-only mapping of XENTRY logs is legacy.
31+
- **Four-Layer Sandwich Log:** Sandwich formatting (Header/Middle/Window/Frame) is excluded from active claims.
32+
- **Sparse Micro-Frame Synopsis:** The dot/pipe micro-frame synopsis is a legacy prototype fallback.
33+
- **Auto-repair/recovery helpers:** No autonomous data repair or error correction is implemented.
34+

.agent/skills/11_comptext_validate.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ Verify each of the following:
2626
2. **Artifact Existence:** Ensure that `context.json`, `context_render.txt`, and `extraction.spkg` exist in `artifacts/spark/`.
2727
3. **Render Check:** Verify that the rendered context `context_render.txt` is non-empty and correctly formatted.
2828
4. **Git Untracked State:** Confirm that the generated latest report `reports/latest.json` remains untracked in git.
29+
5. **Ledger and Hash Chain Validation:** Verify that `ledger_root` matches the final entry hash in the cryptographic chain.
30+
6. **Pre-Replay Validation Guardrail:** Ensure that package verification is executed as a prerequisite before running step simulations.
31+
7. **Failure Label Analysis:** If validation or replay fails, map the error using structured labels:
32+
- `EVIDENCE_LOSS`: Critical metadata or tool sequence records are missing.
33+
- `CONSTRAINT_DRIFT`: Decoded state commits or hashes diverge from baseline values.
2934

3035
## 4. Standard Return Format
3136

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
name: 00_project_system
3+
description: "Defines the repository structure, active directories, permissions, and operating boundaries for the sandbox environment."
4+
---
5+
6+
# Agent Skill 00 — Project System
7+
8+
This skill defines the repository structure, active directories, permissions, and operating boundaries for the sandbox environment.
9+
10+
## 1. Operating Boundaries
11+
12+
- **Sandbox Root:** current workspace clone
13+
- **Allowed Write Paths:**
14+
- `agy7rust/` (Rust crate)
15+
- `examples/spark/` (Synthetic SPARK-style fixtures)
16+
- `artifacts/spark/` (Verification and demo outputs)
17+
- `.agents/skills/` and `.agent/skills/` (Local agent instructions)
18+
- **Forbidden Paths:** Any parent directory, desktop, sibling workspaces, and the `.git` metadata of the system. Agents must not inspect, modify, copy, move, delete, or index any CompText-related files outside the current workspace clone.
19+
- **Historical Evidence Paths:** Old Antigravity-Comptextv7 paths, `C:\Users\contr` paths, Termux paths, `git_post_push_verification` paths, and `file:///C:/` links are historical evidence only and must not be used as valid active paths.
20+
- **Search Boundaries:** Do NOT perform global searches, recursive searches, or file indexing outside the sandbox root.
21+
22+
## 2. Command Permissions
23+
24+
- **Cargo Access:** Running `cargo` command actions (`cargo fmt`, `cargo check`, `cargo test`, `cargo clippy`, `cargo run`) is strictly limited to the `agy7rust/` subdirectory.
25+
- **Git Restrictions:** No git remotes config, git fetch, git pull, or git push commands are permitted.
26+
- **Network Access:** All network calls and API connections are blocked. The project works entirely offline.
27+
28+
## 3. Standard Return Format
29+
30+
Every completed agent execution step must output the exact formatted block:
31+
32+
```text
33+
PHASE: <phase_name>
34+
STATUS: <success | blocked>
35+
FILES_CHANGED:
36+
- ...
37+
COMMANDS_RUN:
38+
- ...
39+
TESTS:
40+
- ...
41+
RISKS:
42+
- ...
43+
NEXT:
44+
- ...
45+
```
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: 01_phase_gate
3+
description: "Defines the sequence gates required to develop, audit, and baseline project phases."
4+
---
5+
6+
# Agent Skill 01 — Phase-Gate Lifecycle
7+
8+
This skill defines the sequence gates required to develop, audit, and baseline project phases.
9+
10+
## 1. The Phase Loop
11+
12+
For every development phase, the agent must execute the following sequential cycle:
13+
14+
```mermaid
15+
flowchart TD
16+
A["1. Implementation Phase"] --> B["2. Audit/Validation Phase"]
17+
B --> C["3. Snapshot/Baseline Phase"]
18+
C --> D["Stop & Await User Approval"]
19+
```
20+
21+
1. **Implementation:** Write logic, format code, and compile tests.
22+
2. **Audit:** Run verification commands (fmt checks, cargo check, integration tests, clippy checks, determinism, and leak tests) to confirm complete functionality without regression.
23+
3. **Snapshot:** Write a persistent markdown snapshot file documenting status, file trees, verification outputs, and risks.
24+
25+
## 2. Gate Constraints
26+
27+
- **Never Auto-Advance:** Once a phase snapshot is completed, stop work. Do NOT proceed to implementing the next phase until the user explicitly requests it.
28+
- **Stop on Unclear Scope:** If requirements are ambiguous, or if any compile/test error persists after three concrete fixing attempts, halt and request design direction from the user.
29+
- **Execution Statuses:**
30+
- `success` — All validation steps pass and the snapshot is successfully written.
31+
- `blocked` — An issue prevents verification or the sandbox scope is invalid.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
name: 02_rust_validation
3+
description: "Lists the commands and code audits required to validate the Rust codebase."
4+
---
5+
6+
# Agent Skill 02 — Rust Validation
7+
8+
This skill lists the commands and code audits required to validate the Rust codebase.
9+
10+
## 1. Quality Gates
11+
12+
Run these commands inside `agy7rust/` in order before submitting:
13+
14+
1. **Formatting:**
15+
```bash
16+
cargo fmt --all --check
17+
```
18+
2. **Compilation:**
19+
```bash
20+
cargo check
21+
```
22+
3. **Tests:**
23+
```bash
24+
cargo test
25+
```
26+
4. **Lints (Warnings as Errors):**
27+
```bash
28+
cargo clippy -- -D warnings
29+
```
30+
5. **Demo Check:**
31+
```bash
32+
powershell -File .\demo_spark.ps1
33+
```
34+
35+
## 2. Determinism Validation
36+
37+
To guarantee byte-level determinism, compile packages twice and compare their hashes:
38+
```bash
39+
cargo run -- compress -i <input.json> -o determinism_a.spkg
40+
cargo run -- compress -i <input.json> -o determinism_b.spkg
41+
# Compare file hashes:
42+
Get-FileHash determinism_a.spkg
43+
Get-FileHash determinism_b.spkg
44+
```
45+
Both hashes must match identically.
46+
47+
## 3. Code Standards
48+
49+
- **No Unsafe:** Use `#![deny(unsafe_code)]` at crate root.
50+
- **Robust Error Handling:** Avoid `.unwrap()` and `.expect()` in production code. Return `Result<T>` and bubble up errors cleanly using `anyhow` or custom errors.
51+
- **No Side-Effects:** No timestamps, UUID generation, random numbers, or environment variables that alter output bytes. All hashes must be completely deterministic.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: 03_artifact_validation
3+
description: "Defines the requirements for generating deterministic packages and validation snapshots."
4+
---
5+
6+
# Agent Skill 03 — Artifact Validation
7+
8+
This skill defines the requirements for generating deterministic packages and validation snapshots.
9+
10+
## 1. Package Artifact Integrity
11+
12+
- **Stable Key Ordering:** Objects must have keys sorted alphabetically (canonical JSON) before hashing or writing.
13+
- **No Volatile Elements:** Timestamps, randomized transaction identifiers, and environment-dependent properties are strictly forbidden.
14+
- **Offline Hashing:** Hash chain calculations must happen locally using standard `sha2` crate. No network APIs or external tokenizers can be queried.
15+
16+
## 2. Snapshot Document Standards
17+
18+
At the completion of each phase, a snapshot file (e.g., `PHASE1_SPARK_SNAPSHOT.md`) must be written containing the following structured sections:
19+
20+
1. **Phase Name & Sandbox Root**
21+
2. **Created/Modified File Trees** (excluding intermediate build artifacts like `target/`)
22+
3. **Execution Logs & Command Lists**
23+
4. **Validation Test Run Status**
24+
5. **Deterministic Hash Signatures** (from package validation tests)
25+
6. **Leak Verification Evidence** (for inspect/replay commands)
26+
7. **Adversarial Tamper Suite Statistics**
27+
8. **Explicit Non-Claims & Risks**
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: 04_spark_context_layer
3+
description: "Outlines the design concepts for representing compact, replay-safe operational contexts inside SPARK-style packages."
4+
---
5+
6+
# Agent Skill 04 — SPARK Context Layer
7+
8+
This skill outlines the design concepts for representing compact, replay-safe operational contexts inside SPARK-style packages.
9+
10+
## 1. Core Purpose
11+
12+
The SPARK Context Layer exists to package prior task history and metadata into a minimal, deterministic, and replay-safe payload. It is NOT an orchestration framework or active workflow runner.
13+
14+
## 2. Design Anchors (For Future Integration Only)
15+
16+
When implemented, the context layer must preserve the following metadata blocks:
17+
- **Causal dependency edges** (e.g. step A must precede step B)
18+
- **Constraint lists & Blockers**
19+
- **Recovery paths & Alternative plans**
20+
- **Schema validation anchors**
21+
- **Task & Context identifiers**
22+
23+
## 3. Strict Context Constraints (Do NOT Violate)
24+
25+
- **No Active Code Execution:** Do not write execution loops or implement tool runners.
26+
- **No External Integrations:** Do not connect to LiteLLM, VLLM, database proxies, or outer APIs.
27+
- **No MCP Server Role:** Do not bundle the library as a Model Context Protocol server.
28+
- **Strict Leak Rules:**
29+
- **No Raw Dumps:** Rendered prompts/contexts must not dump the entire raw payload or trace history.
30+
- **Token Hygiene:** Output must be token-light, summarized, and deterministic.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: 05_claim_hygiene
3+
description: "Defines rules for project documentation and metadata claims to prevent overstatement of security or legal compliance."
4+
---
5+
6+
# Agent Skill 05 — Claim Hygiene
7+
8+
This skill defines rules for project documentation and metadata claims to prevent overstatement of security or legal compliance.
9+
10+
## 1. Allowed System Claims
11+
12+
You may make the following claims in logs, reports, and documentation:
13+
- **Synthetic SPARK-Style Fixture:** We operate against static mock datasets representing administrative structures.
14+
- **Deterministic Packaging:** Packaging code creates identical byte outputs across repeated executions from the same input.
15+
- **Replayable Metadata:** We extract canonical field paths and commitment tokens.
16+
- **Tamper-Sensitive Hash Chain:** The package structure incorporates verification chains (payload SHA-256, sidecar final state hash, and package integrity hash).
17+
- **Schema Sidecar Validation:** The CLI enforces required field presence and scalar types on input JSON templates.
18+
- **Deterministic Replay Only:** The tool is designed exclusively for offline package packaging, verification, and schema checks; it does not perform active runtime execution, predictions, or online agent coordination.
19+
20+
## 2. Forbidden Claims (Strictly Prohibited)
21+
22+
Never write, log, or state the following claims:
23+
- **SPARK JSON Compatibility:** Do not claim compatibility with official SPARK JSON extractors or schemas.
24+
- **EU AI Act Compliance:** Do not claim the tool certifies or is compliant with the EU AI Act. Mention only "Art.-12-oriented record keeping support" as a design pattern.
25+
- **Legal or Judicial Proof:** Do not claim that packages constitute court-admissible evidence, legally binding proofs, or legal validation.
26+
- **Forensic Certainty & Recovery:** Avoid terms like "100% forensic security", "invulnerable tamper resistance", or automated forensic recovery/repair. Use "tamper-sensitive validation" only.
27+
- **MCP Integration:** Do not claim MCP capability or server features unless explicitly built in a future phase.
28+
- **Production Readiness:** The system is a mock prototype only. No production or enterprise setup readiness.
29+
- **Autonomous Decisions:** The tool does not make autonomous planning or administrative decisions.
30+
31+
## 3. Technology Boundaries (Legacy & Future Exclusions)
32+
33+
The following concepts are legacy/future design ideas only and are **not** supported by the current BMDS/SPARK alignment scope:
34+
- **XENTRY/OBD Log Engine:** XENTRY X-Engine/OBD X X-Engine log parsing is not supported.
35+
- **Consonant Signature Mapping:** Consonant-only mapping of XENTRY logs is legacy.
36+
- **Four-Layer Sandwich Log:** Sandwich formatting (Header/Middle/Window/Frame) is excluded from active claims.
37+
- **Sparse Micro-Frame Synopsis:** The dot/pipe micro-frame synopsis is a legacy prototype fallback.
38+
- **Auto-repair/recovery helpers:** No autonomous data repair or error correction is implemented.
39+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: 06_git_handoff
3+
description: "Outlines guidelines for staging, committing, and handoff actions."
4+
---
5+
6+
# Agent Skill 06 — Git Handoff
7+
8+
This skill outlines guidelines for staging, committing, and handoff actions.
9+
10+
## 1. Operating Rules (Requires Explicit User Approval)
11+
12+
- **No Auto-Git Actions:** Do not perform git init, add, commit, push, checkout, pull, or merge unless explicitly requested.
13+
- **Stage Allowed Paths Only:** If staging changes, add only the files belonging to the active phase scope. Do NOT run wildcard stages (e.g. `git add .` or `git add -A`) to avoid staging build target outputs or untracked local test files.
14+
- **Dry-Run Review:** List all files to be staged for staging verification before committing:
15+
```bash
16+
git status --short
17+
```
18+
- **Safety Boundaries:**
19+
- Never run force push (`git push -f` or `git push --force`).
20+
- Do not delete branches or rewrite commit history unless instructed.
21+
22+
## 2. Pull Request Template
23+
24+
When describing work for PRs or commits, use the template below:
25+
```text
26+
feat(<scope>): SPARK Hackathon <phase_name>
27+
28+
Summary:
29+
- Brief bulleted list of changes
30+
31+
Validation:
32+
- Test suite status
33+
- Clippy and cargo format checks
34+
```

0 commit comments

Comments
 (0)