Skip to content

AIGW 0.4.2: keep Hermes model choices and stream reader verification - #172

Merged
HengYangDS merged 10 commits into
devfrom
proposal/20261015-aigw-0.4.2
Oct 15, 2026
Merged

HengYangDS merged 10 commits into
devfrom
proposal/20261015-aigw-0.4.2

Conversation

@HengYangDS

Copy link
Copy Markdown
Owner

AIGW 0.4.2, landed locally through ETHOS at 9b48601d; local dev and main equal it.

  • Hermes selection adoption (702921e0, Change hermes-selection-adoption):
    • After a model was chosen in Hermes from AIGW's catalogue, every aigw sync failed with "managed Hermes settings changed outside AIGW". sync now proves that only the selection moved, records the one matching Route as Hermes' Client Binding, keeps Hermes' file bytes and reports adopted_selections.
    • An ambiguous match names each aigw use --for hermes command; any other managed edit is still refused; an explicit aigw use still wins.
    • validate-changelog now refuses a blank line between items of one category, and the one such gap is removed.
  • Single-pass reader verification (b7b39854, b6c555c9, Change single-pass-reader-verification):
    • Setup, sync and Route changes stream the running program and each credential reader once per command, through an injected credential.Files, with bounded memory. Installing an absent reader copies the program again and refuses bytes whose digest differs from the verified one.
    • Post-projection confirmation checks the verified file identity and receipt without hashing again.
  • Release preparation (9b48601d): VERSION and the Changelog section move to 0.4.2; GitLab history links return now that GitLab has v0.3.4/v0.3.5.

Local evidence: mise run check passed on each head (coverage 95.07%); ETHOS proofs 3373cd97… (702921e0), 465d4a9a… (9b48601d).

Generated with Claude Code

One setup, sync or use --for read the roughly 13 MB running program twice and
its credential reader twice: the App hashed the program to name the reader,
EnsureEntrypoint hashed the reader and then the program again, an installation
read the program a second time to copy it, and finalization hashed the reader
once more after projection.

The App now reads the program once through an injected credential.Files
capability and keeps the bytes that this read hashed. Program.EnsureEntrypoint
verifies an existing reader once and compares its digest with the program's,
or installs the kept bytes and reads the written reader back once.
Entrypoint.Confirm checks after projection that the reader path still names
the verified file and receipt without hashing it again. Reader verification
still streams within 256 KiB, and every command verifies content again.

An acceptance regression runs setup, sync and use --for in separate Apps with
a counting Files that serves the program from another location; before this
change each command opened both executables twice.

Change: single-pass-reader-verification, tasks 1.1 and 1.2.

Generated with Claude Code
After the operator chose DMXAPI Claude Opus 5.5 as Hermes' default model,
every `aigw sync` failed with "managed Hermes settings changed outside AIGW;
preserve the edit before synchronization" and suggested only `aigw check`.
Hermes' model picker rewrites the selected model inside AIGW's owned settings,
and synchronization treated that as an external edit.

`aigw sync` now proves that only the selection moved, maps the native provider
and model to the one Route with that Account, protocol and upstream model, and
records it as the Hermes Client Binding. Hermes keeps the operator's choice and
its file bytes; only the ownership record is rewritten. The result reports
`adopted_selections`. An ambiguous match names each `aigw use --for hermes`
command, any other managed edit is still refused, and an explicit `aigw use`
still wins over the native choice.

validate-changelog now refuses a blank line between change items of one
category. Prettier accepts such a gap as a loose list, so one stayed in
CHANGELOG.md since 2026-10-13; it is removed.

Change: hermes-selection-adoption, tasks 1.1 to 1.3.

Generated with Claude Code
…bytes

b7b3985 kept the running program, about 11 MiB, in memory so that a reader
could be installed from the bytes that verification read. Every command that
names the reader, including status and doctor, then held the whole program:
from the 0.4.0 hosted samples, peak memory of setup, sync, use and status would
grow from about 17 MiB to about 28 MiB, past the release policy's review
threshold of 20% and 4 MiB.

ReadProgram now streams the program and keeps only its path and digest.
Installing an absent reader reads the program once more to copy it and refuses
the copy unless it hashes to the verified digest, leaving no reader state. A
command with an existing reader still reads the program and the reader once
each; the counting regression now expects two program reads only when the
command installs.

Change: single-pass-reader-verification, task 1.3.

Generated with Claude Code
0.4.2 ships two fixes on top of 0.4.1: `aigw sync` keeps a model chosen in
Hermes from AIGW's catalogue instead of refusing it as an external edit
(Change hermes-selection-adoption), and setup, sync and Route changes read the
running program and each credential reader once with bounded memory (Change
single-pass-reader-verification).

VERSION and the dated Changelog section move to 0.4.2. GitLab received the
v0.3.4 and v0.3.5 tag objects on 2026-10-15, so the 0.4.1 and 0.4.2 sections
link their GitLab history again and Unreleased compares from v0.4.2 on both
peers. Task 2.1 names the 0.4.2 release artifacts as its measured candidate.

Generated with Claude Code
GitHub run 38721860987 failed Native Windows acceptance for PR 172 at
9b48601 only on aggregate coverage: 94.97% (15469/16289), at the strict 95%
floor. No test failed. Hermes verification is refused on Windows, so the new
selection-adoption branches were reached only through Unix acceptance paths.

Focused tests now reach them on every platform: ObserveSelection for
unchanged, absent, chosen, out-of-catalogue, invalid-current and invalid-record
inputs; PrepareAdoptedSelection keeping Hermes' bytes and refusing a selection
other than the observed one; AdoptHermesSelection leaving disabled, unselected
and multi-home bindings unchanged; and two validate-changelog structure
refusals.

PrepareAdoptedSelection now checks the native selection on the same snapshot
that the projection plan uses, instead of reading the file twice.

Change: hermes-selection-adoption, task 1.2.

Generated with Claude Code
A reviewer pointed out that Entrypoint.Confirm compared only file identity,
size, timestamp and receipt after projection, so a same-size in-place rewrite
of the reader with a restored timestamp passed, although content verification
refused it before single-pass verification.

Confirm now streams the reader once more, with bounded memory, and refuses
bytes whose digest differs from the verified one. A command therefore reads
the program once and the reader twice; the counting regression and the spec
delta say so, and a regression rewrites the reader in place with its original
timestamp.

Change: single-pass-reader-verification, task 1.4.

Generated with Claude Code
…sumed readers

Two source-derived findings from review, each reproduced by a failing test
first:

- A Hermes model choice adopted while its Account Token was missing left the
  ownership record at the earlier selection, because the missing Token defers
  Hermes. Once the Token returned, every `aigw sync` refused with "managed
  Hermes settings changed outside AIGW". The selection-only proof now searches
  the recorded owned providers and models for the selection that reproduces
  the recorded digest instead of assuming the current binding, so the restored
  sync converges and keeps Hermes' own bytes. Adoption is reported only when the
  Route actually changes.
- When a client adapter's write failed and its own compensation failed too,
  synchronization saw an ordinary failure and removed the newly installed
  credential reader, although that client's surviving configuration could
  still reference it. transaction.CompensationFailed marks such errors; the
  client registry reports them as ErrProjectionRollbackFailed, which keeps the
  reader. The Hermes, Claude Desktop, Claude Code and Codex adapters use it.

Change: hermes-selection-adoption, tasks 1.4 and 1.5.

Generated with Claude Code
…s.Is

The errorlint gate rejects a direct error comparison. The test now asserts
that complete compensation keeps the cause and carries no incomplete marker.

Change: hermes-selection-adoption, task 1.5.

Generated with Claude Code
@HengYangDS
HengYangDS merged commit 3a2fffd into dev Oct 15, 2026
7 checks passed
@HengYangDS
HengYangDS deleted the proposal/20261015-aigw-0.4.2 branch October 15, 2026 15:10
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