You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(platform-integrations): automate provenance matching with native-transcript awareness
Provenance was a fully-manual procedure with no deterministic plumbing, so the
recall->entity->trajectory loop couldn't be closed or tested. Add provenance.py:
- candidates: read audit recall rows, skip already-influenced pairs, resolve
each entity id <type>/<name> to its file, locate the session trajectory, and
emit JSONL judgment candidates (entities/trajectories that can't be found are
emitted with a missing:[...] field, never silently dropped)
- record: validate + persist an influence verdict via the existing log_influence
writer (no duplicated write logic)
- trajectory locator now also reads the NATIVE Claude transcript at
~/.claude/projects/<slug>/<sid>.jsonl (slug logic shared with doctor), so
provenance works in the hookless world where no .evolve/trajectories/ is written
The semantic verdict (followed/contradicted/not_applicable) stays agent-driven;
provenance.py does only the deterministic matching/resolution + recording.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: platform-integrations/bob/evolve-lite/skills/evolve-lite-provenance/SKILL.md
+83-34Lines changed: 83 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,58 +7,107 @@ description: Analyze saved trajectories and recall audit events offline to recor
7
7
8
8
## Overview
9
9
10
-
This skill runs after one or more sessions have completed. It reads saved trajectories from `.evolve/trajectories/`, matches them to `recall` events in `.evolve/audit.log`, and records post-hoc `influence` events for recalled guidelines.
10
+
This skill runs after one or more sessions have completed. It reads `recall`
11
+
events from `.evolve/audit.log`, locates each session's trajectory, and records
12
+
post-hoc `influence` events for the recalled guidelines.
11
13
12
-
Use this skill when you want to compute usage provenance without coupling the work to the live learn step.
14
+
The mechanical work — reading recall rows, skipping already-assessed pairs,
15
+
resolving entity files, and locating trajectories — is done deterministically by
16
+
`provenance.py candidates`. Your job is the judgment: read each candidate and
17
+
decide whether the recalled guideline was `followed`, `contradicted`, or
18
+
`not_applicable`, then persist that verdict.
13
19
14
-
## Workflow
15
-
16
-
### Step 1: Load Recall Events
17
-
18
-
Read `.evolve/audit.log` as JSONL. Find entries where `event == "recall"` and `entities` is a non-empty list.
19
-
20
-
Skip any recall event that already has `influence` entries for the same `session_id` and entity ids. Do not write duplicate influence records.
21
-
22
-
### Step 2: Locate Saved Trajectories
20
+
Use this skill when you want to compute usage provenance without coupling the
21
+
work to the live learn step.
23
22
24
-
List `.evolve/trajectories/` and match each recall event to a trajectory by `session_id`.
25
-
26
-
Matching strategy (in order):
27
-
1.`claude-transcript_<session-id>.jsonl` - the stop-hook transcript dump; the session id is in the filename.
28
-
2.`trajectory_<timestamp>_<session-id>.json` - written by the evolve-lite:save-trajectory skill when a session id is available. Match on the `<session-id>` slice of the filename.
29
-
3.`trajectory_<timestamp>.json` - open the file and match its top-level `session_id` field against the recall event. Only fall back to this step when the filename alone does not identify the session.
30
-
31
-
If none of the above yields a confident match for a recall event, skip it. Do not guess.
32
-
33
-
### Step 3: Read Recalled Entities
23
+
## Workflow
34
24
35
-
For each recalled entity id, open `.evolve/entities/<id>.md`. The id is a path relative to `.evolve/entities/` without the `.md` suffix, such as `guideline/foo` or `subscribed/alice/guideline/foo`.
25
+
### Step 1: Get candidates
36
26
37
-
Read the entity content and trigger. Skip ids whose files are missing.
27
+
Run the candidate builder. It emits one JSON object per line (JSONL), one per
0 commit comments