Adopt core 0.5.0: declared verb scope; scoped deferred captures close D-CAM-29 - #13
Merged
Conversation
… D-CAM-29 Pin edgecommons at rust-lib/v0.5.0 (a14a3285) and regenerate the committed git-sourced Cargo.lock. Every verb registers through the breaking two-form surface register/register_outcome with a declared CommandScope (SOUTHBOUND 2.2 / D-SC-2), derived from its closed request schema: - Component: sb/list, sb/discover, sb/capture-group, sb/capture-group-submit, sb/capture-cancel. The library refuses any instance addressing, replacing the adapter's hand-rolled refusal. - Instance: sb/capture, sb/capture-submit, sb/reconnect, sb/ptz, sb/ptz-presets, sb/pause, sb/resume. - Both: sb/status, sb/capture-status, sb/queue-status, sb/queue-clear - no addressing means the whole component. The deferred verbs are scoped too, closing the D-CAM-29 recorded gap: sb/capture (Instance) and sb/capture-group (Component) register through the scoped outcome form, so the topic token routes a deferred capture while deferred settlement, permit release, and sb/capture-cancel settling the held reply are unchanged. The scoped_request enforcement layer is deleted - addressing (conflict-first BAD_ARGS, Component-scope rejection) is library-owned ahead of dispatch (D-SC-4). addressed_request keeps only the seeding into the body selector that the optional-iff-one configured default and the NO_SUCH_INSTANCE existence check read. Keepalive instance state (D-SC-7): the state keepalive's instances[] state comes from the single state model that answers sb/status - a camera paused with sb/pause reports PAUSED while connected keeps reporting reachability. The exact wire element is pinned via the now-public InstanceConnectivity::to_json. Tests: scope-declaration and seeding units, an addressed deferred-capture routing test, a PAUSED keepalive wire pin, named dispatch-pipeline coverage, and a live-inbox integration over a MessagingService loopback that asserts the byte-pinned library refusals through the adapter's real registrations. The k8s deployment-config contract test now normalizes CRLF so it also runs on Windows autocrlf checkouts. Docs: messaging-interface scope table and addressing rules, metrics keepalive state vocabulary incl. PAUSED, DESIGN D-CAM-29 closed by new D-CAM-30, AGENTS invariants.
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.
Adopts the core 0.5.0 breaking command surface (rust-lib/v0.5.0,
a14a3285) and closes the D-CAM-29 recorded gap.What changed
edgecommonspinned at rust-lib/v0.5.0;Cargo.lockregenerated with the local[patch]inactive, so it stays git-sourced and reproducible for CI (D-CAM-27 convention).register(verb, scope, handler)/register_outcome(verb, scope, handler)with aCommandScopederived from its closed request schema:Component:sb/list,sb/discover,sb/capture-group,sb/capture-group-submit,sb/capture-cancel— the library now refuses any instance addressing; the hand-rolled refusal is deleted.Instance:sb/capture,sb/capture-submit,sb/reconnect,sb/ptz,sb/ptz-presets,sb/pause,sb/resume.Both:sb/status,sb/capture-status,sb/queue-status,sb/queue-clear— no addressing means the whole component.sb/capture(Instance) andsb/capture-group(Component) move onto the scoped outcome registration: the topic token now routes a deferred capture, with deferred settlement, permit release, andsb/capture-cancelsettling the held reply unchanged.scoped_request(adapter-side conflict/scope enforcement) is gone — the library owns addressing pre-dispatch (conflict-firstBAD_ARGS,Componentrejection). The remainingaddressed_requestonly seeds the library-resolved token into the body selector; the optional-iff-one default andNO_SUCH_INSTANCEexistence check stay adapter-side per D-SC-4.instances[]statecomes from the single state model that answerssb/status: a camera paused withsb/pausereportsPAUSEDwhileconnectedkeeps reporting reachability; the exact wire element is pinned via the now-publicInstanceConnectivity::to_json.messaging-interface.mdscope table + addressing rules;metrics.mdkeepalive vocabulary incl.PAUSED;DESIGN.mdD-CAM-29 marked closed with new decision D-CAM-30 (and §12.1/§27 narrative);AGENTS.mdinvariants.Tests
New coverage: scope-declaration and body-seeding units; an addressed deferred
sb/capturerouting test (topic token selects the camera with two configured); aPAUSEDkeepalive wire pin viato_json; named dispatch-pipeline tests; and a live-inbox integration over an in-processMessagingServiceloopback that drives the REALCommandInbox(now-publicCommandInbox::new) across the adapter's actual registrations, asserting the byte-pinned library refusals ("instance in body conflicts with the addressed instance", "verb 'sb/list' is component-scoped"[ + " - the body must not name an instance"]).Also: the k8s deployment-config contract test normalizes CRLF so it runs on Windows autocrlf checkouts (it failed at baseline on such checkouts, before this change).
Validation
cargo test— 643 passed, 0 failed, 1 ignored (lib 639 + integration suites).cargo clippy --all-targets -- -D warningsclean.Behavior changes on the wire
sb/capturenow routes by the topic token (previously the token was ignored); a conflicting bodyinstanceis refused.sb/capture-groupis now refusedBAD_ARGS(previously silently accepted with the token ignored).BAD_ARGS).state: "PAUSED".