Skip to content

Commit 609bb44

Browse files
authored
Merge pull request #128 from drpedapati/codex/image-slide-artifact-routing
fix(agent): preserve image-generated slide intent
2 parents 8b9a9df + bacb580 commit 609bb44

15 files changed

Lines changed: 411 additions & 7 deletions

File tree

.agents/skills/ship-job/SKILL.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: ship-job
3+
description: Ship a SciClaw software change through an isolated worktree, implementation, pruning, verification, commit, push, draft pull request, CI closeout, and independent review. Use when asked to ship a job, complete a change through PR, prepare a release candidate, or follow the repository's happy path toward Homebrew release and Data3 deployment.
4+
---
5+
6+
# Ship job
7+
8+
Deliver a reviewable packet, not uncommitted local work. Keep implementation in an isolated worktree and preserve unrelated changes.
9+
10+
## Authority boundary
11+
12+
Invocation authorizes implementation, commit, push, and a draft PR. It does not by itself authorize merge, tag creation, release publication, Homebrew tap mutation, or deployment. Treat those as explicit post-review gates.
13+
14+
## Workflow
15+
16+
1. Reconfirm the requested outcome, acceptance criteria, exclusions, and authority.
17+
2. Inspect the repository root, remotes, worktrees, dirty state, base commit, related PRs, and repository guidance.
18+
3. Create a unique branch and isolated worktree from the evidence-backed base. Reconfirm isolation before every edit, test, commit, and publish operation.
19+
4. Read the governing code, tests, specifications, and skills. Implement the smallest cohesive change.
20+
5. Prune the complete diff: remove dead code, duplicate paths, abandoned attempts, unnecessary abstractions, stale documentation, and generated debris.
21+
6. Run focused tests followed by the broadest practical suite. Inspect formatting, build, `git diff --check`, status, and the complete diff. Visually inspect real renders for visual work.
22+
7. Perform a pre-publish review. Fix material findings and rerun affected checks.
23+
8. Commit only intended files, push the branch, and open a draft PR against the verified base.
24+
9. Add a standalone independent-review packet using `references/external-review-prompt.md` and record the closeout using `references/correspondence-template.md`.
25+
10. Monitor CI, mergeability, and in-scope feedback. Fix branch-caused failures without silently expanding scope.
26+
11. Report the ordered merge train and the next authorized action.
27+
28+
## SciClaw release continuation
29+
30+
When the user separately authorizes merge, release, or deployment, read `references/sciclaw-release.md` completely and follow its gates. Never tag a commit other than the reviewed merge head. Use Homebrew as the deployment source of truth; never hot-copy or symlink a development binary into the service path.
31+
32+
## Completion contract
33+
34+
A ship job is incomplete without:
35+
36+
- isolated worktree and branch;
37+
- pruned and verified change;
38+
- commit and push;
39+
- draft PR;
40+
- independent-review prompt on the branch or PR;
41+
- CI/review status and merge train;
42+
- explicit limitations and next safe action.
43+
44+
Final reporting must include worktree, branch, base, commit, PR, verification, evidence, limitations, review packet path, merge train, and the next gate.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "Ship Job"
3+
short_description: "Ship reviewed changes through a draft PR"
4+
default_prompt: "Use $ship-job to deliver this change through a verified draft pull request."
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Ship closeout
2+
3+
Record:
4+
5+
1. answer first: ready for review or blocked;
6+
2. user-visible outcome;
7+
3. concise architecture and intentional cleanup;
8+
4. worktree, branch, base, head, PR, and dirty state;
9+
5. ordered merge train and blockers;
10+
6. verification commands and observed outcomes;
11+
7. external evidence and visual inspection where applicable;
12+
8. limitations and excluded work;
13+
9. next authorized gate;
14+
10. completed independent-review prompt.
15+
16+
Do not include secrets, credentials, PHI, or raw tokens.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Independent review prompt
2+
3+
```text
4+
Act as an independent senior engineer reviewing this SciClaw pull request. Do not trust the implementer's summary as proof. Inspect the exact base/head commits, full diff, tests, prompt assembly, runtime skill routing, packaging, and cited evidence.
5+
6+
Submit findings as a GitHub review. Approve only when no material findings remain; request changes for merge blockers; comment when evidence is incomplete. Do not merge or push fixes.
7+
8+
Verify:
9+
1. The diff matches the requested behavior without unrelated changes.
10+
2. Removed prompt language is absent from runtime, templates, documentation, and tests.
11+
3. Artifact routing distinguishes standalone images, slide assets, editable PowerPoint, and complete image-generated slides.
12+
4. Tests would fail for the prior behavior and cover important negative cases.
13+
5. Provider image transport, persistence, and Discord attachment behavior remain intact.
14+
6. Homebrew/release implications and rollback are accurately described.
15+
7. No dead code, duplicate paths, stale attempt leftovers, secrets, or generated debris remain.
16+
17+
Return: verdict, findings by severity with file/line references, evidence and commands rerun, unverified claims, and minimal remediation before merge.
18+
```
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# SciClaw release and deployment continuation
2+
3+
Read this only after the draft PR is verified and the user has separately authorized the applicable merge, release, or deployment operation.
4+
5+
## Merge gate
6+
7+
1. Refresh the exact PR head, review decision, mergeability, and CI.
8+
2. Require no unresolved material review findings.
9+
3. Merge only with explicit authorization.
10+
4. Record the resulting `main` commit. All tags and release artifacts must derive from that commit.
11+
12+
## Version gate
13+
14+
1. Inspect the latest stable and development tags; never guess the next version.
15+
2. Use a new patch version after any change to an earlier canary. Never move or rewrite a published tag.
16+
3. Update release notes and public documentation when the change is user-visible.
17+
18+
## Release paths
19+
20+
Prefer the repository workflow:
21+
22+
```bash
23+
make release-dispatch RELEASE_TAG=vX.Y.Z
24+
```
25+
26+
For a development canary, use the repository's development release target with a fresh `-dev.N` tag. For a stable local release, `make release-local RELEASE_TAG=vX.Y.Z` requires a clean tree.
27+
28+
Verify the GitHub workflow created the expected tag, binaries, checksums, release, and—only for a stable non-draft release—the Homebrew tap update.
29+
30+
## Homebrew deployment contract
31+
32+
Follow `docs/ops/brew-only-deployment-contract.md` completely. On Data3, use Linuxbrew's resolved paths.
33+
34+
1. Snapshot the current version, resolved binary, service binding, model status, and gateway health.
35+
2. Run `brew update` and upgrade the intended `sciclaw` or `sciclaw-dev` formula.
36+
3. Refresh/reinstall the service using the active Brew binary, then restart it.
37+
4. Verify the binary resolves under the Brew Cellar/opt path and the service uses the same installation.
38+
5. Run `sciclaw doctor`, `sciclaw status`, and `sciclaw models status`.
39+
6. Confirm Discord reconnects and execute a narrow live canary in the intended routed workspace.
40+
41+
Do not overwrite configuration, workspace state, credentials, routing, or memory during upgrade.
42+
43+
### Existing workspace guidance refresh
44+
45+
Onboarding does not overwrite an existing workspace `AGENTS.md`. For this release, inspect the active DEB guidance at `/home/ernie/Dropbox/sciclaw/deb-sciclaw/AGENTS.md` after taking a timestamped backup. If it contains the obsolete image-generation sentence, replace only that sentence with the new `image-generation` skill routing from the installed workspace template. Show the exact diff, verify the obsolete wording is absent, and preserve every unrelated workspace instruction. Do not replace the whole file.
46+
47+
Confirm the routed DEB workspace contains the released `skills/image-generation/SKILL.md`. If it is missing, use the released SciClaw skill installation/doctor repair path; do not copy it from a development checkout.
48+
49+
## Imagery-routing acceptance
50+
51+
For image-generation changes, test distinct products in a fresh DEB session:
52+
53+
1. standalone illustration;
54+
2. visual asset intended for a slide;
55+
3. editable PowerPoint improvement;
56+
4. complete image-generated 16:9 slide using supplied PowerPoint content.
57+
58+
The complete-slide case must retain an action title, concise audience-facing wording, an integrated exhibit or analogy, and a clear takeaway. It must not silently return a wordless illustration or switch to editable PowerPoint.
59+
60+
## Rollback
61+
62+
Record the previous formula version and service state before deployment. If the canary fails, restore the prior Brew version using the documented contract, refresh the service, and verify gateway recovery. Do not repair a failed release with a hot-copied binary.

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ auth.json
7575

7676
# Local agent scratch
7777
.agent/
78-
.agents/
78+
.agents/*
79+
!.agents/skills/
80+
.agents/skills/*
81+
!.agents/skills/ship-job/
82+
!.agents/skills/ship-job/**
7983
.cache/
8084
.claude/
8185
.factory/

AGENTS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Repository agent guidance
2+
3+
For end-to-end implementation and pull-request work, use the vendored repository skill at `.agents/skills/ship-job/SKILL.md`. Read it completely before changing files, and use `.agents/skills/ship-job/references/sciclaw-release.md` for any separately authorized merge, release, Homebrew, or Data3 deployment operation.
4+
5+
Repository-local guidance takes precedence over similarly named user-level skill copies for work in this repository.

cmd/picoclaw/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ var baselineScienceSkillNames = []string{
8282
"quarto-authoring",
8383
"pandoc-docx",
8484
"imagemagick",
85+
"image-generation",
8586
"beautiful-mermaid",
8687
"explainer-site",
8788
"experiment-provenance",

docs/issues/gpt55-image-generation-rfc.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ Files (expected):
208208

209209
- `pkg/tools/generate_image.go` (+ tests)
210210
- Register in `pkg/agent/loop.go` `createToolRegistry`
211-
- `skills/image-gen/SKILL.md` (routing + provenance notes)
211+
- `skills/image-generation/SKILL.md` (final-artifact routing)
212212
- AGENTS.md baseline skill bullet
213213
- Config knobs (optional): enable flag, default model `gpt-image-2`, default size/quality, output dir
214214

@@ -264,7 +264,7 @@ Only after Phase 0 proves Codex or API-key Responses works:
264264

265265
1. **OAuth vs API key:** Can Codex backend host `image_generation` for sciClaw OAuth users? Unknown until smoke-tested.
266266
2. **Cost / abuse:** Image gen is expensive; need enable flag + maybe per-workspace allowlist.
267-
3. **Scientific integrity:** Generated illustrations must not be presented as real experimental data. Skill copy must say so.
267+
3. **Final-artifact routing:** Image generation must preserve the requested product. A standalone image, a visual asset for a larger artifact, an editable PowerPoint, and a complete image-generated slide are distinct outputs and must not be substituted for one another.
268268
4. **Vendor SDK age:** Vendored `openai-go/v3` documents older GPT Image models in some comments; Image API may still accept `gpt-image-2` via raw HTTP even if SDK enums lag. Prefer thin HTTP client in the tool (like `WeatherForecastTool`) or bump vendor.
269269
5. **PHI mode:** Local models cannot call OpenAI image APIs; tool must no-op/error clearly in PHI mode.
270270
6. **Cursor skill confusion:** Higgsfield / GenerateImage skills live in the IDE, not sciClaw. Document that they are out of scope for runtime chat.
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# Image-generated slide artifact routing closeout
2+
3+
## Answer first
4+
5+
Ready for independent review in draft PR [#128](https://github.com/drpedapati/sciclaw/pull/128). The implementation is committed and pushed; merge, release, Homebrew publication, and Data3 deployment have not been performed.
6+
7+
## What changed
8+
9+
SciClaw now routes image generation by the requested final product instead of allowing tool salience to switch between a wordless illustration and an editable PowerPoint. The obsolete “real experimental data” warning was removed from runtime guidance, workspace templates, and the image-generation RFC policy. A built-in `image-generation` skill distinguishes four products: standalone image, visual asset for another artifact, editable presentation, and complete worded image-generated slide.
10+
11+
The complete-slide contract encodes the successful DEB stress-capacity pattern: 16:9 composition, action title, concise audience-facing wording, integrated exhibit or visual analogy, and clear takeaway. Provider image transport, persistence, and Discord attachment code are unchanged.
12+
13+
The repository now vendors `.agents/skills/ship-job/`, and root `AGENTS.md` points repository work to that copy. Its SciClaw continuation gates merge, versioning, release, Homebrew deployment, surgical DEB workspace guidance refresh, canary verification, and rollback.
14+
15+
## Repository position
16+
17+
- Repository: `https://github.com/drpedapati/sciclaw`
18+
- Worktree: `/Users/ernie/Developer/sciclaw/.worktrees/image-slide-artifact-routing`
19+
- Branch: `codex/image-slide-artifact-routing`
20+
- Base: `main` at `8b9a9df8670e93ef5e233aa2c2ad5cc7bc7a7743`
21+
- Reviewed implementation commit: `8d3cae4c`
22+
- Pull request: [#128](https://github.com/drpedapati/sciclaw/pull/128)
23+
24+
This correspondence is a packet-only follow-up to the reviewed implementation commit. Review the current PR head to include this document.
25+
26+
## Merge train
27+
28+
One car: PR #128, `main``codex/image-slide-artifact-routing`. It has no branch or PR prerequisite. Safe order is review and green CI, then an explicitly authorized merge. Release and deployment follow only after that merge.
29+
30+
## Verification
31+
32+
- `go test ./pkg/agent ./pkg/providers ./pkg/workspacetpl/...` — passed.
33+
- `go test ./... -count=1` — passed sequentially across all packages.
34+
- `go vet ./...` — passed.
35+
- `go build ./cmd/picoclaw` — passed.
36+
- `git diff --check` — passed.
37+
- `uv run --with pyyaml python .../quick_validate.py .agents/skills/ship-job` — valid.
38+
- `uv run --with pyyaml python .../quick_validate.py skills/image-generation` — valid.
39+
- Independent standards review — initial duplication concern fixed; re-review found no material findings.
40+
- Independent spec review — DEB refresh, academic hierarchy, and routing-test gaps fixed; re-review found no material gaps.
41+
42+
One timing-sensitive binary-inspection test was killed while four Go workloads ran concurrently. The isolated test passed, and the complete suite then passed sequentially. This was treated as resource contention, not hidden as a green first run.
43+
44+
## Limits
45+
46+
- No merge, tag, GitHub release, Homebrew tap update, or deployment has occurred.
47+
- Live four-mode DEB acceptance requires the released binary and refreshed routed workspace, so it remains a post-release canary.
48+
- The provider does not persist an internal rewritten image prompt; this change does not claim prompt-level reproducibility beyond saved user/session context.
49+
50+
## Next safe action
51+
52+
Run the independent GitHub review below against the current PR head and close CI. If no material findings remain, request explicit merge authorization. After merge, use `.agents/skills/ship-job/references/sciclaw-release.md` for a separately authorized release and Data3 deployment.
53+
54+
## Independent review prompt
55+
56+
```text
57+
Act as an independent senior engineer reviewing a proposed SciClaw change. Do not trust the implementer's summary as proof. Inspect the repository, exact PR diff, tests, prompt assembly, skills, packaging, and cited evidence yourself.
58+
59+
When finished, submit findings on the pull request as a GitHub review. Approve only if no material findings remain; request changes for merge blockers; comment when evidence is incomplete. Do not merge, push fixes, or resolve your own findings.
60+
61+
Repository: drpedapati/sciclaw — https://github.com/drpedapati/sciclaw
62+
Pull request: #128 — https://github.com/drpedapati/sciclaw/pull/128
63+
Base branch and commit: main at 8b9a9df8670e93ef5e233aa2c2ad5cc7bc7a7743
64+
Head branch: codex/image-slide-artifact-routing; inspect the current PR head
65+
Worktree: /Users/ernie/Developer/sciclaw/.worktrees/image-slide-artifact-routing
66+
67+
Job requested:
68+
Vendor the ship-job development skill inside SciClaw and point repository guidance to it. Remove the misleading generated-image provenance warning. Preserve working provider transport. Route standalone images, slide assets, editable PowerPoint, and complete worded image-generated slides as distinct products. Complete-slide mode must encode the successful DEB stress-capacity communication hierarchy. Prepare the verified draft PR and a gated Brew/Data3 continuation without merging or deploying.
69+
70+
Material constraints:
71+
- No provider image transport, media persistence, or Discord attachment rewrite.
72+
- No merge, release, Homebrew mutation, or production deployment in this PR run.
73+
- Existing DEB guidance must be refreshed surgically after release; unrelated workspace instructions must survive.
74+
75+
Implemented design:
76+
The runtime hosted-tool note and workspace template route to one canonical built-in image-generation skill. That skill owns the detailed four-product contract and presentation hierarchy. Baseline onboarding installs it. Negative regression tests prevent restoration of the removed warning and assert all four routes. A repo-local ship skill owns PR closeout and a separately gated SciClaw release continuation.
77+
78+
Changed-file map:
79+
- pkg/agent/loop.go: concise hosted-tool routing pointer.
80+
- pkg/agent/context_test.go: prompt, template, and canonical-skill regressions.
81+
- skills/image-generation/SKILL.md: four-product source of truth.
82+
- cmd/picoclaw/main.go: baseline skill installation.
83+
- pkg/workspacetpl/templates/workspace/AGENTS.md: workspace routing pointer.
84+
- docs/issues/gpt55-image-generation-rfc.md: replace obsolete policy.
85+
- .agents/skills/ship-job/** and AGENTS.md: vendored development workflow and pointer.
86+
- .gitignore: allow only the vendored ship skill beneath otherwise local `.agents` state.
87+
88+
Claims requiring independent verification:
89+
1. Runtime/template/skill guidance no longer contains the obsolete warning except negative test literals.
90+
2. All four requested artifact modes, academic hierarchy, 16:9 complete-slide contract, and DEB reference are protected by meaningful tests.
91+
3. Provider transport and outbound attachment behavior are unchanged.
92+
4. Existing DEB workspace remediation is bounded, diff-verified, and release-gated.
93+
94+
Tests reported:
95+
- go test ./... -count=1 — pass
96+
- go vet ./... — pass
97+
- go build ./cmd/picoclaw — pass
98+
- git diff --check — pass
99+
- both SKILL.md packages pass quick_validate.py
100+
101+
External ground truth:
102+
The DEB Discord thread produced a successful complete image-generated stress-capacity slide only after the user explicitly distinguished it from both a wordless conceptual image and an editable PowerPoint. The implementation uses that communication hierarchy as a qualitative reference, not a pixel snapshot.
103+
104+
Known limitations:
105+
- Live DEB four-mode acceptance is a post-release canary.
106+
- Internal provider-rewritten image prompts are not persisted.
107+
108+
Review tasks:
109+
1. Confirm the diff matches requested behavior without broader changes.
110+
2. Flag dead code, dual policies, or leftovers from earlier attempts.
111+
3. Trace runtime prompt assembly and baseline skill installation.
112+
4. Check failure modes, workspace migration safety, packaging, and rollback.
113+
5. Confirm tests fail for old behavior and cover important negatives.
114+
6. Reproduce critical claims where practical.
115+
7. Report findings by severity with file/line references.
116+
```

0 commit comments

Comments
 (0)