Repository navigation
-
A session started in a git worktree gets okl's hooks,
okl initthere refuses to start a second
store, andokl driftworks from any folder. Three gaps left after okl learned to work in a
worktree (#492). The hooks looked for.okl/config.jsonby walking up, which a worktree beside the
checkout never has, since git ignores.okl/: every hook stepped aside as if the repo had never been
set up. Each hook, the MCP launcher and git's pre-push hook now take the main checkout's config, and
the okl it pins, as okl itself does.okl initin a worktree of a set-up checkout wrote a config of
the worktree's own beside a new, empty store, which every later command then read instead; it now
exits 2 and names the checkout to run it in.okl driftrun from a subfolder read git from there, so
no governed path matched and the gate said nothing was checked; with no--repo-dirit reads from the
top of the repository, and a--snapshotpath is named from where it runs. A main checkout okl
cannot read names no store, where every command in its worktrees died on a traceback. -
Fixes from the review sweep before 0.20.0. The architecture review split a diff holding bytes
that are not UTF-8 with a traceback, wrote no part and ran on nothing; the bytes are now replaced,
and a diff that yields no part is said to have no verdict. The Stop hook's note for another
worktree names a review against the base its files were counted from. Theci-securitypack's
expression-injection lesson no longer calls everywith:input safe: one an action runs as code
(script:in actions/github-script) is injectable too. In okl's CI, a lesson review whose seed
packs did not load replaces the last comment instead of leaving it. -
The review after writing runs on a pull request, with any model's CLI (
ci/lesson-review.sh).
Until now it ran only when an agent's Stop hook asked for it, so a change made by hand, by another
agent, or in a session whose hook never fired went unchecked. The script follows the stepsokl check --changeprints with the calls a script can make: one call says what the change does and
picks the ten lessons it is likeliest to break (LESSON_REVIEW_PICK), fromokl check --change --format json; then one fresh call per lesson, from an empty folder, gets the lesson's full text,
the change and the path question. It writes one report, to the job summary, as annotations, and
for okl's CI as one pull-request comment that each run replaces, posted by a job that runs no model
and none of the change's code. Every run writes a report, so a comment from an earlier push never
stands for this one: a pick that names no lesson, and a check that fails or gives no verdict, are
said in it and as annotations, with the call's exit status and last error line. A picked id the
model shortened (gha_least_privilegeforseed:ci-security:gha_least_privilege) resolves to the
one lesson it ends.LESSON_REVIEW_DEADLINEbounds the whole run, so the report is written before
a CI step's timeout, and the model's environment holds none of okl's ownOKL_*settings. It
blocks nothing unlessLESSON_REVIEW_BLOCKINGis1(then a broken lesson exits 1 and a run that
checked none exits 2), since its false-alarm rate in CI is not measured. It is off by
default:okl scaffoldships it, and the kit's workflow runs it whenREVIEW_CMDis set and the
LESSON_REVIEWrepository variable ison, eleven calls a run. On a runner it reads okl's bundled
packs (or a shared store,OKL_SERVICE_URL), since a repo's recorded lessons stay in its gitignored
.okl/(#186); run on your machine, it reads your whole store.ci/review-agent.shand the new
script are now in the mirror test with their scaffold copies. -
The review after writing is a skill, and the Stop hook sees work done in other worktrees. On
okl's own repo a week of pull requests made in git worktrees logged one review after writing: the
agent entered each worktree command by command, its session's own checkout stayed untouched, and the
Stop hook, which looked only there, asked neither for the review nor what was learned. It now also
asks when another worktree of the repo had a commit in the last hour, and okl's note names each such
worktree, or one with an uncommitted file edited in that hour, with the command that reviews it there
(cd -- <worktree> && okl check --change, the path quoted for a shell). A project whose Stop hook is an
edited copy keeps it, so it does not see other worktrees untilokl init --force, andokl init
now says so.okl initinstalls the steps as
theokl-reviewskill (.claude/skills/okl-review/SKILL.md, removed by--uninstall, kept once
edited), the note names it, and okl's Claude Code plugin ships it. The skill runsokl check --changeand follows the steps it prints, so the measured steps stay as they were. okl's file
fingerprint now sits inside a skill's front matter, as a YAML comment, where a line before it would
stop Claude Code reading the front matter. -
okl works in a git worktree beside the checkout. git ignores
.okl/, so such a worktree had
none, and okl refused there as not configured: the command the Stop hook now names for work done
in a worktree could not run. With no.okl/config.jsonat or above it, okl run in a linked
worktree uses its main checkout's config, and so its store. It reads git's own files to find it,
without running git; a worktree with a config of its own keeps it, and a submodule is not taken
for a worktree. The repository okl works on stays the worktree: checks run there, governed paths
are read from it andokl verifywrites its okl-drift.json. That was already wrong for a worktree
nested inside the checkout, where Claude Code puts its own: okl found the checkout's config by
walking up, and ranokl reverifyin the checkout, stamping the checkout's commit. -
The architecture review keeps a failed call's exit status and error output (review of #490). A
reviewer call that failed said why only on its stderr, which was discarded, so its part had no
review and no cause. The part's line undernot_checkednow gives the exit status and the last
error line, and when no part has a review, the end of each failed call's error output goes to the
log. okl's own review job no longer lists the Python versions it tests in its summary by hand. -
No workflow okl runs or installs may trigger on
pull_request_targetorworkflow_run. Both run
with the base repository's secrets on a pull request from anyone; the review jobs rely on
pull_request, which gives a fork's pull request none. A test now fails on either trigger. -
Two packs for every repo:
test-qualityandci-security(16 lessons).test-qualityholds
the test anti-patterns that let a test pass whatever the code does (no assertion, an unawaited
async assertion, an expected value computed by the code under test, an assertion only inside an
exception handler, a transformation test whose input needs no change, timing and order
dependence), from the .NET team'stest-anti-patternsskill.ci-securityholds the GitHub
Actions paths an outsider can trigger (pull_request_targetrunning fork code,${{ }}with PR
text insiderun:, comment commands with no author check, permissions, pinning) and AI agent
steps that read PR text or CI logs, from Sentry'sgha-security-reviewand Trail of Bits'
agentic-actions-auditorskills. Each lesson restates its source in its own words and cites it;
seed/THIRD_PARTY_NOTICES.mdlists the sources and licenses. Both packs are taggedmethodor
security, which every repo's interests include, sookl initimports them into a new store;
in a store that already holds lessons,okl seed test-quality ci-securityadds them. -
The architecture review reads the change's CI results and reviews the whole diff (#490). It
reported nothing to fix on four PRs where the same reviewer, run locally, found must-fixes. It now
takes the output of the jobs that ran without secrets (REVIEW_CI_RESULTS_FILE); reviews a diff
pastREVIEW_MAX_LINESin parts split at file boundaries, merged into one verdict, naming any
part pastREVIEW_MAX_PARTSas not reviewed, instead of cutting it at 4,000 lines; leaves
lockfiles and other data (REVIEW_EXCLUDE) out of the diff while listing them; and counts as
must-fix a CI failure the change caused, a demonstrable defect, a test that would pass on broken
code and a published claim its evidence does not support.