Commit Graph
480 Commits
Author SHA1 Message Date
Hermes f4f2c26de3 [grade=B urn:ump:35dpnggtxsqrxvlqm2d2buqkbnggw3acflbccnkqpqyiiijcxx3q] fix(DC-170): MCP truth batch — 6 dead tools fixed, full-catalog drift gate
Audit P0-5 + deploy_app truth (batch 5 of the 2026-10-27 sweep, AUDIT-2026-10-27.md committed here):

ROUTE ADDITIONS:
- routes/containers.js GET / — container list (dockerode listContainers);
  the router had NO list route, so dashcaddy_list_containers 404'd always
- routes/dns.js GET /records — record list via active provider with a
  list-records capability guard (501 + guidance for push-only providers
  like RFC2136); dashcaddy_list_dns called GET /dns, never existed

HANDLER FIXES (src/mcp/mcp-core.js):
- get_service resolves from GET /services by id/name (single-service GET
  never existed) with a known-ids 404
- check_health + diagnose -> /health/service/:id and /health/services
  (both previously hit nonexistent routes)
- container_action remove -> DELETE /containers/:id (was /:id/remove)
- system_health/system_metrics via apiCall error envelope (metrics text
  capped at 64KB)
- search_catalog applies category filter client-side (/catalog/search
  has no category param — constraint was silently dropped)
- generate_caddyfile defaults authService=status when auth:true (auth
  flag alone silently produced UNGATED Caddyfiles)
- deploy_app honest re-contract: registers service + generates
  Caddyfile, does NOT claim image pull/container creation/deployed:true;
  base domain read from /config (hardcoded owner .sami TLD removed);
  caddy-code failure now surfaces as caddyfileError + FAILED message
- list_fleet description gains Premium hint

VERIFIER (audit #40): EXPECTED table 12 -> 34 rows covering EVERY tool's
(method,path); NEW Layer-3 handler-derived test drives the real
createToolHandler for all 28 tools and strictly resolves every captured
call mount-aware (a vacuous first draft of this gate was caught and
fixed pre-grade); extractRoutes regex extended to apiRouter.get inline
decls; Bearer credential-passthrough test added (DC-162 coverage gap)
NEW TESTS: dns-records.routes.test.js (5 route-level cases incl. 501
capability behavior); deploy_app partial-failure + no-.sami tests

HOST RELIABILITY (same sweep, evidenced here): jest maxWorkers 50% —
default 5-worker runs repeatedly OOM-killed this host's gateway
(dmesg 2026-10-29 00:58:40; swap was 4G/4G full). Gateway protected
separately via systemd OOMScoreAdjust=-500 drop-in + /swapfile2 (host
ops, graded B urn:ump:35dpnggtxsqrxvlqm2d2buqkbnggw3acflbccnkqpqyiiijcxx3q).
DC-171 DNS provider-parity ticket (Sami, plug-in-directly) appended to
backlog.

Full suite: 173/173 suites, 3740/3740 tests. Judge B r1
(urn:ump:jsobkg2t2omzvpinel2fufk7sspoy3vubsrth3e6lat3ygolvffq) blockers
all fixed: dns.js 501 arg order (the file aliases error() message-first
— the sweep's 'reversed-arg' finding was a false positive for its 7
sites; lesson #14), deploy_app partial-failure honesty, handler-derived
verifier.
2026-10-29 01:30:42 -07:00
Hermes 8a6aed546d [grade=A urn:ump:5bm325dgncwgwsl2joztkf4br3wh5lh6jam3rn32fvyr62zyoysa] fix(auth): machine credentials (dk_ keys, JWTs) dead under TOTP — audit P0-1
With TOTP enabled, totpAuthMiddleware answered 401 before
jwtApiKeyAuthMiddleware ever ran: API keys and JWTs were rejected on
every TOTP-protected install (live-verified during the 2026-10-27
sweep with a freshly minted dk_ key getting 401 on /api/v1/mcp/info).
MCP-over-HTTP ('Connect your AI'), fleet endpoints and every machine
integration were broken in production.

Fix: the TOTP gate now verifies Bearer JWT then x-api-key itself
(try/catch, fall-through to the unchanged 401) and sets req.auth;
the JWT/API-key gate passes through on already-set machine auth
(no double verification). Session/public/TOTP-disabled paths
byte-identical.

New chain-level test (no req.auth injection — the gap that hid this
bug) boots the real configureMiddleware chain; VERIFIED it fails 2/5
with the fix stashed and passes 5/5 with it. Judge polish (call-count
assertion) noted as optional follow-up.

Full suite: 172/172 suites, 3731/3731 tests.
2026-10-28 00:35:20 -07:00
Hermes db99f2b54d [grade=A urn:ump:zmnws7b7c63n4sr4qr6collvmttg4ksuaju4z2ndhxo5lntczfbq] test(DC-168): update widget-contract sandbox for batch-2 widget contract
The contract test eval()s the real calendar-widget.js in a hand-rolled
sandbox; batch 2 (3a0f595) changed the contract the sandbox must provide:
- makeEl stubs gain classList (widget uses the class-based .show modal
  system now; style.display checks threw TypeError on old stubs)
- r14 modal trigger: classList.add('show') instead of display='flex'
- ErrorHandler stubs gain logError (catch path calls logError now)
- secureFetch stub provided before every widget eval (all widget API
  calls go through secureFetch now)
Post-grade polish under same URN: removed 4 leftover DBG console.log
lines (judge polish item; test-only, no assertion change).

File 9/9 green; full suite 172/172 suites, 3731/3731 tests.
2026-10-28 00:34:14 -07:00
Hermes 4339d430f6 [grade=A urn:ump:5clu4udrbwuwxn74tqwxtukfjnrwkrbiykp6uh66ipipzxr32xsq] Merge dc/DC-166-mcp-completion (e524d16): MCP 17->28 tools + workflows double-prefix fix
Resolves 0 conflicts (auto-merge; the branches touched disjoint regions
of src/mcp/mcp-core.js). Fixes audit P0-4 (DC-166 drift: the fix branch
was never merged, so the branch shipped 17 tools while changelog/
capabilities claimed the expanded set, and the workflows UI was broken)
and the production Workflows outage.

Incoming:
- src/mcp/mcp-core.js: 11 new tool handlers over existing routes
  (calendar events/add_source, security events/summary, license_status,
  capabilities, DNS add/remove record, deploy_recipe, run_workflow,
  tailscale_status); DC-162 machine-only gate preserved
- routes/workflows.js: double-prefix fix — declarations are mount-
  relative (/history before /:workflowId/history); the dashboard's
  single-prefix calls no longer 404 (Premium feature was dead in prod)
- __tests__/mcp/mcp-core-dc166{,-integration}.test.js: tool/schema +
  route-existence verifier (scoped to the 11 new tools; extension to
  all 28 is the MCP truth batch, audit #40)

Merge-commit fixes (judge r1 C -> r2 A, urn:ump:2jdpii43.../5clu4udr...):
1. integration-test header over-claimed COMPLETE tool coverage — scope
   narrowed to the DC-166 additions, stated explicitly
2. routes/workflows.js: shadowed top-level ok import removed (all uses
   inside the factory use deps.ok) + comment documenting the trap

Verified on merged tree: TOOLS.length=28, MCP+workflows 44/44.
Judge A — urn:ump:5clu4udrbwuwxn74tqwxtukfjnrwkrbiykp6uh66ipipzxr32xsq
2026-10-28 00:04:01 -07:00
Hermes 253a5fbf75 [grade=A urn:ump:3n5xljspojvc57x7isxi4busps2dxlpwuzivhntg44i3jkpiqfaa] test(DC-168): make calendar events fixture date-relative (was a time bomb)
The 'failing source degrades to perSource error' test hardcoded
DTSTART:20261007T100000Z. The /events route defaults to a
now-7d..now+30d window, so the fixture silently expired on 2026-10-14
and this was the single failing test in every full-suite run since.
Fixture now builds DTSTART for tomorrow UTC at runtime.

Verified: file suite 15/15; full suite 3704/3705 (this was the only
failure). Judge A — urn:ump:3n5xljspojvc57x7isxi4busps2dxlpwuzivhntg44i3jkpiqfaa
2026-10-27 23:49:40 -07:00
Hermes dbede032eb [pending-judge] feat(DC-168): calendar widget UX + theming — "No upcoming appointments" state, month grid with highlighted appointment days, theme-correct styling
Owner directives (2026-10-10/11, verbatim in brief): show "no upcoming
appointments" when empty; show a month calendar with days and times
highlighted when there are events; stylize to fit every theme; keep the
widget weather-widget-sized.

Changes (status/ frontend + tests):
- status/js/calendar-widget.js: rewritten render path — chip states ("No
  upcoming appointments" / next appointment with highlighted when-span),
  month grid modal (cal-grid + prev/next nav, appointment days highlighted,
  per-event time dots), upcoming list with day/time emphasis, month-following
  fetch with window-authoritative event merge (via calendar-cache.js),
  forced refresh on periodic tick + source mutations, local escapeHtml (was
  an undefined global).
- status/js/calendar-cache.js (new): uid+start-keyed event cache; fetched
  window is authoritative for entries starting inside it (deletions and
  reschedules propagate), entries outside survive. Dual export (module +
  window) for tests and browser bundle.
- status/build.js: calendar-cache.js bundled before calendar-widget.js.
- status/css/dashboard.css: DC-168 block — chip states, month grid, day
  highlight states, dots, list/source rows, universal light-bg contrast
  rules (color-mix; WCAG >= 4.5:1 verified for all 10 builtin themes, worst
  4.60:1 ocean) + light-surface rules.

Tests: 20 total in __tests__/calendar — 9 in caldav-default-ns (extraction
incl. mixed docs, empty multistatus, namespace-aware fixture validation,
undeclared-prefix rejection both quote styles, positive declared-attr),
5 in dc168-cache-contract (merge, duplicate suppression, recurring uid+start,
window-authoritative removal on refetch, cross-window survival, ended-
exclusion), 6 in dc168-widget-contract (navigation fetch windows, forced-
refresh semantics, cache+widget integration, interval coverage). Existing
suites pass unmodified; eslint 0 errors on touched files.
2026-10-12 01:07:53 -07:00
Hermes 613bfeda71 [pending-judge] fix(DC-167): CalDAV multistatus default-ns parsing (Radicale silent zero-events) + scope-aware fixture ns validation
extractCalendarsAndEvents required a namespace prefix on <response>; Radicale
emits bare <response> (default DAV ns) so every entry was silently dropped —
REPORT 200, ok:true, 0 events, no error. Prefix is now optional in the split
and detection regexes.

Tests: 9 in the ns suite (extraction incl. mixed doc; empty multistatus;
namespace-aware fixture parse; undeclared element+attribute prefix rejection;
both quote styles; positive declared-attr case). Calendar-related suites: 52.
eslint clean.
2026-10-11 23:10:30 -07:00
Hermes e524d1663d [pending-judge] feat(DC-166 r2): MCP tool-set expansion + workflows double-prefix route fix (17 -> 28 tools)
Owner directive "Do it" (2026-10-09): expand the MCP tool set so the
"manage your entire infrastructure" claim is true of the product. 11 new
tools over EXISTING routes: calendar (events/add_source), security
(events/summary), license_status, capabilities, DNS add/remove record,
deploy_recipe, run_workflow, tailscale_status. Handlers verified against
the actual route declarations; credential TYPE passthrough and the DC-162
machine-only tools/call gate unchanged (tests included).

judge r1 (grade C, urn:ump:fyvivcvrphjm5wk227ujr2yzfcgcdvwekjmw6lvnqvjosqrjhtbq)
blocking issues — all fixed in this revision:
1. WORKFLOWS DOUBLE-PREFIX (real product bug the judge caught):
   routes/workflows.js declared literal '/workflows/...' paths while
   src/app.js mounts the router at /workflows — composed path was
   /api/v1/workflows/workflows/..., which the SHIPPED dashboard bundle
   (status/js/bundled-workflows.js calls single-prefix /api/v1/workflows/)
   never hits: the workflows UI has been broken in production. Fixed by
   making route paths RELATIVE to the mount (same class as the recipes
   fix); run-workflow MCP path now matches. Also reordered /history
   before /:workflowId/history so the literal segment is not captured as
   an id (limit 100 vs 50 asserted in tests).
2. Verifier substring check replaced: NEW integration suite
   (__tests__/mcp/mcp-core-dc166-integration.test.js) resolves EVERY MCP
   tool call's complete mounted (method, path) against the declared route
   patterns extracted from the owning route file (params matched as
   patterns, comments excluded) — a double prefix or wrong method fails
   the run. Plus real-composition dispatch through the actual workflows
   router: POST /api/v1/workflows/:id/run reaches the run handler
   (sentinel '"ran":true'), list/history handlers land correctly, and a
   static guard fails any route file that re-declares its own mount name.
3. Both verbatim-command claims in the brief now name their file.

polish applied: calendar window-math test bounds tightened to exactly
~7 days (was a weak 6-hour lower bound); extra blank line before
tools/list removed; calendar_add_source schema gained the token property
the route already accepts (schema now matches the documented API).

Tests: 73 prior + 15 dc166 unit + 6 integration = 94 MCP tests green;
full suite 6 failed + 3697 passed == 3703 total (known-red billing
family, band-guarded; base-proof shows the same 6 red at a1b8fa3).
eslint: 0 errors on touched files (warnings count unchanged vs base).
2026-10-09 20:18:42 -07:00
Hermes 30e8055536 [pending-judge] feat(DC-165 rev5): product/site uniformity — fleet gate proven at composition root, single-source capabilities manifest
Site-vs-product audit (2026-10-09, owner decisions: "advertise as Premium"
and "It should be LLM readable") reconciles the entitlement triangle:
marketing copy <-> PREMIUM_FEATURES <-> license-server grant list.
(Submitter naming: this is judge round 5 for artifact dashcaddy-dc165-code;
"rev5" is the source revision label — one revision per graded round.)

r4 judge blockers addressed:
- B0 (hygiene glob + deterministic patch discovery): verifier now scans
  "$d"/*PATCH.diff and *.md/*.sh GLOBS instead of enumerated name lists —
  the judge worktree's 4_PATCH.diff (any index) is found by shape; PATCH
  hash discovery likewise globs OUT_DIR/SELF_DIR with NO hardcoded
  /root/dc165-judge fallback (B2). Fresh pass + fail-closed transcripts
  regenerated from the exact submitted bundle (attached).
- B1 (derivation honesty): openapi.yaml + capabilities.js header now split
  the SIX MEASURED fields (version, templates count/categories, tools,
  transport triple, premium list, language count — each read at request
  time from the runtime module) from the STATIC metadata fields (product,
  description, restMount, endpoint — registration facts visible in app.js,
  labeled as such). The no-drift claim attaches only to the measured set.
- B2: external hardcoded fallbacks removed (above).
- P0: revision labels synchronized (this paragraph).
- P1: fleet wiring grep asserts the EXACT literal requirePremium('fleet')
  mount, not any requirePremium occurrence.

Carried from rev2 (r1 blockers — unchanged content): real-composition-root
fleet gate e2e (4 tests: no-activation 403 envelope contract, premium-without-
fleet 403 per-feature, with-fleet gate cleared, prefix inheritance across
hosts/status/deploy); MCP_RUNTIME single-source in routes/mcp.js (transport
literal occurs exactly once in the repo, read by both /info and
capabilities; unit test asserts manifest === MCP_RUNTIME); OpenAPI 200-only
public contract; APPEND-ONLY offline feature migration (legacy entries
preserved; load() complexity extracted into _migrateOfflineFeatureSnapshot,
lint-clean); eslint rc hard-gated on a FRESH per-run capture incl.
middleware.js.

Product behavior: 'fleet' + 'workflows' + 'auto-backup' in PREMIUM_FEATURES
(descriptions source-quoted: bundled-workflows ids; /backups/schedule
schema fields); requirePremium('fleet') mounted at the /fleet ROUTER prefix
BEFORE fleetRoutes; GET /api/v1/capabilities public machine-readable ground
truth (PUBLIC_ROUTES exact GET + drift-test directMount + openapi doc);
offline-only forward-migration (online activations untouched — server
authoritative across the network boundary).

Diff: 9 files vs 4143bff (exact stats in EVIDENCE header).
Tests: 9 dc165 + 4 fleet-e2e + 76 license-manager + 21 tier + 14 drift =
124 targeted green; 50 MCP route tests re-verified green after the
MCP_RUNTIME refactor (77 combined on the focused rerun).
2026-10-09 02:56:41 -07:00
Hermes ec038df111 [pending-judge] feat(DC-164 rev5): operator env overrides — fd-pinned contract, no-blocking opens, fail-loud wiring, untracked license material
Feature: /etc/dashcaddy/operator.env (root-owned KEY=VALUE file) is
forwarded into the DashCaddy container as docker -e flags by start.sh.
Canonical flag: ALLOW_LIFETIME_LICENSE=true on the CREATOR host only.
This is a client-side rail, NOT the security boundary: lifetime codes
must HMAC-verify against the creator-only signing secret, which is never
shipped to customers (installs carry only .license-secret-hash; the
license server never issues lifetime codes). Flipping the flag on a
customer host grants nothing. Missing file = normal case (zero flags).

Design (per judge blockers):
1. scripts/operator-flags.js — Node, ONE pinned file descriptor:
   lstat pre-check (reject FIFO/device/dir BEFORE any open that could
   block: r5 DoS blocker) then open(O_RDONLY|O_NOFOLLOW|O_NONBLOCK),
   fstat, read from the SAME fd (r3 TOCTOU blocker closed; O_NONBLOCK
   makes even an adversarial race on a FIFO non-blocking). Contract:
   regular file; no group/other access bits; no setuid/setgid/sticky;
   owner uid 0 under root runtime (owner==euid otherwise). Symlink
   refused at open even when the target would pass all checks.
   Violation => stderr FATAL + exit 3. Content is pure data: never
   sourced/evaled/executed; $(...) values stay inert text (tested).
2. start.sh: rc 3 => warn + forward NOTHING (fail closed); ANY other
   non-zero rc => ABORT startup (fail loud, r4 blocker; tested via
   missing-checker simulation); missing file => silent zero overrides.
   Single helper invocation; keys-only audit line at boot (no values).
3. Artifact hygiene (r3/r5): verifier section [8] EXECUTES a scan of
   the judge-dir + evidence-dir for full-format license codes and FAILS
   if no PATCH.diff is present at all (no vacuous pass); indexed
   0_/1_/2_/3_ names recognized. (An earlier round leaked one code; it
   is dead — signing secret rotated, keygen verify reports INVALID.)

Root-cause hardening (2026-10-08 incident: deploy checkouts overwriting
git-TRACKED runtime state revoked the owner's premium and hid service
cards):
- untrack dashcaddy-api/data/services.json AND add an explicit
  .gitignore entry for it (r5: untrack alone leaves accidental
  re-add possible)
- untrack dashcaddy-api/.license-secret + .license-counter, extend
  .gitignore. The secret's old value in git history is already rotated,
  hence cryptographically dead.

Tests: 17 executed operator-flags tests — incl. FIFO regression (mkfifo,
no writer, hard 2s timeout, expect immediate rc 3), O_NOFOLLOW
symlink-to-valid-target, 0644/0755/setuid/directory/foreign-owner/usage
rejections, missing-file-silent, injection-inert, full translation suite;
license-manager 76 + tier-enforcement 21 untouched => 114 targeted green.
2026-10-08 23:25:41 -07:00
Hermes 14160f9317 [grade=B] fix(DC-163 rev2): strict merge semantics, contract-proving settings/test, valid enginecheck fixture
Judge r1 (C) blockers B1-B3 + polish both applied — see body of rev1 commit for feature scope.

urn:ump:l2tg66wmchkmd6fde4k3ojwc56zpxqh657spe37bu6dpvduswalq
2026-10-08 15:04:56 -07:00
Hermes e80e3273b7 [pending-judge] feat(DC-163): AI assistant that works — LLM intent engine + fixed chat panel
The floating assistant was broken end-to-end; Sami said "Do it that works".
Three user-visible bugs fixed + the promised LLM delegation implemented:

FRONTEND (status/js/ai-chat.js — rewritten):
- Response parsing: old code read data.data; the API returns the FLAT ok()
  envelope — EVERY reply rendered "Sorry, something went wrong". Now reads
  the real shape (contract asserted by route test).
- Suggestion chips: onclick="...send('"Deploy Plex"')" — nested quotes,
  invalid JS, dead buttons (shipped like this). Now data-driven buttons with
  addEventListener.
- Deploy button: called window.openAppSelector which NEVER existed anywhere
  in the tree (grep-verified). Now opens the REAL deploy modal via new
  window.openDeployConfigFor(templateId) exported by app-selector.js —
  resolves against the live API template cache, reuses showDeployConfig
  (same path a manual catalog click takes). Widgets route to the grid.
- Conversation history (last 6 turns) now rides along per request, engine
  badge in header, ⚙ settings sub-panel (baseUrl/model/API key + Test +
  Remove), all server text via textContent (no HTML injection), CSP-safe
  (no inline handlers).

BACKEND (routes/ai-intent.js):
- TWO engines, one contract. LLM classifier (OpenAI-compatible chat
  completions) with system prompt embedding the LIVE 78-app catalog + the
  six wizard categories; regex patterns kept as the zero-config default and
  the automatic failover (HTTP error, timeout via AbortController,
  unparseable output -> pattern answers; response carries engine +
  llmError so the UI can say which served — no silent degradation).
- Closed-vocabulary schema validation: intent MUST be in the known set else
  'unknown'; appId MUST exist in APP_TEMPLATES else nulled (hallucinated
  ids cannot leak into deploy plans); categories filtered to the wizard's
  real keys; reply stripped of control chars + bounded to 600; history
  role-filtered (only user/assistant pass — client-injected system turns
  dropped) + capped; input capped to 1000 chars.
- enrich() rebuilds the response contract per intent; pattern-canned
  response is dropped when the LLM rerouted the intent (no stale shape);
  deployPlan body.port now fills from the template's defaultPort (was
  hardcoded null); deployPlan shape asserted against wizard usage.
- Key storage: PUT /ai/settings stores {baseUrl,model,apiKey} in the
  ENCRYPTED credential store (key 'ai:llm') via ctx.credentialManager —
  NOT config.json (GET /config echoes the raw file to the browser; that
  route's shape was verified before this decision). Blank apiKey on PUT
  keeps the stored one. GET /ai/settings reports configured/source/model/
  hasApiKey — the key value NEVER crosses the wire (asserted). Env
  fallback AI_LLM_BASE_URL/AI_LLM_API_KEY/AI_LLM_MODEL + legacy
  LLM_PROXY_URL for headless installs. POST /ai/settings/test = one-shot
  real classify probe returning ok/sample or ok:false/reason (never
  throws). DELETE clears.
- GET /ai/capabilities now reports engine + llm status (pattern was honest
  marketing before; now it can be true).

MOUNT (src/app.js): aiIntentRoutes receives siteConfig, log, fetchImpl
(ctx.fetchT — test-injectable) and credentialManager.

Docs: OpenAPI +4 AI path entries (intent, capabilities, settings, settings/test); CHANGELOG entry; dist bundle rebuilt
(openDeployConfigFor present in features.js; SW cache c62511c40d).

Tests: 20 NEW in __tests__/routes/ai-intent-engine.test.js (engine
selection w/ and w/o store, off-catalog phrasing via mock LLM,
hallucinated-id nulling, illegal intent coercion, HTTP-500 failover,
AbortError timeout failover, markdown-fence repair, reply sanitization,
history cap+role filter, env config path, intent-disagreement rebuild w/
real jellyfin port 8096, flat envelope contract, 400s, 1000-char cap,
settings GET/PUT/DELETE/test incl. key-never-echoed assertions,
capabilities engine reporting) + the 18 original pattern tests unchanged +
composition-root e2e 8 pass. Full suite: 3643 passed; only the pre-existing
pdf-parse billing family red (6 failed in documented band [5,7], patch
touches no billing file).
2026-10-08 14:42:31 -07:00
Hermes 73fde1e2a8 [grade=B] fix(DC-162 rev3): presence-based id detection, null-params rejection, boundary matrix
Judge r2 (grade C) — all 3 blockers + both polish items:

1. REQUEST-vs-NOTIFICATION by PRESENCE, never truthiness: validateJsonRpc
   uses hasOwnProperty('id'); id 0 and id '' are VALID request ids echoed
   back BY VALUE (strict-equality tested), id:null treated as a request
   under the documented error-id convention. mcp-core default branch fixed
   the same way (`if (id)` → hasOwnProperty — id 0 / '' unknown-method now
   answer -32601 with the id echoed instead of being swallowed as falsy).
   Routes' malformed-notification silence path also switched to
   presence-based detection (id:null + bad params → 400 envelope, not 204).

2. params:null REJECTED (-32600): contract is object-or-omitted ONLY
   (strict JSON-RPC; the old code's m.params !== null guard contradicted
   the documented contract). Boundary tests pin the policy.

3. Unknown-method boundary tests: id 0 → -32601 id:0, id '' → -32601 id:'',
   id null → -32601 id:null — asserted at BOTH layer levels (route).

Polish:
- 16-case TABLE-DRIVEN boundary matrix covering every allowed/rejected
  id/params combination incl. 202 vs 204 notification split.
- Verifier now probes writable /tmp up front (exit 73 + clear message if
  unavailable; documented requirement) instead of dying at mktemp.
- Verifier target count 57 → 73 (DC-162 suites) with the boundary table
  named in the assertion label.

Full DC-162 suite: 73 passed (route 50 + core 23). No transport/credential
semantics changed from rev2.

urn:ump:or2qqhcytp6lfzlyi7xru7hdqy3uar2hbjllsrrbxrbray3c5kpa
2026-10-08 04:02:26 -07:00
Hermes c9015b59ad [pending-judge] feat(DC-162 rev2): "Connect your AI" — spec Streamable HTTP MCP + one-click keys
Judge r1 (grade D) blockers, each fixed and tested:

1. TRANSPORT: custom POST-only JSON-RPC → MCP 2025-03-10 Streamable HTTP
   (spec-canonical; replaced HTTP+SSE). POST answers application/json for
   requests; valid notifications -> 202 empty; malformed notifications ->
   no reply (204); batching removed in this revision -> arrays rejected
   -32600. GET (server->client stream) and DELETE (session termination)
   answer 405 + Allow: POST — the spec's explicit allowance for stateless
   request/response servers; documented in /info + modal + OpenAPI.
   Origin header validated when present (DNS-rebinding MUST); Accept
   negotiation (json required, else 406); MCP-Protocol-Version header
   checked when sent. Clients needing server-initiated streams use the
   stdio bridge (unchanged, shares mcp-core).

2. CREDENTIAL TYPE PRESERVATION: routes/mcp.js now forwards the SAME
   scheme the caller authenticated with (req.auth.type from
   middleware.js:549-586): apikey -> x-api-key, jwt -> Authorization
   Bearer (NOT dk_-coerced-x-api-key as r1 did). mcp-core createToolHandler
   accepts explicit headers. Tests assert BOTH shapes downstream
   (apikey carries x-api-key & no Authorization; jwt carries Bearer & no
   x-api-key; zero downstream calls for session denial).

3. JSON-RPC VALIDATION: validateJsonRpc — jsonrpc:'2.0', non-empty string
   method, params object-or-omitted, id string|number|null. Invalid
   Request -32600 (empty body, empty array, batch); tools/call without
   string params.name -> -32602; unknown method -> -32601; error envelopes
   carry id null when unpairable. Transport primitives rejected by the
   app-wide strict JSON parser (400; asserted).

4. REPRODUCIBILITY: status/dist/features.js + sw.js regenerated and
   committed IN THE PATCH (repo convention: DC-130/131 committed bundle
   rebuilds). Verifier greps the built bundle for aiconn- (23),
   mcp/connections (1), httpConfig (2) so a clean `git am` checkout serves
   the real frontend.

Judge r1 polish, all applied:
- verifier accepts 0_PATCH.diff / PATCH.diff naming (indexed artifact);
- connections list filtered server-side to "AI connection (...)" keys
  (new GET /mcp/connections, session-only; modal switched to it);
- URL-encoded tool path params (serviceId, containerId, action,
  templateId, category, zone) in mcp-core.

Config shape: POST /mcp/config (session-only; apikey 403) returns the
standard Streamable-HTTP card {url, transport: streamable-http, headers:
{x-api-key}, mcpProtocolVersion} + per-client note (ChatGPT note states
the public-https requirement honestly; no fabricated connector claims).

Tests: 57 green (34 route incl. auth matrix/type-preservation/transport
rules/JSON-RPC errors + 23 core). Composition-root e2e (8) boots the real
createApp with the mount. eslint 0 errors. Full suite: only the
pre-existing pdf-parse billing family red (unchanged since base 470dfaa).
2026-10-08 03:46:56 -07:00
Hermes f64a3cda7d [pending-judge] fix(DC-161 r4): address judge r3 blockers
All three r3 blocking issues fixed + polish applied:

- Radicale provision route now FAILS CLOSED (409) unless the target container
  is present, inspectable, and its image matches /radicale/i. Missing
  containerId, failed inspect, or non-Radicale image → nothing is written to
  the shared config and no source/credential is registered. 4 new tests cover
  the three refusal paths + the verified-image happy path.
- ICS feed fetch now streams with a hard 5 MiB body cap (same bound as the
  CalDAV path) via readBodyCapped(); oversized feeds reject mid-stream and
  degrade to per-source error. Test covers a >5 MiB feed end-to-end.
- Verifier mode separation: `--verify` runs the same checks fully read-only
  (all output under mktemp -d in /tmp, transcript printed to stdout, scratch
  removed on exit — proven rc=0 with zero repo/tmp-side writes); default
  transcript mode is explicitly declared a TRANSCRIPT GENERATOR in its header
  and writes only under the script's own directory.
- Full-suite count assertions replaced with the documented invariant
  (failed ∈ [5,7], failing set == known-flaky billing suite, extras pass
  isolated rerun) — judge r3 polish.
- Stale credential-key comment in radicale-provisioner.js header corrected.

Calendar suites: 43 passed (38 + 5 new). Perf note: readBodyCapped streams;
no full-buffer read of unbounded bodies on the ICS path anymore.
2026-10-07 20:59:17 -07:00
Hermes eb8de990df [pending-judge] fix(DC-161 r3): address judge r2 blockers
All three r2 blocking issues fixed + polish applied:

- useExisting (adopted) Radicale containers no longer get a source registered
  with credentials the operator never provisioned. Registration happens ONLY
  when pre-start provisioning succeeded; adopted deployments get a
  calendarHint in the deploy response pointing at the manual-wiring modal.
- Weekly BYDAY expansion: candidates earlier than DTSTART are skipped (they
  do not consume COUNT); window inclusion now uses interval-overlap
  semantics (occurrence span vs window span) for both recurring and
  non-recurring events. Three new tests cover midweek DTSTART, a straddling
  multi-day event, and a boundary-exactly-ending event.
- Verifier is now read-only on the graded tree: no stash/checkout/rewrite.
  Base proof runs in a temporary git worktree of 448f535 under /tmp (removed
  on exit); the flaky pdf-parse suite is proven pre-existing via "red at
  base" + "patch touches no billing file" (empty diff), and a race-flaky
  suite (DC-116, witnessed once under parallel load) is given one isolated
  rerun which must pass.

Polish: PUT /sources normalizes the user field (and clamps name) like POST.

Calendar suites: 38 passed (35 + 3 new recurrence tests). The 3558/3564
full-suite numbers vary by one flaky pdf-parse member between runs; the
evidence now asserts the invariant (suite red at base, no billing file in
the patch, flaky suites green on isolated rerun) instead of an exact count.
2026-10-07 20:44:07 -07:00
Hermes 0b3a03a4c2 [pending-judge] fix(DC-161 r2): address judge r1 blockers
All five r1 blocking issues fixed + polish items applied:

- Unified credential-key convention: registerAutoWiredSource now stores at
  calendar:source:<source.id> — the same key the events fetcher resolves —
  so auto-wired sources authenticate on first fetch (was calendar:radicale:
  <subdomain>, fetched key never written = empty-password CalDAV auth).
- calendarStateManager is now passed INTO assembleContext(...) (the r1 patch
  only extended the function signature, so ctx.calendarStateManager was
  undefined and the deploy hook silently skipped auto-wiring).
- Radicale config is provisioned BEFORE container start (Radicale reads its
  config at startup): the deploy hook writes config+htpasswd ahead of
  deployContainer() and passes the pre-start credentials to the post-deploy
  registration step; useExisting path logs an explicit restart warning.
- PUT /sources/:id now validates URL updates through the same shared
  validateSourceUrl() used by POST (protocol + remote-plaintext rules).
- New end-to-end contract test (calendar-autowire.e2e.test.js): spins a real
  HTTP CalDAV server, registers an auto-wired source, then fetches events
  through the API — the server verifies Basic auth against the provisioned
  password, so a credential-key or wiring regression fails the suite.

Polish: provisioning is idempotent (deterministic source id, update instead
of duplicate), unbiased rejection-sampling for password/salt generation,
writeRadicaleConfig docstring no longer claims idempotence.

Calendar suites: 35 passed (32 prior + 3 new). Lint: 0 errors; complexity
warnings in deploy.js pre-exist at base (61 vs 68 now — the hook did not
worsen the trend line materially; calendar files themselves lint clean).
2026-10-07 20:14:17 -07:00
Hermes 74e21c1edc [pending-judge] feat(DC-161): calendar widget + Radicale auto-wiring
- Top-bar calendar widget (status/js/calendar-widget.js): next-appointment
  display, settings modal with CalDAV/ICS source management and a
  Test-connection probe. Follows the weather-widget pattern.
- Backend routes/calendar.js: sources CRUD (secrets in credential manager,
  never in responses), aggregated events across sources with per-source
  error isolation, Radicale provision endpoint, CalDAV discover probe.
- src/calendar/ics-parser.js: dependency-free RFC 5545 parser with bounded
  RRULE expansion (DAILY/WEEKLY-BYDAY/MONTHLY/YEARLY, COUNT/UNTIL/INTERVAL,
  EXDATE consumes COUNT, RECURRENCE-ID overrides), 500-event cap.
- src/calendar/caldav-client.js: CalDAV REPORT time-range queries over
  node:https (no new deps), HTTPS-enforced off localhost, 5MiB response cap.
- src/calendar/radicale-provisioner.js: zero-config auto-wiring - generates
  a 24-char password, writes Radicale htpasswd config (pure-Node APR1 hash
  verified byte-for-byte against openssl passwd -apr1 vectors), stores
  credentials, registers the source. Deploy hook in routes/apps/deploy.js
  wires any Radicale deployed via the App Selector automatically.
- Radicale app template (tomsquest/docker-radicale) in the catalog.
- Tests: 32 new (parser unit, provisioner unit incl. openssl vectors,
  route tests). Full suite 3552 passed; only pre-existing pdf-parse
  billing/invoice failures remain (proven red at base 448f535).
- OpenAPI: 5 calendar paths documented. CHANGELOG entry added.
2026-10-07 19:57:22 -07:00
Hermes 448f5358bf [pending-judge] release: v1.17.0 - version bump 1.16.0 -> 1.17.0 + changelog for the integrated catalog pipeline (DC-160, DC-CATALOG-3) 2026-10-07 08:48:45 -07:00
Hermes 026437035d [pending-judge] fix(r5): exercise the boot-timeout kill, total bridge-body handling, strict subdomain labels (judge r4 blockers)
- __tests__/e2e-node/composition-root.e2e.test.js: `boot()` takes {timeoutMs, code}
  and the timeout rejection carries the child it killed; a NEW test drives the real
  timeout against a child that never reports PORT/READY and asserts the OS-observed
  SIGKILL on that child (marker e2e-timeout-kill) — the r4 claim is now exercised.
- routes/deploys.js: bridge() coerces any non-object JSON body (null/[]/string) into
  the same failure shape as a non-JSON body, so no `body.ok` deref can 500 or report a
  false success; the subdomain label regex rejects leading AND trailing hyphens.
- __tests__/routes/deploys.catalog.r4.test.js: trailing-dash rejection case + three
  malformed-successful-body cases (clean 502, never 500).
2026-10-07 08:31:14 -07:00
Hermes Agent 88c9a3e4b6 [pending-judge] fix(r4/polish1): server-assigned port — no freePort release-rebind race
The e2e child now calls app.listen(0) and reports the OS-assigned port on
stdout (PORT:<n>); the parent reads it. The probe-then-release helper is
deleted, so no other process can take the port between probe and bind.
2026-10-07 04:23:00 -07:00
Hermes Agent 5cf5dac281 [pending-judge] fix(r4): audit contract, subdomain forwarding, timeout kill (judge r3 blockers)
BLOCK0: catalog deploy audit now uses the REAL AuditLogger contract
(auditLogger.log({action,resource,details,outcome,ip})) fire-and-forget
via Promise.resolve().catch — async audit failures can never fail the
deploy response (tested with a throwing audit backend).
BLOCK1: verify.sh targeted-jest block captures jest exit code explicitly
(set +e / rc / loud FAIL) — no silent termination under set -e.
BLOCK2: subdomain advertised by the App Selector modal is now FORWARDED
end-to-end (selector -> /deploys/catalog/deploy validated charset ->
bridge --subdomain -> CLI CatalogInstallOptions, implemented in
dc-catalog-2 r3); invalid subdomains 400 before the bridge (4 cases).
POLISH: boot-timeout SIGKILLs the child (no leaked process).
New r4 suite: 7 tests (audit shape success/failure, subdomain forward +
4 rejections). Full suite 157 suites / 3519 tests green.
2026-10-07 03:59:30 -07:00
Hermes Agent 5bd5345469 [pending-judge] test(e2e): authenticated composition-root probes (r2 C blockers)
Judge r2 blockers addressed:
- MOUNTED vs UNKNOWN: probes now carry a REAL JWT minted by the same
  authManager the app wires (sub claim; generated in the boot child,
  emitted on READY). Every mounted-route assertion is compared against a
  live notFoundHandler-404 baseline for a known-nonexistent route on the
  same instance — a fall-through can no longer pass as mounted.
- Route-level behavior asserted with real payloads: /catalog/plex 200
  must contain plexinc/pms-docker AND {{PORT}}:32400; /security/shield 200
  must be success:true.
- OS-assigned ephemeral port (net server listen(0)) replaces the random
  30000-49999 guess; boot-timeout cleared on readiness; SIGTERM+SIGKILL
  shutdown with bounded wait.
- 7 tests (was 5). Suite: 156 suites / 3512 tests green.
2026-10-07 03:09:14 -07:00
Hermes Agent 0704676741 [pending-judge] feat(deploys): catalog deploy via shipdeck bridge (DC-CATALOG-3)
GET /deploys/catalog/apps -> bridge /api/catalog/apps (73 embedded apps,
single source of truth). POST /deploys/catalog/deploy {app,port,env} ->
validated (service-id charset, port 1024-65535, env name/value rules) then
proxied to bridge /api/catalog/deploy which runs the shipdeck CLI catalog
deploy (OCI image -> hardened systemd service; NO Docker daemon). Audited
as deploy.catalog with ok/seconds. 11 table-driven route tests incl.
validation rejections never reaching the bridge + bridge-failure 502 shape.
App Selector submit rewired from /apps/deploy (Docker chain) to
/deploys/catalog/deploy — same modal, same fields (port, mediaPath, plex
claim token as env), no new UI screens. Full suite 3510/3510 (156 suites).
2026-10-07 02:08:32 -07:00
Hermes Agent 8744609887 [pending-judge] fix(integration): catalog detail reads app.docker.* (DC-160); Shield committed; composition-root e2e
- DC-160: /catalog/:appId read app.image/ports/env/volumes which live under
  app.docker.* — every detail response was empty. Now reads docker.* and
  surfaces defaultPort/subdomain/healthCheck/mediaMount/claimToken/difficulty/
  setupInstructions for the deploy form. List/search use the templates own
  category field (old hand-rolled CATEGORY_MAP mis-categorized apps).
- Shield (routes/shield.js + 5-line app.js mount) committed to source after
  weeks as prod-only drift; regression test asserts the mount exists.
- New composition-root e2e suite: boots REAL createApp() on an ephemeral
  port, probes the historically-broken routes through the REAL mount table
  (wizard wiring, shield, catalog detail, deploys bridge) — the class of bug
  all 3 P7 dogfood findings belonged to. 5 tests.
- Full suite 3499/3499 (155 suites); table-driven DC-160 test covers all 73
  image templates.
2026-10-07 00:58:03 -07:00
Hermes Agent c430e02117 [grade=B urn:ump:bbfbsfru4nizg75wcxum7mwzhie6txhr22hw6jvz36wiihmgzmlq] P7 people store: dedupe upsert by providerUserId
CI / Test & Lint (pull_request) Canceled after 0s
CI / Security audit (pull_request) Canceled after 0s
Dogfood finding #3: upsertPerson resolved existing records by id only.
The wizard upserts a bootstrap admin AFTER a provider sync has already
created a person for the same Tailscale user (no id passed), so the same
providerUserId was duplicated into two records. Resolve existing by
providerUserId when no id is given; bootstrap Admin group + protectedAt are
preserved on the merge. New regression test; full suite 3414/3414.
2026-10-04 03:12:23 -07:00
Hermes Agent 5b3e637423 [grade=B urn:ump:mao7vadnesmquhmgr4oeg554edt6fn3ykxyiydtfs2psoekd4s7q] P7 tailscale provider: wire coord client via ctx delegation
CI / Test & Lint (pull_request) Canceled after 0s
CI / Security audit (pull_request) Canceled after 0s
Dogfood finding #2: createTailscaleProvider() built with coordClient=null;
nothing in prod ever called attachCoordClient() (the wiring the provider
docblock promised never landed), so wizard credential validation always
failed not_configured even with a valid stored token. Pass a delegating
proxy that fetches a fresh coord client per call via the sanctioned
ctx.tailscaleCoord.getClient pattern (token re-read from credentialManager
each call). Full suite 3413/3413.
2026-10-04 02:51:18 -07:00
Hermes Agent f7d6fe4a8a [grade=B urn:ump:2swys44kxvulm5flu4skibjq3yfvtnzrsbgkvm2g65ht55i4jtoa] P7 wizard prod wiring: pass provider instances (dogfood finding)
CI / Test & Lint (pull_request) Canceled after 0s
CI / Security audit (pull_request) Canceled after 0s
The /network/wizard mount in app.js omitted providers, so the wizard built
with providers={} and every mode selection returned 503 provider_unavailable
in production. Unit tests never caught it because they inject their own
provider map. Pass built tailscale + wireguard instances.

Full suite: 3413/3413 (152 suites).
2026-10-04 02:41:31 -07:00
sami7777 e04787477a P7 Private Network [grade=A] (PR #1)
CI / Test & Lint (push) Canceled after 0s
CI / Security audit (push) Canceled after 0s
Judge A r18 urn:ump:rgxdivsp2xf6zy5lsdoclvdgb7cuqd3qpwlszt2p7fu7xwa3zkkq. 3,399/3,399 tests.
2026-10-04 11:04:23 +02:00
Hermes 75a0385c38 P7 r10: probes assert expected head + every outcome (nonzero exit on mismatch); phase-2 rejection-path cleanup guaranteed
CI / Test & Lint (pull_request) Canceled after 0s
CI / Security audit (pull_request) Canceled after 0s
2026-10-04 00:07:56 -07:00
Hermes 51ba85fc69 P7 r9: probes isolated (DATA_DIR tmp), self-authenticating (git stamp + asserts), try/finally cleanup, explicit exit 2026-10-03 23:47:43 -07:00
Hermes af0d6b2fe5 P7 live probes: real-HTTP transcripts for forward_auth (inactive 503; active: allow/deny/unknown-device/step-up) via seeded real stores + registry stub provider 2026-10-03 23:39:01 -07:00
Hermes 2e651bd84e P7 r8 fixes: lazy mounts catch ProviderNotActiveError (503 not 500), wg redeem added to PUBLIC_ROUTES (redemption is sessionless), live-curl probe script 2026-10-03 23:34:00 -07:00
Hermes d4973f3af3 P7 r8 fix: forward_auth trust boundary (XFF/XFH honored only from trusted proxy; direct/spoofed requests use socket identity) + adversarial tests 2026-10-03 23:25:23 -07:00
Hermes 1e606bf0f3 P7 r3 fix: single-preview contract (syncAccess delegates drift-check+preview+push to pushIfNoDrift; acl_preview_failed mapped non-retryable) + test updates 2026-10-03 22:55:22 -07:00
Hermes d2d0d73477 P7 r2 fixes: drift guard wired through pushIfNoDrift (acl_drift_detected ProviderError, never overwrites drifted remote) + unknown-device forward_auth audit + drift regression tests 2026-10-03 22:47:27 -07:00
Hermes a5ef5b345e merge dc/DC-153 into p7-wave1 2026-10-03 22:34:32 -07:00
Hermes 44567031eb DC-153: provider.syncAccess enforcement wiring (tailscale ACL push + wireguard nftables apply) + contract tests 2026-10-03 22:34:02 -07:00
Hermes aac2343df3 DC-154: forward_auth enforcement endpoint (whois + access map + sensitive step-up) + tests 2026-10-03 22:30:23 -07:00
Hermes 88f7600693 P7: mount public WG invite redemption route (lazy provider, 503 when not wireguard) 2026-10-03 22:08:52 -07:00
Hermes 2f14936970 merge dc/mount (network router mounts) into p7-wave1 2026-10-03 22:08:44 -07:00
Hermes 5bcf4e99ee merge dc/DC-150 into p7-wave1 2026-10-03 22:05:39 -07:00
Hermes a443f030c0 P7 integration: mount network routers (people/access/invites/lifecycle/groups/resources/wizard) with shared stores + lazy lifecycle proxy 2026-10-03 21:52:14 -07:00
Hermes ae78e2e318 merge dc/DC-152 into p7-wave1 2026-10-03 21:49:08 -07:00
Hermes 178a2fbb9f merge dc/DC-147 into p7-wave1 2026-10-03 21:48:27 -07:00
Hermes 38af7ba224 DC-152: Private Network setup wizard (mode/domain/connect/dns/ca/admin steps) + status API + tests 2026-10-03 21:47:34 -07:00
Hermes c12bff597b merge dc/DC-146 into p7-wave1 2026-10-03 21:47:32 -07:00
Hermes d224a24566 DC-147: named root CA with critical name constraints, leaf compliance assertions, install-page hardening, encrypted backup + tests 2026-10-03 21:43:11 -07:00
Hermes b4e683a7fc DC-150: WG invite redemption page (browser X25519 keygen, client-side config+QR) + public redeem API + tests 2026-10-03 21:40:09 -07:00
Hermes 9215037553 DC-146: Technitium zone/record sync (idempotent upserts) + split-DNS gate + setup check + tests 2026-10-03 21:39:33 -07:00