Adopt the CLI-scaffold-parity component baseline (#8) - #9
Merged
Conversation
Bring camera-adapter to the CLI-scaffold-parity southbound contract:
- Error codes (C-2): hard-rename the routing/availability codes to the
standardized family — INVALID_REQUEST/INSTANCE_REQUIRED -> BAD_ARGS,
UNKNOWN_INSTANCE -> NO_SUCH_INSTANCE, CAMERA_UNAVAILABLE -> DEVICE_UNAVAILABLE.
Domain codes (CAPTURE_*, PTZ_*, STORAGE_PRESSURE, ...) are unchanged. No
aliases. Wire-visible breaking change (D-CAM-23).
- sb/pause / sb/resume (C-1): suspend a camera's new capture work (scheduled and
commanded); in-flight captures run to completion; new work is refused with the
stable INSTANCE_PAUSED code; idempotent {paused, changed}; surfaced in
sb/status. repoll recorded N/A (capture-on-demand adapter). (D-CAM-24)
- Operational metric families (C-3): camera_captures becomes (Total, Interval)
counter pairs drained on the sampler tick; new CameraCommand family
(instance x verb x result); camera_captures/camera_queue stay fleet-scoped by
the recorded cardinality decision. (D-CAM-25)
- Edge-console panel trio (C-4): overview/signals/diagnostics via register_panel,
order 10/20/30, scope instance, bound to the verbs actually served. (D-CAM-26)
Docs (messaging-interface, metrics, DESIGN register) updated in the same change.
Coverage stays above the 90 line gate; new logic is unit- and integration-tested.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxV5wFi7LCratBERVT6aiL
WS-2/WS-3: add AGENTS.md (component shape, backend seam, config location, validation expectations, inherited org conventions) and CLAUDE.md (short header + @AGENTS.md import + local-dev notes), and .github/workflows/deploy-docs.yml so a doc-only push refreshes the aggregated EdgeCommons docs site for this registered component. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DxV5wFi7LCratBERVT6aiL
WS-7: the Cargo.toml `license` field and the README license line declared Apache-2.0 while the LICENSE file is Business Source License 1.1. Align both to BUSL-1.1. Fixes #7 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DxV5wFi7LCratBERVT6aiL
WS-5 (org lockfile policy, SD-B): drop the /Cargo.lock gitignore rule and its three-way-constraint rationale, and commit Cargo.lock regenerated with the local .cargo [patch] override inactive so it records the pinned git source and is valid on a fresh clone / in CI (proved: `cargo check --locked` with the patch inactive resolves the pin). The Dockerfile now copies the lock and builds `--locked`; the image dockerignore admits it; the MSRV check runs `--locked`; and the RTSP native-coverage harness keeps its writable-overlay lock (the read-only source mount plus the local patch mean cargo must not rewrite the committed lock). Resolution recorded in DESIGN.md (D-CAM-27). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DxV5wFi7LCratBERVT6aiL
Add a failing-target test so both operational drains (camera_captures and CameraCommand) exercise their emit-error branches — a briefly-unavailable metric backend must never take a timer-driven drain down with it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DxV5wFi7LCratBERVT6aiL
WS-1: author a Draft 2020-12 config.schema.json so `edgecommons component validate` can check camera-adapter configs and stops warning on the missing schema. The root models `component.global` (the CLI validates `/component/global` against it) with `$defs/camera` for one `component.instances[]` entry and `$defs` for every backend/profile/schedule/enum — derived field-for-field from `src/config.rs`, strict where the parser is (`deny_unknown_fields`) and permissive only where it is (`featureOverrides`, `resourceGroups`). Validated with a Draft 2020-12 validator (shipped simulator-config.json and the DESIGN §10.1 full example ACCEPT; a malformed global key, an ONVIF backend missing `mediaProfile`, a bad enum, an unknown backend field, and a camera missing `backend` REJECT) and with `edgecommons component validate` — no findings. Recorded in DESIGN.md (D-CAM-28). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DxV5wFi7LCratBERVT6aiL
…rce) The baseline-adoption worktree is nested inside the main camera-adapter checkout, whose gitignored .cargo/config.toml [patch] override is discovered by Cargo's ancestor walk — so the initial generate-lockfile resolved edgecommons as a LOCAL PATH source, producing a Cargo.lock that would not resolve on a fresh clone or in CI (the "fresh-clone proof" false-passed only because the sibling path still existed). Regenerated in an isolated clone outside the ancestry; the sole change is the git source line on the edgecommons entry (validated with `cargo metadata --locked`). All other pins unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DxV5wFi7LCratBERVT6aiL
Review M3: DESIGN.md §12/§13 normative sections still documented the OLD error codes as the live set, contradicting the hard rename in the code and messaging-interface.md. Rewrite them to the standardized codes: - §13.13 error catalog: INSTANCE_REQUIRED/INVALID_REQUEST collapse to BAD_ARGS, UNKNOWN_INSTANCE -> NO_SUCH_INSTANCE, CAMERA_UNAVAILABLE -> DEVICE_UNAVAILABLE, and add INSTANCE_PAUSED. Domain codes (CAPTURE_*, PTZ_*, ...) unchanged. - §12 error example and §13.1 instance-selection / group-validation spec lines renamed to match. - Also add the missing sb/pause / sb/resume rows to the §13 verb table (stale vs the shipped 16-verb surface). The D-CAM-23 decision-register entry keeps the old->new mapping intact as the migration record. Docs-only; no code or coverage impact. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DxV5wFi7LCratBERVT6aiL
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.
Brings camera-adapter to the CLI-scaffold-parity component baseline (PR edgecommons/edgecommons#57, design
core/docs/platform/DESIGN-cli-scaffold-parity.md; contractcore/docs/SOUTHBOUND.md§2.2/§5). camera-adapter is a camera, not a signal adapter —sb/read/sb/write/sb/signals/sb/browseare N/A; the focus is the lifecycle verbs, the metric-family pattern, panels, and hygiene.Per-item checklist
P1 — adapter parity (SOUTHBOUND §2.2 / §5)
sb/pause/sb/resume— suspend a camera's new capture work (scheduled + commanded); in-flight captures run to completion; new work refused with the stableINSTANCE_PAUSEDcode; idempotent{ paused, changed }; instance-routed; surfaced insb/status. Pause is process-local (a restart begins unpaused) and scoped to capture workload (sb/reconnect/PTZ/read-only verbs unaffected). (D-CAM-24)repollapplicability — recorded N/A: this adapter is capture-on-demand and schedule-driven, not poll-based;sb/capture/sb/capture-submitare the on-demand trigger. Recorded inDESIGN.md(D-CAM-24) anddocs/reference/messaging-interface.md.INVALID_REQUEST/INSTANCE_REQUIRED→BAD_ARGS,UNKNOWN_INSTANCE→NO_SUCH_INSTANCE,CAMERA_UNAVAILABLE→DEVICE_UNAVAILABLE. Domain codes (CAPTURE_*,PTZ_*,STORAGE_PRESSURE, …) kept. (D-CAM-23) — see Breaking change below.camera_capturesconverted to(Total, Interval)counter pairs (accumulate → drain on the sampler tick; the interval preserves the every-event guarantee); newCameraCommandfamily (instance×verb×result, request/error pairs + latency, cells defined lazily). Existing measure semantics kept.camera_queuestays sampled gauges. Recorded cardinality decision (D-CAM-25):camera_captures/camera_queuestay fleet-scoped (no per-camera dim) to avoid 256-streams-per-measure; only the lower-frequencyCameraCommandcarriesinstance.overview/signals/diagnosticsviaregister_panel, order 10/20/30,scope:"instance", bound to the verbs served (overview →sb/status/sb/reconnect/sb/pause/sb/resume). (D-CAM-26)P2 — hygiene
AGENTS.md+CLAUDE.md(@AGENTS.mdimport + local-dev notes).DESIGN.mdregister extended (D-CAM-23…28).config.schema.json— Draft 2020-12 schema whose root modelscomponent.global(with$defs/camerafor instances +$defsfor every backend/profile/schedule/enum), derived field-for-field fromsrc/config.rs; strict where the parser is, permissive only where it is (featureOverrides,resourceGroups).edgecommons component validatereports no findings. (D-CAM-28)deploy-docs.yml— hook-guarded docs-rebuild workflow, verbatim frommodbus-adapter.data-types.mddecision — addeddocs/reference/data-types.mdrecording the signal value-mapping page is N/A for an image adapter, pointing tomessaging-interface.mdfor the published shapes. (D-CAM-27)Cargo.lockcommitted (git-sourced),/Cargo.lockgitignore + rationale dropped; Dockerfile/dockerignore/MSRV build--locked; RTSP harness keeps its writable-overlay lock. Resolution recorded inDESIGN.md(D-CAM-27).BUSL-1.1(matchesLICENSE).Fixes #7.Breaking change (SD-E) + consumer grep
The error-code rename is wire-visible for any consumer keying on the old strings (
INVALID_REQUEST/INSTANCE_REQUIRED/UNKNOWN_INSTANCE/CAMERA_UNAVAILABLE). The component is pre-1.0/experimental; a documented breaking change is acceptable. Consumer grep found no matches for the old strings inedge-console(ui/protocol/gateway source) orbottling-company-test, so no out-of-tree consumer breaks. Called out indocs/reference/messaging-interface.md(current codes) andDESIGN.md(D-CAM-23, migration record).Validation
cargo test --lib: 631 passed, 0 failed, 1 ignored (self-skipping live suite).cargo clippy --all-targets -- -D warnings: clean.cargo llvm-cov --lib: line ~92.9% (≥90 gate); diff coverage 96% (≥95 gate,diff-covervsorigin/main).config.schema.json: validated with a Draft 2020-12 validator (shippedsimulator-config.json+ DESIGN §10.1 example ACCEPT; five malformed cases REJECT) and withedgecommons component validate— OK, no findings (lockfile warning resolved).cargo check --lockedwith the.cargo[patch]inactive resolves the pinned git dep from the committed lock.rtsp/genicamsuites and the Docker image build run in CI (the live proxy for this sim-backed adapter).Fixes #8Fixes #7🤖 Generated with Claude Code
https://claude.ai/code/session_01DxV5wFi7LCratBERVT6aiL