Files
NODEDC_MISSION_CORE/AGENTS.md
T

22 KiB
Raw Blame History

Repository operating rules

NODEDC MISSION CORE is a vendor-neutral mission-control monorepo. Its first real device plugin investigates an owner-controlled XGRIDS/LixelKity K1 as a black-box sensor. Preserve the device, the host, the working LAN, raw evidence, and the boundary between Mission Core and vendor-specific integration code.

Single working directory — owner requirement, 2026-10-08

The governing Ops record is MISSIONCOR-50 — Фундаментальная архитектура Mission Core, in the owner rules dated 2026-10-08. The main MISSIONCOR-1 architecture plan links to that record for monorepo, storage, resource and live-only telemetry rules.

  • Keep exactly one Mission Core checkout on the operator Mac: NODEDC/NODEDC_MISSION_CORE. Use commits and branches in that repository. Do not create sibling clones, worktrees, baseline copies, or task-specific Mission Core directories without a new explicit owner request.
  • The canonical service on port 8000 and its LaunchAgent use this checkout. Keep its existing runtime data under .runtime/mission-core; never merge retired worktree application states into that live data directory.
  • Keep private rover/CAD working materials under private/engineering, local engineering reports under outputs, and simulation qualification evidence under .runtime/simulation-qualifications. These are local data, not source files to add to normal Git. Preserve unique evidence when moving or retiring a workspace, and verify equality before removing duplicate files.
  • Bound generated build storage. Retain the two most recent intermediate Linux build-input packages per active build line; preserve separately designated qualified releases and required rollback artifacts. Do not accumulate a new full package after every iteration without retiring superseded intermediates.
  • Build storage lifecycle is implemented by scripts/packaging/build_retention.py; follow docs/STORAGE_RETENTION.md. New input generators return a persistent active owner handle. After the remote job/transfer/qualification is confirmed terminal, close only your own hold with finish (pin qualified/rollback outcomes), review its plan and apply it as part of build completion. Never expire active holds by age or declare unknown legacy inputs disposable.
  • Run local Python validation through scripts/check_python.py pytest|ruff|mypy (pass the usual file/selection arguments). It owns temporary caches, disables persistent pytest/Ruff cache output, and cleans its own scratch after child processes end. Never sweep another active job's cache or unknown crash residue.
  • Runtime cache publication quotas and bounded service journals are defined in docs/STORAGE_RETENTION.md. Existing replay/overlay data remains protected; a full quota refuses a new copy rather than deleting recovery material.
  • Check disk space before large builds or captures. Keep task scratch work under .runtime and clean generated scratch at completion; do not scatter temporary project folders through the parent repository directory.
  • Owner amendment, 2026-10-19: completed simulation/urban-infrastructure engineering experiments must not retain unlimited raw frames, render arrays and step-by-step traces by default. At closeout preserve a compact textual report, exact inputs/configuration/source identities, result/limitations and regression evidence; archive text with verified hashes, then retire the explicitly inventoried disposable derived files after all owners stop. Use one content-addressed text copy for duplicates. Keep only the limited visual evidence needed by the final report. Do not leave a complete new media export after every iteration or require the owner to clean it manually. This is a closeout obligation for engineering-owned scratch, not permission to TTL-delete application runs, scans, accepted maps, working code, offline dependencies, installers, qualified releases or pinned rollback. Unknown or active ownership blocks removal; retain a deletion receipt and link the archive from the report/Ops. See the amendment in docs/STORAGE_RETENTION.md.
  • Other repositories, platform worktrees, infrastructure, DOC, workspace bridge, Site/SEO, BIM Viewer, Device Core, Design Guideline, and Gaussian Pipeline are separate ownership boundaries. Mission Core cleanup must not alter them.
  • Operator telemetry is live-only: bounded latest values in RAM, expiry and a daily reset. Do not reintroduce a local time-series database or persistent raw monitoring history on the Mac. Diagnostic logs must rotate. Future historical monitoring requires an explicitly provisioned separate service; simulation evidence and recordings have a separate lifecycle and must not be deleted as part of telemetry cleanup.
  • Owner amendment, 2026-10-20: new semantic-learning images, observations, datasets, checkpoints and heavy experiments belong to a separate portable persistent store on Worker 006, outside the source checkout and container writable layer. Never accumulate them on the operator Mac or add a local fallback. Core may keep viewer scenes, semantic results and bounded edit metadata. Saving an edit is not dataset preparation or training acceptance; retain the immutable algorithm result and human provenance separately. See docs/SEMANTIC_EDITOR.md for the delivered scope and outstanding gates.

Non-negotiable safety boundaries

  • Default to non-mutating discovery or read-only operations. CoreBluetooth BLE scanning on macOS is active discovery, not passive radio sniffing.
  • Do not send BLE writes until the exact service, characteristic, framing, payload semantics, rollback, and expected state transition are documented.
  • BLE notification subscription may perform the standard temporary CCCD write; disclose it explicitly and do not conflate it with provisioning writes.
  • Do not fuzz, brute-force, upload firmware, delete device files, guess SSH/ADB credentials, or probe unrelated LAN devices.
  • Network probes must target the confirmed K1 IP. A full home-subnet scan is not a default operation.
  • Never place a Wi-Fi password in CLI arguments, logs, manifests, source, test fixtures, or Git history.
  • Do not install Python packages globally. Use the repository-local .venv managed by uv.
  • Do not install or alter Homebrew/system components unless the user explicitly authorizes that concrete change.

Local operator resource envelope

  • The local operator machine is a 14-inch 2023 MacBook Pro with only 18 GB of physical memory. Treat local memory and swap as a hard shared operational limit, not as disposable build capacity.
  • Run frontend tests, production builds, Docker builds, runtime startup, and browser QA sequentially. Do not launch parallel heavy local jobs.
  • Do not start Docker Desktop, a Compose stack, a second browser automation session, or a full test/build pass merely for convenience. First prove that the operation is necessary, prefer the narrowest focused check, and keep no more than one memory-intensive validation job active at a time.
  • Do not run load or stress tests on the Mac. Run bounded synthetic load only on Worker 006, and remove every temporary process after the measurement.
  • Use only the canonical Mission Core endpoint on port 8000; do not start duplicate application servers to work around stale state.
  • Before a memory-intensive local operation, inspect current memory pressure and active Docker workload. If memory pressure is elevated or swap is growing, stop and remove temporary jobs before continuing. Prefer focused tests and existing build artifacts when they are sufficient for acceptance.
  • After every local test, build, replay, browser-QA, or Docker operation, stop temporary workers, watchers, replay publishers, duplicate viewers, and containers that are not durable operator state. Keep only the canonical Mission Core service on 8000 and explicitly required operator services.
  • Docker Desktop's configured VM ceiling is not evidence that the host can safely supply that memory. Do not change Docker Desktop CPU or memory limits without explicit owner approval.

Evidence rules

  • Reference inputs under docs/reference/ are immutable; write corrections in audits or ADRs.
  • Every real experiment gets a session ID, UTC and monotonic timestamps, a redacted manifest, operator notes, and SHA-256 hashes for raw artifacts.
  • Real PCAP, K1 projects, logs, images, point clouds, credentials, serials, and router client lists stay out of normal Git. Git LFS solves size, not secrecy.
  • Synthetic or explicitly redacted fixtures may be committed under tests/fixtures/.

Onboard environment ownership — owner requirement, 2026-09-24

  • Every onboard OS change belongs to the shipped, versioned installer or the application's environment/device preparation workflow from the first test. The operator installs the build and configures it in the application; never require hand-written service files, USB rules, permission fixes or commands.
  • This applies to all Node features, including GUI/service autostart and USB recovery, not just individual camera drivers. Read-only SSH inspection and bounded artifact-owned build staging remain allowed.
  • Detect the distribution, architecture and required capabilities. Maintain explicit supported environment profiles; do not claim arbitrary Linux compatibility from a qualified Ubuntu build. Preserve foreign configuration, report unsupported features, make preparation repeatable, and ship rollback.
  • Do not add USB administration controls or port resets to inventory refresh. Automatic startup recovery may retry terminal enumeration failures only; preserve enumerated devices and active companion ports. Device identity and assignments must survive changes of USB port and tty number.

Insta360 and clean-host installation — owner requirement, 2026-09-08

  • The current X4 starting point is USB enumeration only. SDK installation, camera initialization and live video have not been accepted.
  • Every Ubuntu change needed for Insta360 must execute through the shipped installer or the application's versioned device-preparation workflow from the first board experiment. Do not repair the board with an ad-hoc apt/pip install, copied library, chmod, environment override, service edit or root invocation and promise to package it later. Fix the product artifact first, then rerun that artifact. Read-only engineering inspection remains allowed.
  • Document every relevant action and its before/after evidence in docs/node/07_INSTA360_X4_INSTALLATION_LEDGER.md; record the artifact version, owning installer step, dependencies, idempotency, failure behavior and rollback. Keep private logs/identifiers/media out of Git and redact their public summary.
  • A working prepared Mini is not clean-Ubuntu acceptance. Qualify dependency closure on the declared clean OS image and actual USB operation separately; installer, preparation and GUI acceptance must use the same shipped code.
  • X4 is operator live video and camera control (settings, photo, recording start/stop and file access), per the owner’s subsequent scope expansion. Preview and recording are separate operations. No stitching, AI, navigation or vehicle-control integration is admitted. Model support and physical device instances are separate: several cameras of the same model must retain independent identity and lifecycle.
  • Follow the scoped implementation plan in docs/node/06_INSTA360_X4_AND_MULTI_CAMERA_PLAN.md. It is a proposed plan, not evidence that SDK compatibility, hardware capacity or installation passed.
  • Subsequent owner direction: the existing Ubuntu Mini is the available build and qualification machine; do not depend on Worker 006 or another host for this X4 work. Its existing GCC may compile through a versioned build artifact in bounded temporary staging. This is a build step, not runtime installation: no system changes, SDK execution or camera access during compilation. The final installer must carry the compiled payload so a clean operator Ubuntu does not inherit an undeclared compiler/build-cache prerequisite. All board staging/build/install/test actions remain documented and artifact-owned.

Implementation order

Follow the gates in docs/01_IMPLEMENTATION_PLAN.md. Do not build heavy decoders before BLE/Wi-Fi/data-session evidence exists.

Docker runtime governance

  • Every new or migrated durable NODE.DC-owned Docker container, Compose project, network, named volume, and first-party image uses the lowercase ndc- namespace. The prefix is mandatory for anything that may leave a laboratory workstation; a legacy project/network name may survive only behind a bounded, documented migration barrier.
  • Do not retag or rename unrelated third-party runtime owned by another product. Express NODE.DC ownership through the managed object name and com.nodedc.product, com.nodedc.stack, com.nodedc.role, and com.nodedc.managed-by labels.
  • One operator-managed contour may be one Compose project while still using separate single-purpose containers. Do not merge a broker, normalizer, database, or application process into a multi-process container merely to make Docker Desktop show one row.
  • Treat Compose and worker orchestration declarations as the source of truth. A live docker rename is allowed only as a bounded migration with exact predecessor IDs, a persisted declaration change, rollback, and post-change health acceptance.
  • Keep bounded legacy-name fallback only for an explicit migration window. New defaults, UI probes, runbooks, and durable runtime names must use ndc-.

Product UI governance

  • For every Control Station, LAB, viewer, or product-presentation change, use .codex/skills/mission-core-product-ui/SKILL.md and follow docs/17_PRODUCT_UI_AND_LAB_PRESENTATION_CANON.md and docs/18_APPLICATION_COMPONENT_ARCHITECTURE.md.
  • The integrated Control Station and API have one canonical local endpoint: http://127.0.0.1:8000. Never start a second Mission Core backend on another port to bypass a stale process. TCP 8765 is legacy Foxglove regression only, not an operator path. Restart the canonical 8000 process and finish with no Mission Core backend listening on 8765.
  • The canonical 8000 process is durable operator state. A completed test, build, browser QA pass, Codex turn, or implementation increment never authorizes stopping it. Every Control Station task starts by checking and, if necessary, starting the integrated service; every handoff verifies and leaves that exact service running on 8000. A rebuild may replace it only when the replacement is confirmed listening before handoff.
  • NODEDC_DESIGN_GUIDELINE is the only visual-design source of truth. Before editing UI, read its registry/registry.json, registry/components.json, registry/icons.json, and the relevant component documentation.
  • Reuse @nodedc/ui-react, @nodedc/ui-core, tokens, icons, and page patterns. Do not create an application-local visual control, interaction state, geometry, color language, or copy of a design-system component.
  • If the required visual entity is absent from the Design Guideline, stop and obtain explicit product-owner approval. After approval, add it to the Design Guideline first with registry, documentation, states, and validation; only then consume it here.
  • Domain renderers may remain Mission Core code when they visualize Mission Core data. Their controls and containing surfaces must still be composed from canonical Design Guideline exports.
  • Product UI must not expose implementation steps, roadmap gates, internal reason taxonomies, debug controls, placeholder status blocks, or temporary experiment scaffolding. Keep these in local engineering reports or developer tooling.
  • Extend one reusable application pattern instead of adding per-LAB layouts. A new LAB supplies data and renderer configuration; it does not invent a new page hierarchy or visual language.
  • Do not generalize the LAB hierarchy into a universal application template. For a new non-LAB interface, follow docs/19_PRODUCT_SURFACE_EXTENSION_PROTOCOL.md: identify the operator job, compare placement/composition alternatives, classify the novelty, and obtain product-owner agreement before adding a workspace, changing primary navigation, or introducing a new product root.
  • Preserve one product grammar while allowing task-specific composition. A scene, map, timeline, queue, editor, topology, dashboard, and LAB review may have different layouts when their entity, lifecycle, or action model differs.
  • Preserve the internal dependency direction: core → components/renderers → workspaces → composition/App. Core never imports workspaces or visual adapters; reusable components never import workspaces. New domains and LAB runs get their own feature module instead of growing App.tsx, Workspaces.tsx, or generic CSS buckets.
  • Treat productModel.ts, executable versioned contracts, and the experimental vocabulary as the current local semantic sources. Do not add a parallel runtime ontology unless the admission conditions in docs/18_APPLICATION_COMPONENT_ARCHITECTURE.md are met.

Laboratory presentation and reporting

  • Use one fixed laboratory presentation contract: selectors, one compact canonical summary, admitted evidence viewer(s), result, and optional reusable technical details.
  • Keep missioncore.laboratory-report/v1 executable: bounded ENNResult.tsx modules supply all four LaboratorySummary brief fields and use LaboratoryResultSummary for metrics plus proved/not-proved/decision. They never own canonical summary/result markup. Anatomy changes require a new version and product-owner agreement.
  • The compact summary must explain the decision question, immutable source, tested method/models/algorithms, experimental mode, principal result, limitations, and retained authority. It is not the engineering report.
  • Owner reporting rule (2026-10-09), clarified 2026-11-04: keep current Ops summaries concise and evidence-backed: what works, implementation and accepted scope. Replace or remove obsolete assertions about the current state. Preserve decision-relevant dated experiments: capability/limit findings, tested alternatives and consequential failures that explain a decision or prevent repeating a dead end. Keep the method/conditions, outcome, limitation, decision and evidence reference separate from current state. Age alone does not make useful evidence disposable. Do not retain every attempt, intermediate UI edit, routine check or duplicate metric merely for history; consolidate nonessential detail and keep traces local. A local backup alone does not preserve important experiment findings in Ops. Annotate disproved interpretations without erasing their observations; never invent why an untested option was rejected. Raw logs/media, credentials and secret fields remain in private evidence; proposals remain explicitly unverified. Never present a partial experiment as a completed product result. Follow the ops-context skill for card updates.
  • Spatial evidence uses 3D by default. Image-space reprojection may be offered as a 2D diagnostic mode inside the same reusable viewer. Primary evidence viewers must provide the canonical expand/restore action.

Urban semantic agent contract — owner requirement, 2026-10-26

  • Product foundation: read docs/SCENE_SEMANTICS_PRODUCT_CONCEPT.md. Each scan is a standalone local scene, including unnamed/unmapped locations. Raw recorded sensor points support localization; Gaussian observations support the current semantic research. Never substitute Gaussian-derived geometry for raw points.

  • No GPS/address/public-map prerequisite and no automatic cross-scan geographic matching, overlap search, registration or merging. Those require a separate explicit owner request. Named train/evaluation source lists do not authorize geographic investigation. Preserve source lineage and evaluation honesty.

  • Crosswalks are functionally important; the target includes all observed road markings for scene context, interface/product value and difficult-task validation. Do not reduce the scope to demo-only markings or crosswalks only.

  • For automated infrastructure annotation, dataset preparation and learning, begin with live Ops MISSIONCOR-93 (agent contract) and MISSIONCOR-88 (product), then docs/SEMANTIC_AGENT_OPERATING_CONTRACT.md. Reuse the current hypothesis register and existing experiments; a new chat does not reset the investigation.

  • The owner explicitly requests MISSIONCOR-93 to hold current architecture, rules, bounded next steps and portable handoff. This is the scoped exception to the earlier delivered-results-only Ops rule. Keep raw logs/media in local engineering evidence; update the current card blocks after meaningful changes.

  • Root owns the useful outcome, real dispatch, integration and final decision. Use one reusable critic and an optional bounded research scout, at most two active helpers and no nested delegation. Send compact briefs, not full history.

  • New annotation cycles use the v2 objective/dispatch contract. Approved partial annotations are distinct from completing the enclosing product work package. Handle introduced critical regressions within the session or revert/isolate the change. Do not declare success merely because a ledger or test completed.

  • Choose reusable pipelines against actual inputs/outputs and accumulated evidence before narrow tuning. Every closed hypothesis states tested scope, supporting artifacts and a substantive condition for reopening. Do not repeat unchanged searches or model variants under a new name.

  • Worker access/power/runtime authority comes from the owner's current session instructions, never from the card or an old experiment's training allowance.