Repository navigation
fix(intake): never default an unknown approval status to approved and ship a boto3 that knows the registry - #402
Merged
Conversation
… ship a boto3 that knows the registry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Two bugs in the intake post-fabrication status flow:
Dangerous default. When the live registry lookup failed (e.g.
UnknownServiceErrorbecause the container's botocore predated theagent-registry-controlservice model) AND the job row had noregistryApprovalStatussnapshot,_plain_statedefaulted to "built and approved" — the worst possible fallback, presenting an unverified agent as governance-cleared.Missing SDK service model. The container's
requirements.txtusedboto3>=1.43.56(a floor, not a pin). A cached image layer could resolve to a boto3/botocore release that predatesagent-registry-control, causing_get_registry_client()to raiseUnknownServiceErrorat runtime and forcing every status check into the snapshot fallback path — which hit bug 1.Fabricator snapshot gap.
_write_fabrication_statusin the fabricator only wroteregistryApprovalStatuswhenrun_state.pending_approvalwas non-empty. Auto-approved jobs got no snapshot at all, so even a working snapshot fallback in postfab had nothing to read.Changes
service/agent_intake_single(container stack)tools/postfab.py: Changed_plain_statefallback from "built and approved" to "built; approval status could not be confirmed" when the snapshot field is absent or unrecognised. Upgraded_resolve_registry_statuslogging fromlogger.warningtologger.errorwith a structured metric-friendly message so CloudWatch metric filters can alert on registry-client unavailability.requirements.txt: Pinnedboto3==1.43.116(matching the fabricator pin) to guaranteeagent-registry-controlis present in the container image. botocore 1.43.116 includes the service model; the old>=1.43.56floor could resolve to a release without it.tests/test_botocore_registry_service.py: New container-level smoke test that asserts'agent-registry-control' in botocore.session.get_session().get_available_services(). Fails in any env with an old botocore — must be run with the pinned deps.tests/test_postfab_approval_status.py,tests/test_postfab_live_registry.py: Updated three test assertions from "built and approved" to "built; approval status could not be confirmed" to match the new safe default.arbiter/fabricator(arbiter stack)index.py:_write_fabrication_statusnow writesregistryApprovalStatus='approved'on every COMPLETED job (whenrun_state.pending_approvalis empty), instead of omitting the field. This ensures the snapshot fallback path in postfab always has a value to read.Testing
agent-registry-control:Trueboto3>=1.43.56resolves to botocore 1.43.118 on a fresh pip install (alsoTrue), but this is not guaranteed for cached Docker layers — the pin eliminates that variable.