added skills and scripts folder
This commit is contained in:
6
sources/skills and scripts/detect-readme.md
Normal file
6
sources/skills and scripts/detect-readme.md
Normal file
@@ -0,0 +1,6 @@
|
||||
./detect.sh [SLUG] -b -r -a -j 6
|
||||
-b = basic, 12x (some also evaluate graded runs)
|
||||
-r = run-gated only, 3x
|
||||
-a = atomic only, 2x
|
||||
-j = number of parallel jobs
|
||||
or any combination of these.
|
||||
100
sources/skills and scripts/detect.sh
Normal file
100
sources/skills and scripts/detect.sh
Normal file
@@ -0,0 +1,100 @@
|
||||
#!/usr/bin/env bash
|
||||
# detect.sh — run every self-check detector against one task, then
|
||||
# summarise the verdicts.
|
||||
#
|
||||
# ./detect.sh missed-blocking-llm-calls .. # sequential
|
||||
# ./detect.sh missed-blocking-llm-calls .. -j 6 # six at a time
|
||||
# ./detect.sh missed-blocking-llm-calls -b # + basic
|
||||
# ./detect.sh missed-blocking-llm-calls -r # + run-gated
|
||||
# ./detect.sh missed-blocking-llm-calls -a # + atomic
|
||||
# ./detect.sh missed-blocking-llm-calls -f # force all
|
||||
#
|
||||
|
||||
set -uo pipefail
|
||||
|
||||
ROOT=/workspace # detectors resolve every path relative to the toolkit root
|
||||
JOBS=1; BASIC=0; RUN_GATED=0; ATOMIC=0; FORCE_ALL=0; SLUG="";
|
||||
|
||||
DETECTORS_BASIC=( detector-answer-obviousness detector-credential-leakage detector-cross-task-reference detector-dimension-misapplication detector-fact-check-rubric-claims detector-good-response-defined detector-good-response-exhaustiveness detector-offline-verifiability detector-over-hinting detector-rubric-clarity detector-rubric-generality detector-snapshot-leakage )
|
||||
DETECTORS_RUN=( detector-broken-dev-env detector-meaningful-failure detector-run-behaviors )
|
||||
DETECTORS_ATOMIC=( detector-rubric-coverage detector-rubric-form )
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
-j) JOBS="$2"; shift 2 ;;
|
||||
-b) BASIC=1; shift ;;
|
||||
-r) RUN_GATED=1; shift ;;
|
||||
-a) ATOMIC=1; shift ;;
|
||||
-f) FORCE_ALL=1; shift ;;
|
||||
-*) echo "unknown flag: $1" >&2; exit 2 ;;
|
||||
*) SLUG="$1"; shift ;;
|
||||
esac
|
||||
done
|
||||
[[ -n "$SLUG" ]] || { echo "usage: $0 <slug> [-j N] [-a|-r|-f]" >&2; exit 2; }
|
||||
|
||||
cd "$ROOT" || exit 1
|
||||
[[ -d "harbor-tasks/$SLUG" ]] || { echo "no such task: harbor-tasks/$SLUG" >&2; exit 2; }
|
||||
|
||||
LOGDIR="harbor-tasks/$SLUG/detectors/.logs"
|
||||
mkdir -p "$LOGDIR"
|
||||
|
||||
RUNS=$(find "harbor-tasks/$SLUG/reference-runs" -mindepth 1 -maxdepth 1 -type d 2>/dev/null | wc -l)
|
||||
if [[ $RUNS -eq 0 ]]; then
|
||||
printf ' Warning: No Runs found!\n'
|
||||
fi
|
||||
|
||||
if [[ BASIC -eq 0 && RUN_GATED -eq 0 && ATOMIC -eq 0 && FORCE_ALL -eq 0 ]]; then
|
||||
BASIC=1
|
||||
fi
|
||||
|
||||
QUEUE=()
|
||||
if [[ $BASIC -eq 1 || $FORCE_ALL -eq 1 ]]; then
|
||||
for d in "${DETECTORS_BASIC[@]}"; do
|
||||
QUEUE+=("$d")
|
||||
done
|
||||
fi
|
||||
if [[ $RUN_GATED -eq 1 || $FORCE_ALL -eq 1 ]]; then
|
||||
for d in "${DETECTORS_RUN[@]}"; do
|
||||
QUEUE+=("$d")
|
||||
done
|
||||
fi
|
||||
if [[ $ATOMIC -eq 1 || $FORCE_ALL -eq 1 ]]; then
|
||||
for d in "${DETECTORS_ATOMIC[@]}"; do
|
||||
QUEUE+=("$d")
|
||||
done
|
||||
fi
|
||||
|
||||
run_one() {
|
||||
local d="$1" slug="$2" logdir="$3"
|
||||
local log="$logdir/$d.log" t0 dt
|
||||
t0=$(date +%s)
|
||||
if timeout 1800 claude -p "/$d $slug" --permission-mode acceptEdits \
|
||||
>"$log" 2>&1; then
|
||||
dt=$(( $(date +%s) - t0 ))
|
||||
printf ' %-42s ok %4ss\n' "$d" "$dt"
|
||||
else
|
||||
dt=$(( $(date +%s) - t0 ))
|
||||
printf ' %-42s FAILED %4ss → %s\n' "$d" "$dt" "$log"
|
||||
fi
|
||||
}
|
||||
export -f run_one
|
||||
|
||||
echo "Running ${#QUEUE[@]} detectors on $SLUG (-j $JOBS)"
|
||||
printf '%s\n' "${QUEUE[@]}" \
|
||||
| xargs -P "$JOBS" -I{} bash -c 'run_one "$@"' _ {} "$SLUG" "$LOGDIR"
|
||||
|
||||
echo
|
||||
echo "Verdicts:"
|
||||
for d in "${QUEUE[@]}"; do
|
||||
f="harbor-tasks/$SLUG/detectors/$d.md"
|
||||
if [[ -f "$f" ]]; then
|
||||
awk -v n="$d" '
|
||||
/^---$/ { seen++; next }
|
||||
seen==1 && /^verdict:/ { v=$2 }
|
||||
seen==1 && /^confidence:/ { c=$2 }
|
||||
END { printf " %-42s %-24s %s\n", n, (v?v:"?"), (c?c:"") }
|
||||
' "$f"
|
||||
else
|
||||
printf ' %-42s %s\n' "$d" "(no report)"
|
||||
fi
|
||||
done
|
||||
110
sources/skills and scripts/review-detector-reports skill
Normal file
110
sources/skills and scripts/review-detector-reports skill
Normal file
@@ -0,0 +1,110 @@
|
||||
---
|
||||
name: review-detector-reports
|
||||
description: |
|
||||
Review detector self-check reports with the task author, one issue at a time, each
|
||||
quoted from the report and from the rubric it concerns, with a proposed fix. Use
|
||||
whenever detector reports have landed or been re-run — "what did the detectors find",
|
||||
"go through the findings", "walk me through the issues", "go through them one by one",
|
||||
"what's left to fix", "is my task ready to submit".
|
||||
---
|
||||
|
||||
# Reviewing detector reports
|
||||
|
||||
Findings live in `harbor-tasks/<slug>/detectors/<name>.md`. When a detector runs as a
|
||||
subagent its notification also carries a summary — written by the same agent whose
|
||||
reasoning you are checking, and lossy in ways you cannot detect without the file.
|
||||
|
||||
## The four rules
|
||||
|
||||
**Read the report files** — the whole report, not just the findings section. Coverage maps,
|
||||
"considered and not raised" notes, and the overall verdict carry material the findings
|
||||
section does not.
|
||||
|
||||
**Never rely on a summary alone.** Use the notification to learn a report exists, then open
|
||||
it. If you relay something you only saw in a summary, say so.
|
||||
|
||||
**Wait for every pending report, then take one issue at a time.** A partial view produces
|
||||
findings that dissolve when the next report lands.
|
||||
|
||||
**Aggregate confluence.** Several detectors landing on the same passage is one issue with
|
||||
several pieces of evidence. Name every detector that touched it inside that single issue.
|
||||
One detector raising several passages is several issues, however the report groups them —
|
||||
reports group by defect class, issues by the decision the author has to make.
|
||||
|
||||
## Issue format
|
||||
|
||||
### <short issue name>
|
||||
|
||||
**Detector:** <name> — all of them, when aggregated
|
||||
**Verdict:** <verdict> / <confidence> — per detector, when aggregated
|
||||
|
||||
**What the detector says:**
|
||||
> verbatim from the report file
|
||||
|
||||
**What it is about:** <file, and the enclosing item — criterion id, penalty name, section>
|
||||
> the whole enclosing item, verbatim
|
||||
|
||||
**Proposed fix:**
|
||||
> the same passage rewritten in full, with **additions in bold** and ~~deletions struck
|
||||
> through~~
|
||||
|
||||
Then your own read — is the finding correct, what are the options, what does each cost.
|
||||
Below the quotes, so the author can see where the detector stops and you begin.
|
||||
|
||||
**Quote whole items, and name them.** The unit is the enclosing item — a complete atomic
|
||||
criterion with its id and severity, a whole heavy penalty, a whole rubric section — not a
|
||||
paragraph lifted out of one. Say which file and which item before the quote. A fragment
|
||||
hides the qualifier that already covers the objection and the neighbouring line the fix
|
||||
would contradict; an unlabelled fragment also leaves the author working out what they are
|
||||
even looking at.
|
||||
|
||||
**One inline diff, not two blocks.** Current-and-proposed pushes the diffing onto the
|
||||
reader. Markdown does not render inside a code fence, so put the fix in a blockquote; when
|
||||
the passage is indented YAML, quote it as prose and get the indentation right yourself.
|
||||
|
||||
## Working the reports
|
||||
|
||||
Verdict vocabularies differ per detector, so check each one's own enum in its `core.md`
|
||||
rather than pattern-matching the word. To see where a task stands:
|
||||
|
||||
```bash
|
||||
cd harbor-tasks/<slug>/detectors
|
||||
for f in detector-*.md; do
|
||||
printf "%-42s %-20s %s\n" "$(basename $f .md)" \
|
||||
"$(grep -m1 '^verdict:' $f | sed 's/verdict: *//')" \
|
||||
"$(grep -m1 '^confidence:' $f | sed 's/confidence: *//')"
|
||||
done
|
||||
```
|
||||
|
||||
## Verify before relaying
|
||||
|
||||
Detectors miscount, cite mechanisms they have not checked, and reason from wrong
|
||||
assumptions about the grading machinery. Check the factual basis of any finding you act on:
|
||||
open the cited file, run the cited command. When a claim is wrong, say so and keep whatever
|
||||
part of the finding survives.
|
||||
|
||||
## Leave the decisions to the author
|
||||
|
||||
**Every finding goes to the author, including the ones you think are wrong.** Skipping is
|
||||
their call, and so is skipping a whole class of them. State your read plainly, recommend,
|
||||
then wait. A recommendation you make is not a decision they made, and a ruling from an
|
||||
earlier round does not carry to a finding they have not seen. If you do decide something
|
||||
yourself, say so in the same message rather than letting it pass as theirs.
|
||||
|
||||
**A wrong proposed fix does not mean the passage is right.** Detectors reason from the
|
||||
document's structure, so a bad proposal often sits on a real defect — the edit they suggest
|
||||
narrows a scope the author widened deliberately, or scripts something the format prohibits.
|
||||
Separate the two. Ask what the detector had to infer because the text did not say it, and
|
||||
propose the edit that makes the argument stop applying. That is frequently the opposite of
|
||||
what was asked for, and frequently a cut: a passage that has drawn the same finding under
|
||||
three wordings is telling you it should not be there at all.
|
||||
|
||||
A passing verdict can still carry a recorded finding, and confidence can drop without the
|
||||
verdict moving. Name it — and if the author only wants issues from non-clean verdicts,
|
||||
respect that.
|
||||
|
||||
Not everything you notice is a finding. A next step you think would help is your
|
||||
suggestion, not something a detector raised.
|
||||
|
||||
Flag prospective findings as such. A response shape no reference run produced is a
|
||||
different decision from one costing score today.
|
||||
Reference in New Issue
Block a user