Review fixes; README and CLAUDE.md finalised
- cancel reverts only the run's commits (base..HEAD), never the caller's edits - validator diffs base..HEAD, not the working tree - fix commits carry their Co-Authored-By line; no redundant end benchmark - score.py: clear error on a missing labels file; docstring says end is not passed - usage lines; README and CLAUDE.md for the generic workflow Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0de006bcb2
commit
388619685a
10 files changed
+63
-30
No files matched your search
@@ -48,13 +48,13 @@ Each agent is called with the Agent tool, its `subagent_type` (`detectors:upgrad
|
||||
4. **Validator**, which reads neither the diagnosis nor the detail of the modification: `Detectors: <DETECTORS>. Families: <FAMILIES>. Modification: <OUT>/modification.md. Range score: <OUT>/range-before.txt → <OUT>/range-after.txt. Benchmark: <OUT>/benchmark-before.txt → <OUT>/benchmark-after.txt, after each fix: <OUT>/benchmark-S*.txt; command: <…>. Events command for any station: python3 <DETECTORS>/scripts/categories.py <station folder> --from <from> --to <to>. Base: <base>. Write <OUT>/validation.md.`
|
||||
- `keep`: go to the summary.
|
||||
- `remove`: for each fix of the `**Remove**:` line, its commits (`git -C <DETECTORS> log --format=%h --grep ': S<n>$' <base>..HEAD`), from the most recent: `git -C <DETECTORS> revert --no-edit <commit>`, then `git -C <DETECTORS> commit --amend -m "wf-improve: S<n> removed" -m "Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>"`. A conflict: `git -C <DETECTORS> revert --abort`, and do as for `cancel`.
|
||||
- `cancel`, or anything else: `git -C <DETECTORS> checkout <base> -- 'scripts/*.py' thresholds.md` (without the files already modified), commit of these paths, message `wf-improve: modification cancelled`.
|
||||
- `cancel`, or anything else: `git -C <DETECTORS> revert --no-commit <base>..HEAD && git -C <DETECTORS> commit -m "wf-improve: modification cancelled" -m "Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>"` (only what the fix commits changed; files already modified stay as they are).
|
||||
|
||||
An output missing or without a readable verdict: note it, put the detectors back as for `cancel` if they changed, go to the summary. Do not rerun an agent.
|
||||
|
||||
## Summary
|
||||
|
||||
Measures, step `end` (unless nothing changed: then `end` = `before`). Then `<OUT>/summary.md`:
|
||||
Measures, step `end`, only after a `remove`; otherwise `end` is `after` (`keep`) or `before` (`cancel`, nothing changed). Then `<OUT>/summary.md`:
|
||||
|
||||
```markdown
|
||||
# wf-improve: <station>, <FROM> → <TO>
|
||||
|
||||
@@ -25,7 +25,8 @@ HISTORY = timedelta(days=3) # as the batch command of categories.py
|
||||
|
||||
|
||||
def events(measurements, start, end, folder=None):
|
||||
"""Detectors' events touching the range, classified with its days of history (as the batch command)."""
|
||||
"""Detectors' events touching the range, classified with its days of history. Unlike the batch command, end is not
|
||||
passed: no_data does not see a hole touching the end of the range."""
|
||||
h, b = parse_time(start) - HISTORY, parse_time(end)
|
||||
chunk = {s: k for s, ms in measurements.items() if (k := [m for m in ms if h <= m["t"] < b])}
|
||||
return [v for v in (categories.events(chunk, folder=folder) if chunk else []) if v["end"] >= start]
|
||||
@@ -88,6 +89,8 @@ if __name__ == "__main__":
|
||||
p.add_argument("--from", dest="start", required=True)
|
||||
p.add_argument("--to", dest="end", required=True)
|
||||
a = p.parse_args()
|
||||
if not os.path.exists(a.labels):
|
||||
sys.exit(f"No labels file: {a.labels}")
|
||||
station, start, end = os.path.basename(os.path.normpath(a.folder)), iso(parse_time(a.start)), iso(parse_time(a.end))
|
||||
n, labels = family_scores(a.folder, a.labels, start, end)
|
||||
if not labels:
|
||||
|
||||
Reference in new issue
Block a user