Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
* text=auto

# Shell scripts and git hooks must keep LF endings — CRLF breaks bash heredoc
# delimiters and exact-match line checks silently on Windows checkouts.
# Shell scripts must keep LF endings — CRLF breaks bash heredoc delimiters and
# exact-match line checks silently on Windows checkouts.
*.sh text eol=lf
*.py text eol=lf
.githooks/* text eol=lf
tests/gh-stub/gh text eol=lf
114 changes: 0 additions & 114 deletions .githooks/pre-push

This file was deleted.

9 changes: 0 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,6 @@ It uses your logged-in Claude Code subscription (no paid API key) and self-skips
cleanly when it can't run for real (no `claude` on PATH, a spend/rate limit, or
the stub can't be reached).

A lighter **semantic** review still runs locally via the pre-push hook
(`.githooks/pre-push`): when a push touches `skills/**` or `README.md`, it asks
your logged-in `claude` CLI to review the diff against the skill invariants. It
costs no API bill. Enable it once per clone with:

```bash
git config core.hooksPath .githooks
```

## Pull request conventions

These are the conventions the history already follows — match them:
Expand Down
24 changes: 20 additions & 4 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,26 @@ review console read a delivery URL out of one. Both readers now go to the record
and the claim is the ref CAS, the state is the record, and a comment decides
nothing — which is the sentence protocol/4 wrote and protocol/9 finally earns.

The requests balance out negative. `refs/kraken/state/` is paginated by the same
`matching-refs/kraken/` read that already fetched the claim refs, and against that
one enlarged read stand the whole comment-hydration pass and a paginated comment
read per `awaiting-merge` task in the console.
The requests balance out negative **on the read**, which is the side that runs
hot. `refs/kraken/state/` is paginated by the same `matching-refs/kraken/` read
that already fetched the claim refs, and against that one enlarged read stand the
whole comment-hydration pass and a paginated comment read per `awaiting-merge`
task in the console. A queue walk — the poll every watcher runs once a minute,
per worker — got cheaper, and a 200-task queue stopped shipping comment bodies
to answer a question about a handful of them.

The **write** side got more expensive, and deliberately. Every terminal
transition now reads the comment count back after its own comment lands (§3.1),
reads the previous record to carry `expiries` and `pr` forward, and writes a
commit plus a ref — on the order of five requests that protocol/8 did not make.
That is the right trade because of where each cost falls: a transition runs
**once per task**, at human pace, at the end of work that took minutes; the queue
walk runs once a minute forever, times every worker in the fleet. Paying on the
rare path to make the hot path cheaper and exact is the whole shape of this
revision. It is also why the ordering in §3.1 is a MUST rather than an
optimisation — those reads are what make `comments` an anchor nobody has to
guess, and skipping them to save a call would put the derivation back into the
business of inferring what it could have read.

This is a backward-incompatible change — a protocol/8 reader derives the requeue by
classifying a comment window and never looks at a record; a protocol/9 reader stops
Expand Down
10 changes: 6 additions & 4 deletions scripts/lint-skills.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# label drift across files, protocol-version drift, orphan "step N"
# references, task-template field drift, broken relative links/images, and
# invalid shell/YAML/JSON snippets.
# Runs as a CI gate (.github/workflows/lint.yml) and locally (e.g. a pre-push hook).
# Runs as a CI gate (.github/workflows/lint.yml) and locally via `make lint`.
set -uo pipefail

ROOT="$(cd "$(dirname "$0")/.." && pwd)"
Expand All @@ -26,10 +26,12 @@ PKG="skills/unleash/kraken"
WATCHER="$PKG/watch.py"
LISTER="$PKG/queue.py"
CLAIM="$PKG/claim.py"
RELEASE="$PKG/claim.py"
ESCALATE="$PKG/claim.py"
DELIVER="$PKG/claim.py"
HEARTBEAT="$PKG/claim.py"
# The three ways a turn ENDS live in terminal.py, not claim.py — see that
# module's docstring for why the two halves are siblings.
RELEASE="$PKG/terminal.py"
ESCALATE="$PKG/terminal.py"
DELIVER="$PKG/terminal.py"

fail=0
err() { printf ' \033[31mx\033[0m %s\n' "$1"; fail=$((fail+1)); }
Expand Down
17 changes: 10 additions & 7 deletions skills/unleash/kraken/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
queue the Task object, the batched walk, the startable filter
render report objects to text
reconcile the §6 repair pass
claim the contended claim sequence and the terminal transitions
claim taking a task and holding it: the CAS, the guard, the drain
terminal how a turn ends: escalate, deliver, release (§7-§9)
next_action the driver loop as one envelope
watch the zero-token ambush
status the read-only console
Expand Down Expand Up @@ -55,7 +56,7 @@
from .comments import (
DISCLAIMER, MARKER_PREFIX, MARKER_RE, MARKER_SUFFIX, MARKER_TYPES,
TASK_TRAILER, compose_comment, compose_note, disclaimer, make_marker,
parse_marker, task_trailer
parse_marker, read_body_file, task_trailer
)
from .transport import (
Api, DEFAULT_API_URL, GRAPHQL_ALIAS_CHUNK, HTTP_TIMEOUT_SECONDS, PER_PAGE,
Expand Down Expand Up @@ -91,11 +92,13 @@
project_reconcile, reconcile_pass, reconcile_plan, stale_claim_body
)
from .claim import (
ClaimAttempt, DELIVER, ESCALATE, RELEASE, Terminal, TerminalTransition,
acquire_next, claim_is_moot, cmd_claim, cmd_claim_next, cmd_deliver,
cmd_escalate, cmd_heartbeat, cmd_note, cmd_release, lease_expired_body,
open_claim_of, probe_lease_state, read_body_file, refuse_second_claim,
refused_line
ClaimAttempt, acquire_next, claim_is_moot, cmd_claim, cmd_claim_next,
cmd_heartbeat, cmd_note, lease_expired_body, open_claim_of,
probe_lease_state, refuse_second_claim, refused_line
)
from .terminal import (
DELIVER, ESCALATE, RELEASE, Terminal, TerminalTransition, cmd_deliver,
cmd_escalate, cmd_release
)
from .next_action import (
NEXT_ACTIONS, NEXT_ACTION_EXIT, NextAction, NextActionEnvelope,
Expand Down
Loading
Loading