Skip to content

okl 0.20.0

Latest

Choose a tag to compare

@emeraldleaf emeraldleaf released this 20 Nov 05:00
5f4b4e4
  • A session started in a git worktree gets okl's hooks, okl init there refuses to start a second
    store, and okl drift works from any folder.
    Three gaps left after okl learned to work in a
    worktree (#492). The hooks looked for .okl/config.json by 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 init in 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 drift run from a subfolder read git from there, so
    no governed path matched and the gate said nothing was checked; with no --repo-dir it reads from the
    top of the repository, and a --snapshot path 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. The ci-security pack's
    expression-injection lesson no longer calls every with: 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 steps okl check --change prints 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), from okl 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_privilege for seed:ci-security:gha_least_privilege) resolves to the
    one lesson it ends. LESSON_REVIEW_DEADLINE bounds the whole run, so the report is written before
    a CI step's timeout, and the model's environment holds none of okl's own OKL_* settings. It
    blocks nothing unless LESSON_REVIEW_BLOCKING is 1 (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 scaffold ships it, and the kit's workflow runs it when REVIEW_CMD is set and the
    LESSON_REVIEW repository variable is on, 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.sh and 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 until okl init --force, and okl init
    now says so. okl init installs the steps as
    the okl-review skill (.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 runs okl check --change and 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.json at 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 and okl verify writes 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 ran okl reverify in 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 under not_checked now 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_target or workflow_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-quality and ci-security (16 lessons). test-quality holds
    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's test-anti-patterns skill. ci-security holds the GitHub
    Actions paths an outsider can trigger (pull_request_target running fork code, ${{ }} with PR
    text inside run:, comment commands with no author check, permissions, pinning) and AI agent
    steps that read PR text or CI logs, from Sentry's gha-security-review and Trail of Bits'
    agentic-actions-auditor skills. Each lesson restates its source in its own words and cites it;
    seed/THIRD_PARTY_NOTICES.md lists the sources and licenses. Both packs are tagged method or
    security, which every repo's interests include, so okl init imports them into a new store;
    in a store that already holds lessons, okl seed test-quality ci-security adds 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
    past REVIEW_MAX_LINES in parts split at file boundaries, merged into one verdict, naming any
    part past REVIEW_MAX_PARTS as 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.