Skip to content

Adopt the CLI-scaffold-parity component baseline #4

Description

@mbreissi

Context

PR edgecommons/edgecommons#57 (design: core/docs/platform/DESIGN-cli-scaffold-parity.md) establishes a component baseline that the edgecommons CLI now scaffolds for every new component: kebab naming, rev-pinned core dependency + committed lockfile, a Diátaxis docs/ set synced to the docs site, CI calling the reusable component-ci.yml plus an enforced 90% line-coverage gate, governance files (AGENTS.md / CLAUDE.md / DESIGN.md / LICENSE), and a config.schema.json checked by edgecommons component validate.

edge-console is category console — a special component, not a southbound adapter — so only the cross-cutting items (1–6) apply. The adapter-only items (sb/* command surface, southbound_health, panel registration, device seam) do not. One console-side note is included at the end: the new adapter templates all register a standardized overview/signals/diagnostics panel trio, and the console is the consumer of those descriptors.

This issue is the gap analysis against the actual repo state and the prioritized remediation plan. Much of the baseline is already met — the repo is mature (fleet model, descriptor panels, command gateway, full docs set) — so the plan below is a targeted delta, not a rework.

Gap analysis

1. Naming — MET

  • Repo edge-console, crate/bin edge-console-gateway (gateway/Cargo.toml), npm packages @edgecommons/edge-console-ui / @edgecommons/edge-console-protocol: all kebab.
  • Greengrass component name com.mbreissi.edgecommons.EdgeConsole (docs/README.md) stays PascalCase reverse-DNS, per convention.
  • No recipe/Dockerfile/k8s files in-repo to disagree with the artifact name.

2. Dependency pin + lockfile — PARTIAL

  • The core dependency is the Rust gateway's: edgecommons = { path = "../local/edgecommons-rust" } — a gitignored link generated by scripts/link-sibling-rust.mjs. CI (.github/workflows/ci.yml) checks out edgecommons/edgecommons at the floating default-branch HEAD and links it. The baseline for a real component is a git rev= pin in Cargo.toml plus a gitignored .cargo/config.toml [patch] sibling override for local dev. Today every CI run floats with core main.
  • Cargo.lock is committed (good), but because the core dep is a path dep the lockfile cannot pin it — the rev pin above is what closes this.
  • package-lock.json is deliberately gitignored (.gitignore comment: it would record the local local/edgecommons stub). That rationale is now stale: neither protocol/ nor ui/ depends on @edgecommons/edgecommons any more (the core dep moved to the Rust gateway), so the lockfile no longer records a local stub. Baseline: commit package-lock.json and switch CI to npm ci.

3. Diátaxis docs synced to the site — PARTIAL (strong)

  • Present: docs/{README,tutorial,how-to-guides,explanation,sample-configurations}.md, plus user-guide.md, plus docs/reference/{configuration,messaging-interface,data-types}.md. Present-tense, current-state prose — a marker scan found no roadmap/status/history language. Registered in registry/components.json, so the site sync picks the docs up.
  • Missing: docs/reference/metrics.md. The gateway is a standard EdgeCommons component with metricEmission configured and its own self-vitals (gateway/src/self_vitals.rs); what it emits belongs in a metrics reference page like the sibling components have.

4. CI + 90% coverage seam — PARTIAL

  • .github/workflows/ci.yml exists and is real (build protocol→ui→gateway, cargo test, npm test, lint), but it is bespoke — it does not call edgecommons/.github/.github/workflows/component-ci.yml@main, and there is no deploy-docs.yml (CI even paths-ignores docs/**, so doc-only pushes never refresh the docs site).
  • Coverage: ui/vitest.config.ts already configures 90% statements/lines thresholds (credit — the seam discipline exists), but CI runs npm test, not npm run coverage, so the gate is not enforced anywhere. protocol/ has no coverage config at all, and the Rust gateway has no coverage gate (no cargo llvm-cov --fail-under-lines 90).

5. Governance — PARTIAL

  • LICENSE present (BUSL-1.1). The manifest metadata mismatch (root/ui/protocol package.json and Cargo.toml still declare Apache-2.0) is already tracked as License: reconcile license declarations to BSL 1.1 (BUSL-1.1) #3 — not duplicated here.
  • DESIGN.md exists and is substantial (docs/design/DESIGN.md, with mockups, phase plans, and the reconciliation docs beside it).
  • Missing: AGENTS.md and CLAUDE.md (one-line @AGENTS.md import) at the repo root, per the sibling-repo pattern.

6. config.schema.json — MISSING

  • The gateway has a real config surface (component.global.console.{ws,staleness,…}, documented in docs/reference/configuration.md, exercised by test-configs/{config,dallas-site}.json), but there is no config.schema.json, so edgecommons component validate cannot check a console config.

Console-side compatibility with the standardized adapter panel trio — MET

The new adapter templates register overview / signals / diagnostics panels (order 10/20/30, scope: "instance") via register_panel. The console already renders descriptor-driven panels generically: it invokes cmd/describe, parses PanelManifest.views[] (id/title/order/scope/widgets — protocol/src/index.ts), and renders the exact widget vocabulary the trio uses (summary, keyValueList, metricStrip, commandSummary, treeBrowser, signalGridui/src/components/ComponentDetailView.tsx). No console change is required for template-scaffolded adapters; a fixture test pinning the template trio manifest is listed under P2 to keep it that way.

Remediation plan

P0 — reproducibility and validation contract

  1. Pin the core library by git rev. Replace the floating path link with edgecommons = { git = "https://github.com/edgecommons/edgecommons", rev = "<sha>" } in gateway/Cargo.toml plus a gitignored .cargo/config.toml [patch] sibling override for local dev (the sibling-repo shape); update ci.yml to drop the core checkout/link steps (or check out at the pinned rev while the crate path dep needs it). Cargo.lock then pins the exact core sources.
  2. Commit package-lock.json (the local-stub rationale no longer applies) and switch CI to npm ci.
  3. Add config.schema.json modelling component.global.console.*, validated against test-configs/*.json, so edgecommons component validate covers the console.

P1 — CI conformance, coverage gate, docs and governance completion

  1. Enforce the 90% coverage seam in CI: run npm run coverage (ui thresholds already exist), add a vitest coverage config with thresholds to protocol/, and add cargo llvm-cov --fail-under-lines 90 for the gateway — excluding only thin live-runtime seams (the axum serve loop / broker edge) per the org rule: never lower the gate or exclude testable logic.
  2. Adopt the org CI shape: call edgecommons/.github/.github/workflows/component-ci.yml@main (language: RUST, per the registry entry) as the base job, keeping the workspace-specific protocol→ui→gateway build/test steps as an additional job; if the reusable workflow cannot express the dual-toolchain workspace, keep the bespoke job but state the divergence in AGENTS.md.
  3. Add deploy-docs.yml (the hook-guarded docs-rebuild trigger, verbatim from modbus-adapter) so doc-only pushes refresh the docs site.
  4. Add docs/reference/metrics.md documenting what the gateway actually emits (library metrics + self-vitals), matching the sibling reference sets.
  5. Add AGENTS.md + CLAUDE.md (@AGENTS.md import) per the sibling pattern; link docs/design/DESIGN.md from them as the design-fidelity contract.

P2 — hardening and polish

  1. Panel-trio fixture test: a UI test rendering the exact overview/signals/diagnostics describe-manifest the adapter templates emit, so console-side compatibility with the standardized trio is pinned, not incidental.
  2. License metadata: close via License: reconcile license declarations to BSL 1.1 (BUSL-1.1) #3 (BUSL-1.1 in every manifest).
  3. Sweep stale narrative from package metadata: ui/package.json description still narrates slice history ("Slice C3 ships… C5/C6 follow") — replace with current-state wording.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions