Skip to content

feat: ashigaru CLI and Desk hooks; sdlc runs .sdlc/bin/sdlc (a244) - #74

Merged
fatherlinux merged 2 commits into
mainfrom
feat/ashigaru-cutover
Nov 18, 2026
Merged

fatherlinux merged 2 commits into
mainfrom
feat/ashigaru-cutover

Conversation

@fatherlinux

Copy link
Copy Markdown
Member

Prepares the developer seat image for the Ashigaru cutover.

The container build stays red until ashigaru v3.0.0 is released with its RPMs attached. The image installs ashigaru-${ASHIGARU_VERSION}-1.fc43.noarch.rpm from the GitHub release, with ASHIGARU_VERSION=3.0.0. That release is cut after a236 merges, and v3.0.0 returns 404 today. I chose this over a temporary install from a commit SHA because a pip-from-git path would put a different artifact into the cutover image, and we would have to swap it out a day later. Once the release exists, re-run the Container workflow and nothing else needs to change. sdlc ci and Gourmand do not depend on the release.

  • ashigaru CLI: installed from the 3.x release RPM. The fc43 build is noarch against Python 3.14, which is also this base's Python. To bump it, change the one ARG ASHIGARU_VERSION line.
  • Desk hooks: managed hooks run /usr/libexec/developer/ashigaru-hook <event> alongside every seat-state hook: SessionStart → session-start, UserPromptSubmit → prompt-submit, and Stop / StopFailure / idle_prompt → stop. It reads the event and exits 0 silently until ASHIGARU_URL is set and a key is present: ASHIGARU_API_KEY_FILE must be readable, or ASHIGARU_API_KEY must be set. This matches what a242 stages. seat-state.json hooks stay in place until the cutover.
  • sdlc launcher: /usr/local/bin/sdlc now runs a converted repo's .sdlc/bin/sdlc. Before this change it exited 2 because no rev: was pinned. Repos that still pin a rev: behave as before.

The boot check now also runs ashigaru --help and runs the hook without config. Tests cover the hook's no-op and pass-through cases, the converted-repo launcher, and the new managed-settings entries. sdlc commit and sdlc push both passed locally, run through the fixed wrapper.

🤖 Generated with Claude Code

https://claude.ai/code/session_01R7Y1jg3ZJ6BsAEfhrPWFRh

…(a244)

- Install ashigaru from the 3.x release RPM, ASHIGARU_VERSION=3.0.0.
- Managed hooks call /usr/libexec/developer/ashigaru-hook beside seat-state;
  it is a silent no-op until ASHIGARU_URL and a key are staged.
- /usr/local/bin/sdlc execs a converted repo's .sdlc/bin/sdlc instead of
  exiting 2 for want of a pinned rev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R7Y1jg3ZJ6BsAEfhrPWFRh

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gatehouse found 1 issues (1 high)

Full review.

exit 0
}

[ -n "${ASHIGARU_URL:-}" ] || skip

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HIGH (Constitution): This adds an Ashigaru API key as another credential available to the agent. The constitution says the agent needs one credential—the gateway bearer token—and identifies the OpenRouter key as a second credential that is being removed. Accepting ASHIGARU_API_KEY or ASHIGARU_API_KEY_FILE introduces a further credential outside that stated model.

Suggestion: Keep Desk authentication within the gateway credential model, or amend the constitution to explicitly authorize and define the handling, scope, and revocation of this additional credential.

Evidence:

if [ -n "${ASHIGARU_API_KEY_FILE:-}" ]; then
  [ -r "$ASHIGARU_API_KEY_FILE" ] || skip
elif [ -z "${ASHIGARU_API_KEY:-}" ]; then
  skip
fi

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deferred: #75

The per-seat Desk key belongs to the cutover design (a242 stages it), and it is not this image's call. Issue #75 asks for one of two things: amend Layer 5 to name the key, or put the Desk behind a gateway route that uses the seat's own token. Until a key is staged, the hook does nothing.

@fatherlinux

Copy link
Copy Markdown
Member Author

Second-seat review (a249): changes requested. One finding, everything else checks out.

Containerfile:124-125: the ashigaru RPM is installed unsigned and with no digest. Every other package in this image comes from a gpgcheck=1 repo (lines 84-91), and the base image is pinned by digest (line 58). This package comes from a bare URL, and ashigaru's rpm.yml does not sign its RPMs. Its publish job also runs gh release upload ... --clobber (rpm.yml:103), so any later workflow_dispatch for v3.0.0 replaces the file at that same URL, and the next rebuild of this image picks up the new bytes without complaint. That makes it the one unpinned input in an image that holds a Desk key. Fix: add ARG ASHIGARU_SHA256=<digest of the 3.0.0 fc43 RPM>, curl -fsSLo /tmp/ashigaru.rpm the URL, run echo "${ASHIGARU_SHA256} /tmp/ashigaru.rpm" | sha256sum -c -, then dnf -y install /tmp/ashigaru.rpm and remove the file. The build is already waiting on the 3.0.0 assets, so add the digest in the same rerun. A version bump then changes two lines instead of one.

What I verified, and found no issues with:

  • No-op without config (ashigaru-hook:25-30): no ASHIGARU_URL, or no readable key file and no env key, drains stdin and exits 0 with no output. A key file that is set but unreadable skips even when ASHIGARU_API_KEY is also set. That matches ashigaru's config.load, where the file wins. The tests cover all of these paths.
  • Can't block or slow a prompt: hooks.run arms a 2.0 s ITIMER_REAL, catches Exception and _Deadline, and always returns 0. Argparse's exit 2 can't trigger, because every event the managed settings pass (session-start, prompt-submit, stop) is in hooks.EVENTS. Measured against a blackholed Desk: 2.35 s wall time, rc 0, stdout empty. The 10 s hook timeout is a backstop on top of that.
  • Silent stdout: the wrapper writes only to stderr, and ashigaru hook writes nothing to stdout.
  • Key exposure: argv is only the event name (exec ashigaru hook "$@"). The key goes out only in the Authorization header, redirects aren't followed, and Config.api_key is repr=False. Error and warning text names the key file's path, never its contents. Nothing in rootfs/ or the Containerfile carries a key, and tests/ isn't copied into the image.
  • RPM name: ashigaru-3.0.0-1.fc43.noarch.rpm is correct. The spec has Release: 1%{?dist} and BuildArch: noarch, the fc43 job builds on fedora:43, and build.sh refuses a tag that isn't v$VERSION.
  • sdlc launcher: [ -x "$root/.sdlc/bin/sdlc" ] runs before the rev: path. The new test runs it from a subdirectory.
  • python3 -m unittest discover -s tests: 148 tests, OK.

Nit, no change needed: ASHIGARU_API_KEY as an env var is visible to every tool the session runs. The per-seat key file is the right default, and #75 owns that.

🤖 Generated with Claude Code

The release asset is unsigned and rpm.yml uploads with --clobber, so the
build downloads it, checks ASHIGARU_SHA256 with sha256sum -c --strict and
installs only the checked file. Pinned to ashigaru-3.0.0-1.fc43.noarch.rpm,
hashed here and matching both Josui Prime's hash and GitHub's asset digest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R7Y1jg3ZJ6BsAEfhrPWFRh

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gatehouse found no issues.

Reviewed 1 commit since 5be0df9 (incremental).

1 finding(s) dropped: their evidence is not in the diff.

2 of 8 agents served by google/gemini-3.5-flash-lite (primary unavailable).

@fatherlinux
fatherlinux merged commit bb74490 into main Nov 18, 2026
12 checks passed
@fatherlinux fatherlinux mentioned this pull request Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant