-
Notifications
You must be signed in to change notification settings - Fork 0
CONCERNS
Mike Crowe edited this page Aug 15, 2026
·
5 revisions
Analysis Date: 2026-08-15
-
Location:
src/harnessed/launcher.py -
Impact: The largest module in the tree by a factor of 1.5 over
schema.py(3231) and 4× overmounts.py(1212);src/harnessed/totals ~20k lines across 37 modules, so a quarter of the application sits in one file. It carries the Typer CLI, the build path, auth wiring, the aoe bridge, and bothExecutionBackendimplementations (HostBackend:2167,ContainerBackend:2783). The size is what makes the CWD and bare-exceptfindings below easy to introduce and hard to see, and it forces most launch-path tests to stub at the module boundary rather than the unit. -
Fix approach: The seam already exists —
backend.pydefines the contract andtests/test_module_boundaries.pyenforces the one-way import. Extracting the two backend classes into their own modules is mechanical and does not change behavior; the co-location was a deliberate choice to avoid an import cycle (seebackend.py's docstring), so any split must keep the dependency pointing intobackend.py. - Note: This concern predates the 2026-08-15 regeneration and was dropped from it without being fixed. Re-stated here at the current measured size.
-
Location:
src/harnessed/launcher.py:4657 -
Impact: The
svccommand unconditionally callsPath.cwd().resolve()with nopathparameter accepted. Every other run-path (host_run,container_run,setupenv) accepts a--pathflag and falls back to CWD only if unset. The CLAUDE.md constraint "Never key build/assembly off the CWD" is violated forsvc— invoking it from a wrong directory silently uses the wrong project key, producing confusing "service not found" errors. -
Fix approach: Add a
--pathoptional argument mirroring the pattern atlauncher.py:2320andlauncher.py:2619.
-
Location:
src/harnessed/launchenv.py:160,src/harnessed/launchenv.py:216 -
Impact: Both
_write_op_env_fileand_normalize_plain_env_fileuse bareexcept Exceptionduring temp-file cleanup before re-raising. If the secondaryos.unlinkitself raises anOSError, the original exception is lost in Python's exception chaining only if the cleanupOSErrorpropagates — but there is noraise ... from excto preserve the original. In practice the cleanup is wrapped in its ownexcept OSError: pass, so the primary exception does re-raise. The real risk is diagnostic: ifos.chmodoros.fdopenfails in an unusual way, the stack trace entry pointing at the real cause may be obscured. -
Fix approach: Use
except Exception as exc: ... raiseinstead of bareexcept Exceptionto ensure the cause stays in__context__.
-
Location:
src/harnessed/svcstate.py -
Impact: Scoped claim —
svcstate.pyis not untested._service_refs(svcstate.py:274) is exercised from seven test files (test_service_refs.py,test_launcher_services.py,test_project_scoped_services.py,test_stable_port.py,test_backend_seam.py,test_launch_host.py,test_capmatrix.py), several through thelauncherre-export. The real gap is narrower: the lifecycle dispatch (up,down,recreate,sync) and the threesubprocess.runcallsites for podman inspect/pod/exec have no dedicated coverage, so a regression there is invisible unless another test incidentally crosses it. -
Fix approach: Add
tests/test_svcstate.pywith monkeypatchedsubprocess.runcovering theup/down/recreatedispatch and the timeout path.
-
Location:
src/harnessed/capability.py:510,src/harnessed/capability.py:899 -
Impact:
_launch_stack_headlessand a second callsite allocate a temp project dir withtempfile.mkdtempand document "CALLER owns its lifetime". The comment at line 507 warns that deleting the dir while the pod runs breakspodman exec. If a caller forgets cleanup or raises before teardown, the scratch dir leaks under/tmp. The test suite never exercises the pod layer (CLAUDE.md: "suite runs nopodman buildand noharnessed container-run"), so no test can catch a missing cleanup. -
Fix approach: Return the temp path alongside the launch result so a
try/finallyat the call site is structurally required, or convert to a context manager.
-
Location:
src/harnessed/launcher.py:3266 -
Impact: The
container_runcleanup block (cleans up an orphan minted manifest on build failure) usesexcept Exceptionwith no comment explaining what exceptions are expected or what would be missed. Unlike the annotatednoqa: BLE001handlers inaoe.py, this one carries no rationale. ASystemExitorKeyboardInterruptwould pass through (not swallowed), buttyper.Exit— which_build_stackraises for recoverable CLI errors — is caught, preventing the manifest orphan cleanup from running when_build_stackexits with code 0. -
Fix approach: Narrow to
except (Exception, typer.Exit)with explicit handling, or document intent with anoqacomment.
-
Location:
src/harnessed/svcstate.py:213,src/harnessed/svcstate.py:353,src/harnessed/svcstate.py:404 -
Impact: All three
subprocess.runcalls insvcstate.pyomittimeout=. A hung or unreachable podman daemon blocks the calling process indefinitely.launcher.pywraps podman calls in_bounded()which enforces_PODMAN_QUERY_TIMEOUT;svcstate.pycallssubprocess.rundirectly and has no such guard. -
Fix approach: Replace direct
subprocess.runwith_bounded()using_PODMAN_QUERY_TIMEOUT, matching the pattern used inlauncher.py.
-
Location:
src/harnessed/launcher.py:513 -
Impact: The module-level set
_SHARED_IMAGES_BUILTtracks which shared images have been built this process. Under--jobs > 1, images are correctly built once. But if a build fails partway and the image is left in a broken state, re-running in the same process (e.g., via test harness) would skip the rebuild because the set already contains the image tag. In production CLI use (one process per invocation) this is harmless; in tests that call into_build_shared_oncedirectly, it can mask test isolation failures. - Fix approach: Accept for production use; add a reset fixture or monkeypatch in tests that exercise the shared-image path.
-
Location:
src/harnessed/credmounts.py:274,src/harnessed/credmounts.py:293 -
Note: Both handlers carry
# noqa: BLE001but no inline explanation of what is expected to be caught. The equivalent handlers inaoe.pyexplain the "never fail a launch" rationale. Without a comment, a reader cannot tell whether the silent suppression is intentional for all exceptions or is missing anas excfor logging.
-
Location:
src/harnessed/launcher.py:2320,:2619,:3275,:4657,:4792 -
Note: The pattern
Path(path).resolve() if path else Path.cwd()appears four times as a correct, guarded fallback. Line 4657 omits the guard entirely (nopathparameter). Extracting the pattern to a helper would make future violations easier to spot.
-
Location:
src/harnessed/launchenv.py:179 -
Note:
_parse_plain_env_linestrips exactly one pair of surrounding quotes. Nested or escaped quotes (e.g.,KEY="val with \"inner\"") are not handled. This is unlikely in practice but is an undocumented limitation that could confuse users who author complex.envfiles.
-
Location:
src/harnessed/update.py,tests/test_update_*.py -
Note: Update tests (
test_update_pins.py,test_update_cooldown.py,test_update_release_selection.py) mockurllib.requestcalls. The suite never makes a live HTTPS request to the ghcr.io or PyPI registries, so a registry API change or auth regression would not be caught until a user hits it.
No TODO, FIXME, HACK, XXX, or WORKAROUND markers were found in src/, catalog/, tools/, or tests/. The deprecated markers found are all documentation notes about SSE transport being superseded by Streamable HTTP — enforced at build time in schema.py:1306 — not open work items.
-
svcstate.py's lifecycle dispatch lacks dedicated coverage —_service_refsis well covered via seven test files, but theup/down/recreate/syncpaths and their threesubprocess.runcallsites are not directly tested. -
podman buildandharnessed container-runpaths are structurally unreachable by the test suite (documented in CLAUDE.md);capability.py,volumes.py, and the build side oflauncher.pyhave coverage only for schema/assembly logic, not for live container behavior. -
Corporate proxy CA injection (
_service_dockerfile_with_ca) has no test — the function is only exercised if a cert file is present on the test host, which is never true in CI. -
aoe.py's live-binary path needsaoeon PATH, sotest_aoe_real.py(123 lines) skips in most CI environments. The module itself is not thinly tested:tests/test_aoe.pyis 1188 hermetic lines covering identity derivation, grouping, dedup and the detached write path. Only behavior that depends on a realaoebinary goes unverified in CI.
Start Here
Guides
- Recipe authoring
- Service authoring
- Stacks
- Extending stacks (proposed)
- Recipe catalog
- System prompt & rules (proposed)
- Secrets
- AWS SSO
- Pulumi (host login forwarding)
- Egress & exposing services
- Container filesystem
- Git hooks
- Troubleshooting
- Pin management (harnessed update)
Codebase Map
Planning & Roadmap
- open work: GitHub Issues
Research & Prompts
- research/ (home-folder requirements per harness, browse in-repo)
- prompts/ (reusable prompt templates, browse in-repo)