Repository navigation
Report every NAT run's lifecycle from its start - #485
bar-capsule wants to merge 1 commit into
Conversation
An acs_lifecycle exporter subscribes to each run's step stream before WORKFLOW_START, so every run reports its sessionStart and userMessage. Signed-off-by: Bar Kaduri <bar@capsule.security>
drk-ram
left a comment
There was a problem hiding this comment.
Reviewed commit b595f2cd08afe128ae3321597c9c4c7b95429c3d against its stated stacked base.
No additional blocking finding in this slice relative to #484.
acs/integrations/nat/adapter.py:923-967 registers the exporter while building the middleware, so NAT subscribes before the first workflow event rather than waiting for the first protected call. The fallback keys subscriptions by each run's stream, and the tests cover consecutive runs, overlapping fallback streams, disabled operation, and an orphan exporter configuration. Correcting the README's tool-call backstop claim is important: lifecycle observation is not coverage for unwired functions.
The focused command below passed on Windows/Python 3.11. The broader NAT selection had 52 passed, 3 failed, and 9 setup errors: the two inherited emission-fixture races raised on #484, plus the POSIX pipe-based Guardian launcher. This approval does not clear the lower slice's requested changes.
Local validation (from adapters, Python 3.11):
python -m pytest tests/integrations/nat/test_runner_lifecycle.py -q --tb=short
Result: 5 passed, 3 subtests passed in 7.62s
|
Closing this slice because PR #22 (the reference adapters for Claude Code, Cursor and NAT) merged into integration as 2630ec2, and that merge carries every slice in this stack. The top of the stack had the same files as PR #22's final commit, so nothing in this slice was left behind. Thanks, Bar, for cutting the adapters into pieces this size, because it made the review possible. |
Stacked on #484. Next: #486. The full stack is listed in #22.
What changed
WORKFLOW_STARTbefore any call, so subscribing on the first call missed every run's start, and a later run's lifecycle entirely.build_acs_middlewarenow registers anacs_lifecycletelemetry exporter through the builder NAT passes it; NAT starts it for every run, subscribed beforeWORKFLOW_START.Findings this answers. Raised while reviewing this stack, from NAT's
Runner: the first run missed its start events, and a second run missed all lifecycle events.Which issue does this implement
Part of #134
Base branch
Stacked on #484, not on
integration. It lands through #22; see the stack in #22.Type of change
I tested this
At this slice's top (
b595f2cd), withclauderemoved from PATH andACS_LIVE_CLAUDEandACS_SPEC_DIRunset: 456 passed and 3 expected skips with the NAT extra, 392 passed and 3 expected skips without it. The skips are the two opt-in live Claude Code tests and the manual Cursor procedure. CI passes on this PR, including the installed-wheel check on Python 3.11 and 3.12.Checklist
git commit -s(required by the DCO)Security
Every NAT run reports its lifecycle from its start.