Repository navigation
fix(run): read adapter health on exit 1 and adapter info by release - #28
Conversation
| release = adapter.get("release") | ||
| if not isinstance(release, str) or not release: | ||
| release = f"{selected_source}@{selected_version}" | ||
| local = _unwrap_local_adapter(local_loader(release)) |
There was a problem hiding this comment.
The fallback can verify a different adapter release. At publication_gate.py:219–222, selected_version comes from registry adapter info, which returns the latest version. It need not match the release selected by play inspect.
Reproduced with inspection selecting receipt-verified github@1.1.0, while registry latest is 1.2.0 with a different fingerprint. With both installed and unchanged credential names, the fallback loads 1.2.0 and returns ok: true, recording its fingerprint and version as verified. The inspected release was never checked.
Resolve the fallback from the inspected release’s identity, or fail explicitly when that identity cannot be established. Add a regression test where the inspected and latest versions differ.
There was a problem hiding this comment.
Real. With both releases installed, the fallback loaded the registry's current release and never checked the inspected one. Fixed in 00976f0: the fallback is gone. The gate now requires release from play inspect and fails when it is absent. It also fails when the inspected release is not <selected_candidate>@<registry current version>, before it reads any local adapter. rote registry adapter info takes no version, so the gate cannot verify an older inspected release against the registry. Regression tests cover the missing field and inspected 1.1.0 against registry 1.2.0 with both installed.
Two of Play's rote calls fail on current rote, so publishing an adapter-backed Play stops, and a run with a missing credential errors out instead of asking for it.
Closes modiqo/rote#3311
Closes modiqo/rote#3312
Before
validate_credential_contractsrunsrote adapter info <adapter_id> --jsonwith the bare name fromplay inspect. Rote 0.89.0 removed bare names, so the call returnsadapter_invalid_idand the publish stops._credential_snapshotrunsrote adapter list <id> --json --health. Rote prints the report and exits 1 when the adapter is unhealthy.run_textraises on any non-zero exit, so a missing token ends in "Play could not verify the static credential contract" instead of the authentication-required result. Theauth.ensurepoll stops on its first probe for the same reason.The unit tests stubbed both rote calls with loaders that ignore their argument and exit 0, so neither failure showed.
After
Run the same publish and the same run with a missing token.
play inspectchecked. It takesconvergence.adapters[].release, which modiqo/rote#3310 adds.rote registry adapter inforeports only the current release, so the inspected release must equal<selected_candidate>@<current version>. If it does not, or if rote does not reportrelease, the gate stops and names the reason. It does not guess a release.run_textandrun_jsontakeaccepted_exit_codes. The credential check accepts exit 1 from--healthand readshealthy: false, so Play returns its authentication-required result. An accepted exit still fails when rote prints an error envelope.The green nodes are what changes.
Validation
Against a dev rote binary in a sandbox
ROTE_HOMEwith one static-token adapter:_credential_snapshotwith no token set returnsusable: False,state: static_missing. Before, it raised. Afterrote token set, it returnsusable: True._default_local_loader("@development/contract-api")returns the adapter. The bare name still returnsadapter_invalid_id.Need help on this PR? Tag
@codesmith-botwith what you need.