Spec capture: skip prompts that are already in the transcript, and capture specs written during the session
Maintainer antworten meist innerhalb von 1 Tag
@migmartri arbeitet bereits daran.
Seit 05.10.2026.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Follow-up on AI session spec capture (#3495, #3500). The chainloop trace hooks ask the coding agent to copy each spec source (ticket, document, image, prompt, approved plan) into .chainloop/specs/<session-id>/. The pre-push hook then records these files as evidence of the session. A review found the gaps below.
1. Decide if the prompt is stored as a spec
Today the session records the user's prompt as a spec entry with kind: text. The prompt is already part of the transcript, so it is not external context. This gives a duplicate record and makes the spec list look strange. For example, a spec material can contain only the first user message of the transcript, so it adds no information.
To do:
- Decide if a prompt that is already in the transcript must be stored as spec evidence.
- If no: do not capture it. Keep
kind: textfor a written plan that the session approved, or for text that is not in the transcript. - If yes: write down why, and show the difference in the UI between "prompt" and "external spec".
2. Capture specs that are written during the session
Capture depends on the agent copying each source into the spec folder at the start of the session. A spec that the agent creates or changes after that point is not captured. Example: the agent writes a design note in a local notes folder outside the repository, edits it many times, and subagents use it as their plan. The note is not in the evidence. The instruction says "if the task changes, add another file", but the agent does not do it.
To do:
- Capture a spec document that is created or changed during the session, not only the sources that exist at the start.
- Possible approaches: a reminder hook after the agent writes a planning document, detection of Write/Edit calls to known spec locations (for example a configured notes path or
docs/specs/), or a check at push time that compares the files the agent read as a plan with the captured specs. - Support files outside the repository (local notes), because the URI is a local path.
How capture works today
Code: app/cli/pkg/action/trace_spec.go, trace_spec_materials.go, trace_hook_handler.go, trace_agent_hook.go, app/cli/internal/trace/spec/spec.go.
- Session start: the
session-starthook creates.chainloop/specs/and injects an instruction. The hook shows the instruction only while the session folder is empty. After the first file, a resumed session gets no reminder. - During the session: no hook detects specs. The Write/Edit/Bash hooks record line attribution only.
- On
git push: the pre-push hook reads all files in the folder of each attested session. It sorts them oldest first and keeps a maximum of 10. It redacts secrets from text files and stores images unchanged. Each file becomes oneEVIDENCEmaterial. The session material keeps only{kind, uri, digest, captured_at}for each file. - Session end: the
session-endhook deletes the spec folder of the session and its cached redactions.
Other gaps
- A re-push does not record new specs. When all AI-assisted commits are already attested, the push stops ("all AI-assisted commits already attested, skipping push"). A spec added after a push is recorded only with the next AI-assisted commit.
- Specs are deleted at session end. A push after the session ends attests the session without its spec.
- The cap of 10 entries keeps the oldest files. In a long session, a spec added late is the first one dropped.
- The prompt is captured on purpose. The instruction says "a written prompt … is kind text". The decision in part 1 changes the text of
specCaptureInstruction, not the capture code. - A code comment is out of date. The package comment in
spec.gosays that pre-push deletes the files. The code deletes them at session end.
Acceptance criteria
- There is a documented decision about prompt capture, and the implementation follows it.
- A spec document that the agent writes during the session (also outside the repository) is captured as a
documentspec with its final content. - A spec added after the first push is recorded in the evidence, also when no new AI-assisted commit exists, or there is a documented decision not to do this.
- A push after session end does not lose the spec, or there is a documented decision for this behavior.
🤖 Posted by Maximus bot (Claude Code) on behalf of @migmartri
- Vorherrschende Sprache
- Go
- Sterne
- 582
- Forks
- 61
- Ø Merge
- 12 Std. 47 Min.
- Gemergte PRs (30 T.)
- 137
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus chainloop-dev/chainloop
-
feature-parity trace-provider
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
chainloop-dev/chainloop#3802 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug trace-provider
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
chainloop-dev/chainloop#3803 ·
Maintainer antworten meist innerhalb von 1 Tag
-
feat(trace): support GitHub Copilot (CLI and VS Code) in Chainloop TraceEvtl. vergeben @migmartri hat das heute übernommen. OffenFeature spec trace-provider
chainloop-dev/chainloop#3800 · 1 Kommentar · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Allow enabling policy enforcement at the workflow contract levelEvtl. vergeben @migmartri hat das vor 10 Tagen übernommen. Offencomponent/backend new-policy spec
chainloop-dev/chainloop#3762 · 1 Kommentar · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
chainloop component/CLI performance trace-provider
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 62/100
chainloop-dev/chainloop#3756 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in chainloop-dev/chainloop
Ähnliche Issues
-
model:sonnet runtime:claude security size:S
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
FootprintAI/Containarium#3624 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Judgment-Pack/judgment-pack-runtime#367 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 87/100
pulseaiclub/phi#482 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug raised-by:desk
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
medici-finance/assay#6102 ·
Maintainer antworten meist innerhalb von 1 Tag