This refactor remains a breaking TapDB-only cut for shared fleet state: no local-file, DynamoDB, S3-backup, or in-memory datastore paths remain in supported runtime code. The main change from the prior hard-cut plan is that auth keeps an explicit global --no-auth runtime override, and the Python library split becomes dual-mode by responsibility:
- the zebra_day service and admin/CLI runtime use direct TapDB via
ZebraDayClient - downstream Python apps use a separate API-backed client to fetch shared printer/template/profile state from a specified zebra_day service and can still send print requests to printers through library code
Default posture is still Cognito auth and TapDB-backed service ownership of shared state. --no-auth is the only retained compatibility override.
Ownership:
- storage/runtime architecture
- delete set
- server-side Python client
Deliverables:
- Delete the legacy storage layer and all related runtime selection logic:
backends/local.pybackends/dynamo.pybackends/memory.pybackends/__init__.pyZEBRA_DAY_CONFIG_BACKEND
- Remove all TapDB failure fallbacks, especially
InMemoryFleetRepositoryand any silent fallback-to-memory behavior. - Remove legacy engine/config bridges:
_legacy_config()_legacy_engine()PrinterRecord.to_legacy_dict()- package-root shim helpers that exist only to preserve old result shapes
- Keep
ZebraDayClientas the server/admin client for direct TapDB use only. - Make
ZebraDayClientfail fast if TapDB config, TapDB connectivity, or required TapDB dependencies are missing. - Keep checked-in
.zplassets only as bootstrap seed content for TapDB, never as runtime state.
Ownership:
- printer transport
- discovery/render/print logic
- downstream Python API client
Deliverables:
- Remove
print_mgr.zpl()as a supported runtime engine. - Extract raw printer/render helpers into internal protocol modules that do not own config storage.
- Rebuild server-side discovery, render, and print flows so they resolve state from TapDB directly and write observations/print jobs back to TapDB directly.
- Add a new downstream API-backed client,
ZebraDayApiClient, for apps like Bloom and other Python consumers. ZebraDayApiClientmust fetch shared state from a configured zebra_day HTTP API, not from TapDB.ZebraDayApiClient.print_label(...)must support direct printer delivery after remote resolution of printer/template/profile/defaults.ZebraDayApiClient.submit_print_job(...)must support optional server-side print submission through the zebra_day API.ZebraDayClientremains the only direct-TapDB client; downstream apps should not talk to TapDB directly.
Ownership:
activatezdaycommand surface- deployment/runtime guardrails
Deliverables:
- Replace activation with Atlas-style
source ./activate <deploy-name>. - Activation must require exactly one deploy name, sanitize it, export deployment vars, and activate or create a conda env named
ZEBRA_DAY-<deploy-name>. - Deployment-scoped config lives under
~/.config/zebra_day/...-<deploy-name>and stores service/auth/runtime settings only. - Rebuild
zdayaround Atlas-styleCliSpec + EnvSpec + ConfigSpec + XdgSpec. - Remove legacy CLI groups tied to old stores or file editing:
zday dynamo- YAML/JSON fleet-editing commands
- local template file-management commands as runtime authority
- Add Atlas-style passthrough groups:
zday tapdb ...zday cognito ...
- Add zebra_day-native management groups:
zday gui ...zday logs ...zday printer ...zday users ...
- Add a root/global
--no-authoption on the CLI runtime sozday --no-auth ...andzday --no-auth gui start ...disable web/API auth for that invocation. - Keep default auth mode as Cognito in config and startup validation;
--no-authis an explicit runtime override, not the default.
Ownership:
- FastAPI app
- JSON API contract
- Jinja UI
- auth/runtime behavior
Deliverables:
- Make the FastAPI app TapDB-backed only. App startup must fail if TapDB is unavailable.
- Remove all web/runtime dependence on
app.state.zp,_backend, local template scans, backend switching, import-to-dynamo flows, and legacy-config listings. - Keep FastAPI + Jinja, but make every page/API route operate on TapDB-native records only.
- Preserve a stable API contract specifically for the new downstream
ZebraDayApiClient. - Supported remote-state endpoints must include:
- labs
- printers
- templates
- label profiles
- render/resolve helpers
- server-side print submission
- Auth rules:
- default service mode uses Cognito
- machine clients may use
Bearer INTERNAL_API_KEY - global
--no-authdisables route auth for that server instance
- UI/admin pages must expose deployment, TapDB namespace, auth mode, health, logs, printer fleet, templates, and user/admin operations without any multi-backend UI.
Ownership:
- test rewrite
- doc rewrite
- breaking-change contract
Deliverables:
- Delete or rewrite all tests that assume local YAML/JSON state, DynamoDB/S3, backend switching, legacy config migration, or in-memory repository fallback.
- Replace them with TapDB-backed fixtures and API-backed client tests.
- Add a dedicated test matrix for auth modes:
- Cognito enabled
- service token /
INTERNAL_API_KEY - global
--no-auth
- Add dedicated tests for the new library split:
ZebraDayClientdirect-TapDB behaviorZebraDayApiClientremote fetch + local direct-print behaviorZebraDayApiClient.submit_print_job(...)server-submitted behavior
- Rewrite docs so this file is the canonical hard-migration spec reflecting:
- TapDB-only shared state
- Atlas-style activation
- global
--no-auth - dual Python client model
- removal of old local/Dynamo runtime paths
- Add explicit breaking-release notes listing removed commands, env vars, modules, and deprecated Python entrypoints.
Supported after the cut:
source ./activate <deploy-name>ZebraDaySettings.from_context(deployment=None)ZebraDayClient(settings)for direct TapDB service/admin usageZebraDayApiClient(base_url, api_key=None, verify_ssl=True)for downstream apps that fetch shared state from a zebra_day APIzday --no-auth ...as a global runtime auth overridezdaycommand groups for GUI, logs, printers, users, TapDB passthrough, and Cognito passthrough
Removed after the cut:
print_mgr.zpl()as a supported engine- package-root legacy helper surface that returns YAML-era printer dicts
zday_activatezday_startzday_quickstartzday dynamoZEBRA_DAY_CONFIG_BACKEND- local YAML/JSON fleet config as runtime state
- DynamoDB/S3 runtime support
- in-memory datastore/runtime fallback
- sibling-package fallback CLIs or legacy-env auth bootstrap
- Activation tests:
source ./activate <deploy-name>requires exactly one deploy name- invalid deploy names hard fail
- active env name matches
ZEBRA_DAY-<deploy-name> - deployment-scoped config and TapDB vars resolve correctly
- Direct TapDB runtime tests:
ZebraDayClientfails fast when TapDB is missing- no code path falls back to memory, local files, or Dynamo
- discovery/render/print work without
print_mgr.zpl()
- Remote client tests:
ZebraDayApiClientlists labs/printers/templates from API- template/profile/default resolution from API is correct
- direct printer send after remote resolution works
- server-side
submit_print_job(...)works
- Auth tests:
- Cognito mode protects routes and API as expected
INTERNAL_API_KEYworks for machine clients- global
--no-authremoves auth requirements for that process
- Regression guards:
- no imports remain from
zebra_day.backends.* - no supported runtime code depends on
print_mgr.zpl() - no docs or CLI help mention local/Dynamo operational modes
- no imports remain from
- No offline migrator is shipped. Old local/Dynamo data are out of scope for this cut.
- Shared fleet/template/profile state lives only in TapDB through the zebra_day service.
- Downstream Python apps should use
ZebraDayApiClient, not direct TapDB access. ZebraDayApiClient.print_label(...)defaults to direct printer delivery after remote resolution; server-side delivery is explicit throughsubmit_print_job(...).- Default auth mode remains Cognito.
--no-authis retained as the only explicit runtime bypass.