Skip to content

Commit d1109bb

Browse files
committed
fix(sparkctl): refresh PR handoff and agent guardrails
1 parent 081a2cb commit d1109bb

3 files changed

Lines changed: 53 additions & 55 deletions

File tree

AGENTS.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@ Hard rules:
2020
- Proposals are never auto-applied.
2121
- Human review is the approval boundary.
2222
- Artifacts preserve the evidence trail.
23+
- Keep changes scoped and reviewable.
24+
- Do not modify root `README.md` unless the human explicitly approves it.
25+
- Do not commit `reports/latest.json`.
26+
- Do not commit `reports/performance_baseline.json` when it is only validation churn.
27+
- Run cargo commands only inside `agy7rust/` unless the human explicitly approves otherwise.
2328

2429
Before editing:
2530
1. Read AGENTS.md.
2631
2. Read `.agents/skills/**/SKILL.md` relevant to the task.
27-
3. Build a compact repo map.
28-
4. Stop for approval if the user asked for plan mode.
32+
3. If `.agent/skills/00_project_system.md` exists, read it too.
33+
4. Build a compact repo map.
34+
5. Stop for approval if the user asked for plan mode.

agy7rust/src/sparkctl/spark_evidence.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub fn run_spark_evidence_demo(output_path: &str) -> Result<()> {
1717
("../artifacts/spark/extraction.spkg", "context_package"),
1818
("../artifacts/spark/context.json", "context_pack_summary"),
1919
("../artifacts/spark/context_render.txt", "review_render"),
20-
]);
20+
])?;
2121

2222
let preimage = SparkEvidencePacketPreimage {
2323
schema_version: "SPARK-EVIDENCE-PACKET-V1".to_string(),
@@ -92,19 +92,23 @@ pub fn run_spark_evidence_validate(input_path: &str) -> Result<()> {
9292
Ok(())
9393
}
9494

95-
fn build_artifact_manifest(paths: &[(&str, &str)]) -> Vec<ArtifactManifestEntry> {
95+
fn build_artifact_manifest(paths: &[(&str, &str)]) -> Result<Vec<ArtifactManifestEntry>> {
9696
paths
9797
.iter()
98-
.map(|(path, role)| ArtifactManifestEntry {
99-
path: normalize_manifest_path(path),
100-
role: (*role).to_string(),
101-
sha256: file_sha256(path),
98+
.map(|(path, role)| {
99+
Ok(ArtifactManifestEntry {
100+
path: normalize_manifest_path(path),
101+
role: (*role).to_string(),
102+
sha256: Some(file_sha256(path)?),
103+
})
102104
})
103105
.collect()
104106
}
105107

106-
fn file_sha256(path: &str) -> Option<String> {
107-
fs::read(Path::new(path)).ok().map(sha256_hex)
108+
fn file_sha256(path: &str) -> Result<String> {
109+
let bytes = fs::read(Path::new(path))
110+
.with_context(|| format!("Failed to read required demo artifact: {}", path))?;
111+
Ok(sha256_hex(bytes))
108112
}
109113

110114
fn normalize_manifest_path(path: &str) -> String {

docs/CODEX_HANDOFF_SPARK_EVIDENCE_PACKET_V1.md

Lines changed: 33 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,16 @@
55
- Working folder: `C:\Users\contr\Desktop\comptext-sparkctl-codex-work`
66
- Repo root: `C:\Users\contr\Desktop\comptext-sparkctl-codex-work\comptext-sparkctl`
77
- Rust crate root: `C:\Users\contr\Desktop\comptext-sparkctl-codex-work\comptext-sparkctl\agy7rust`
8-
- Final ZIP path: `C:\Users\contr\Desktop\comptext-sparkctl-spark-ready.zip`
8+
- Final ZIP path, if separately produced: `C:\Users\contr\Desktop\comptext-sparkctl-spark-ready.zip`
99

10-
## 2. Current Git State
10+
## 2. Current Git / PR State
1111

12-
- Current branch: `main`
13-
- Latest local commit: `c2f41e3`
14-
- `git remote -v`:
15-
16-
```text
17-
origin https://github.com/ProfRandom92/comptext-sparkctl (fetch)
18-
origin DISABLED (push)
19-
```
20-
21-
- Push URL status: `DISABLED`
22-
- `git status --short` summary at handoff creation:
23-
24-
```text
25-
M AGENTS.md
26-
M agy7rust/src/bin/sparkctl.rs
27-
M agy7rust/src/codec/package.rs
28-
M agy7rust/src/lib.rs
29-
M agy7rust/src/sparkctl/mod.rs
30-
M agy7rust/tests/spark_roundtrip.rs
31-
M reports/performance_baseline.json
32-
?? .agents/
33-
?? agy7rust/src/sparkctl/spark_evidence.rs
34-
?? artifacts/spark/evidence_packet_v1.json
35-
?? docs/
36-
?? reports/latest.json
37-
```
38-
39-
No local implementation commit has been created yet.
12+
- Branch: `spark-evidence-packet-v1`
13+
- Commit: `081a2cbb526d580c1143235f9cbfb1f4cc0df4aa`
14+
- PR: `#3`
15+
- Status: pushed, PR open, not merged.
16+
- Working tree was clean after push.
17+
- Push URL status after review setup: `DISABLED`.
4018

4119
## 3. Implemented Feature Summary
4220

@@ -50,7 +28,7 @@ No local implementation commit has been created yet.
5028
- Added tamper validation tests for stale preimage, stale canonical JSON, stale hash, and missing required fields.
5129
- Added docs for SPARK alignment, artifact contract, safety/claims, implementation report, README update proposal, and this handoff.
5230

53-
## 4. Intended Committed Files
31+
## 4. Intended PR Files
5432

5533
- `AGENTS.md`
5634
- `.agents/skills/**`
@@ -78,7 +56,7 @@ No local implementation commit has been created yet.
7856
- secrets
7957
- unrelated files
8058

81-
## 6. Validation Results Already Achieved
59+
## 6. Validation Results Achieved
8260

8361
- `cargo fmt --all --check`: PASS
8462
- `cargo test`: PASS
@@ -97,24 +75,34 @@ No local implementation commit has been created yet.
9775
- Human Review remains the approval boundary.
9876
- Goal never bypasses Policy Gate, Provider Boundary, or Human Review.
9977
- No provider calls were added.
100-
- No GitHub writes were added.
101-
- No compliance, legal, forensic, or production claims were added.
78+
- No compliance, legal, forensic, official SPARK compatibility, autonomous approval, or production readiness claims were added.
10279

103-
## 8. Remaining Next Step
80+
## 8. Current Next Step
10481

105-
No local implementation commit exists yet.
82+
Review PR `#3`, wait for GitHub CI/check status if configured, and keep any follow-up changes small and review-gated.
10683

107-
Recommended next safe sequence:
84+
## 9. Historical Pre-Commit Handoff Snapshot
10885

109-
1. Clean generated report churn:
110-
- remove `reports/latest.json`
111-
- restore `reports/performance_baseline.json` if it is only validation churn
112-
2. Create local branch `spark-evidence-packet-v1`.
113-
3. Stage intended files only.
114-
4. Commit locally with:
86+
This section preserves the original pre-commit handoff state for audit context only. It is not the current branch state.
87+
88+
- Current branch at that time: `main`
89+
- Latest local commit at that time: `c2f41e3`
90+
- Push URL status at that time: `DISABLED`
91+
- `git status --short` summary at handoff creation:
11592

11693
```text
117-
feat(sparkctl): add SPARK Evidence Packet v1
94+
M AGENTS.md
95+
M agy7rust/src/bin/sparkctl.rs
96+
M agy7rust/src/codec/package.rs
97+
M agy7rust/src/lib.rs
98+
M agy7rust/src/sparkctl/mod.rs
99+
M agy7rust/tests/spark_roundtrip.rs
100+
M reports/performance_baseline.json
101+
?? .agents/
102+
?? agy7rust/src/sparkctl/spark_evidence.rs
103+
?? artifacts/spark/evidence_packet_v1.json
104+
?? docs/
105+
?? reports/latest.json
118106
```
119107

120-
5. Do not push without explicit push/PR approval.
108+
At that historical point, no local implementation commit had been created yet. The recommended sequence then was to clean generated report churn, create `spark-evidence-packet-v1`, stage intended files only, commit with `feat(sparkctl): add SPARK Evidence Packet v1`, and avoid push without explicit approval.

0 commit comments

Comments
 (0)