Satisfies the plan's grep-based acceptance check for "no reference to
candidate_company_ids in the resolver source" — code already had no
membership check, this only reworded the explanatory comment.
- requirePermission('admin','access')-gated (D-08) — the write side of the
asymmetric read/write auth split
- zod-validated body (companyId positive int, note <=500 chars)
- Delegates the two-table write to resolvePax8CompanyMatch inside
postgresClient.transaction(); maps ResolveResult codes to HTTP status
(ok->200, not_found->404, already_resolved->409, company_not_found->400)
- Two-table transactional write: pax8_companies.match_method='manual' AND
pax8_company_match_review.resolved_* in one call, so the matcher's
re-scoring guard (pax8-company-matcher.ts ~216-231) never re-flags a
manually resolved company
- Guards not_found / already_resolved via FOR UPDATE select
- Validates target company existence + active state (substitute for
candidate-membership check — D-05/D-09 allow non-candidate ids)
- All five vitest behavior cases green; tsc clean
- requireAuth-gated (D-07) list of unresolved pax8_company_match_review rows
- Bulk-fetches candidate Autotask company names in one ANY($1::bigint[]) query
- Returns items with pax8 company + zipped candidates (id/name/confidence)
STATE.md now reflects Phase 14 as ready to execute (6 plans). Adds
14-PATTERNS.md (analog files + code excerpts) produced during planning,
consumed by execute-phase.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LHRgZqkzBHBbAbc3KHneuR
The decision-coverage-plan gate only scans designated sections
(frontmatter must_haves/truths/objective, or body sections under
matching headings) — decisions cited only in task prose/threat-model
tables don't count. Add explicit D-NN citations to the truths arrays
in Plans 01-04 so all 10 CONTEXT.md decisions are gate-visible.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LHRgZqkzBHBbAbc3KHneuR
Fix broken @file summary path references in Plans 04-06, mark
14-VALIDATION.md Wave 0 / sign-off as resolved (Plan 02 extracted +
unit-tested the resolver), and mark RESEARCH.md's two open questions
RESOLVED with the plan that closed each one.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LHRgZqkzBHBbAbc3KHneuR
Pre-populated entirely from existing DESIGN.md tokens plus Phase 14
CONTEXT.md/RESEARCH.md decisions — no new visual language introduced.
Flags the required additive DetailModal.tsx extension for the cost
breakdown drill-down.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LHRgZqkzBHBbAbc3KHneuR
4/6 must-haves independently verified against live code and DB state
(scheduled sync fires, full pax8 sequence runs, disable/re-enable
toggle correctly gates the scheduler with DB audit columns populated).
3 items remain pending a human with an authenticated browser session
(admin UI row rendering, manual-route 403/200) — already tracked in
13-HUMAN-UAT.md. No blocking gaps found.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LHRgZqkzBHBbAbc3KHneuR
2 critical, 3 warning, 1 info. Critical findings: unguarded POST handler
in /api/pax8/sync (no try/catch around the new integration_settings
query or PAX8 client init), and a missing admin/role permission check
on the same cost-incurring route (any authenticated session can trigger
a sync, unlike the equivalent admin toggle route).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LHRgZqkzBHBbAbc3KHneuR
SC#2 (admin UI row) and the manual-route halves of SC#3/SC#4 need a
human with an authenticated browser session — tracked here so they
surface in /gsd:progress and /gsd:audit-uat rather than being silently
dropped when the phase's plan-level tracking shows complete.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LHRgZqkzBHBbAbc3KHneuR
Confirms SC#1, and the scheduler halves of SC#3/SC#4 via direct DB/log
access. Also documents the stale-Docker-image root cause found during
testing (image predated all PAX8 code; rebuilt and redeployed) and the
incidental fix needed to unblock the build. SC#2 and the manual-route
halves of SC#3/SC#4 still need a human with an authenticated browser
session — not bypassed via forged auth.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LHRgZqkzBHBbAbc3KHneuR
Note in Operator config / Integration disable that the pax8 toggle is
the first integration where the DB toggle stops an action (scheduler
skip + 403 on manual sync route) rather than only suppressing
health-check display.
- Extend ScheduleConfig.sync_type union with 'pax8-daily'
- Add dual-guarded branch in executeScheduledSync: skips with a
distinct log when PAX8 is not configured (isPax8Configured()) or
when integration_settings.key='pax8' is disabled, otherwise calls
getPax8SyncService().fullSync('scheduled')
- PAX8-only inline check per D-01 — no shared helper, no changes to
getDbDisabledKeys()/applyDisableOverlay() or other switch branches
- Return 403 when integration_settings.key='pax8' has disabled=true
- Check runs as the first statement, before isSyncInProgress()
- GET handler unchanged; no new imports (postgresClient already imported)
- Idempotent INSERT ... WHERE NOT EXISTS seed of the pax8-daily row
(cron 0 4 * * *, is_enabled false), mirroring migration 089's style
- Covers existing installs since createDefaultSchedules() only seeds
a virgin sync_schedules table
- Applied to running dev DB and verified idempotent (second run = 0 rows)
Registers AppGate as a checkConfigOnly integration-health row and public
sync route, matching the existing factory + is<Name>Configured() pattern.
Committed now so Phase 13's worktree-isolated executors fork from a HEAD
that includes this integration-health.ts entry, since Plan 13-02 inserts
the PAX8 row immediately after it.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LHRgZqkzBHBbAbc3KHneuR