Appearance
Handoff: SVC-023-admin-owner-source-route-proof admin-service owner source route proof
Scope
- Service/area:
admin-service - Task ID:
SVC-023-admin-owner-source-route-proof - Goal: prove admin source maps use owner APIs/source snapshots and attach local gateway runtime/browser proof with explicit rollback notes before any default admin promotion.
- Non-goals: default route promotion, support-ticket persistence, recipient discovery, mutating moderation parity, audit-service storage migration, dashboard aggregation, IAM/profile/payment/wallet ownership changes, or changes to legacy source under
/Users/velikho/Desktop/WORKING/HOCTAPAZ/.
Docs Read
docs/agents/handoff-phase-9-admin-foundation.mddocs/agents/service-tasks/admin-service.mddocs/agents/handoffs/SVC-023-support-moderation-source-contract.mddocs/agents/service-agent-next-slice-queue.jsondocs/agents/service-agent-next-slice-closeout-ledger.jsondocs/agents/agent-handoff-format.mddocs/api/admin-service.mddocs/qa/admin-owner-source-route-proof.mddocs/qa/profile-admin-bff-route-rehearsals.mddocs/qa/service-agent-goal-completion-audit.mddocs/qa/service-agent-readiness-smoke.mddocs/runbooks/local-development.md
Legacy Evidence Read
/Users/velikho/Desktop/WORKING/HOCTAPAZ/node-platform/apps/api/src/modules/admin/feature-maintenance.service.ts/Users/velikho/Desktop/WORKING/HOCTAPAZ/node-platform/apps/api/src/modules/admin/operations.controller.ts/Users/velikho/Desktop/WORKING/HOCTAPAZ/node-platform/apps/api/src/modules/admin/admin-dashboard.controller.ts/Users/velikho/Desktop/WORKING/HOCTAPAZ/node-platform/apps/api/src/modules/admin/inbox.controller.ts/Users/velikho/Desktop/WORKING/HOCTAPAZ/node-platform/apps/api/src/modules/support/support.service.ts/Users/velikho/Desktop/WORKING/HOCTAPAZ/node-platform/apps/api/src/common/feature-maintenance.guard.ts/Users/velikho/Desktop/WORKING/HOCTAPAZ/node-platform/apps/api/prisma/schema.prisma- Legacy source was read-only evidence; no legacy admin/support table, route, or source file was changed.
Files Changed
services/admin-service/internal/usecase/admin_owner_source_test.goservices/admin-service/internal/http/server.goservices/admin-service/internal/http/server_test.godocs/api/admin-service.mddocs/qa/admin-owner-source-route-proof.mddocs/index.mddocs/.vitepress/config.tsdocs/agents/handoffs/SVC-023-admin-owner-source-route-proof.mddocs/agents/service-agent-next-slice-closeout-ledger.jsondocs/agents/service-agent-next-slice-closeout-ledger.mddocs/agents/service-agent-accepted-handoffs.mddocs/qa/service-agent-goal-completion-audit.mddocs/qa/service-agent-readiness-smoke.md- Runtime artifacts:
output/playwright/svc023-admin-feature-maintenance-public.png,output/playwright/svc023-admin-audit-route.png, andoutput/playwright/svc023-admin-owner-source-snapshots.png. - No default gateway route, migration, owner service, IAM/profile boundary, or legacy file was changed.
Behavior Implemented
- Added a regression test requiring every admin operations source-map item to have a unique owner service, owner API, and
routeStatus=legacyuntil promotion evidence exists. - Existing source snapshots were verified against configured owner HTTP endpoints.
okowner responses are preserved as status/latency/HTTP evidence; unconfigured and unavailable owners remain explicit and do not become synthesized dashboard totals. - Native owner-source map and snapshot routes now require an authenticated
ADMINactor at the admin-service boundary; anonymous, identity-less, and non-admin direct calls are rejected before any owner-source read. - Existing gateway rehearsals were exercised through a real local
api-gatewayandadmin-serviceprocess with test-only credentials. Native feature-maintenance public/list/update and admin audit reads preserved route headers and globalADMINenforcement.
Tests And Verification
- Command:
GOTOOLCHAIN=go1.25.11 go test ./services/admin-service/... - Result: passed with
-count=1. - Evidence: admin HTTP, use-case, owner-source reader, notification sink, audit sink, owner/API/legacy-status regression, and direct owner-source admin-boundary tests passed.
- Command:
make test-feature-maintenance-routes test-admin-audit-routes - Result: passed.
- Evidence: default route table stayed legacy; non-default Compose and localhost tables kept exact native feature-maintenance/admin-audit routes, auth, role, ordering, and targets.
- Command:
make test-audit-admin-compat-routes - Result: passed.
- Evidence: audit-service compatibility preview remained a separate non-default route and did not alter admin-service default routing.
- Runtime verification: local admin-service on
:8094plus gateway on:18085passed public native read, ADMIN list, ADMIN PATCH, ADMIN audit read, route headers, and unauthenticated401rejection. - Owner-source verification: disposable owner endpoints on
:18100returned HTTP 200 and admin source snapshots reportedai.providers=okandaudit.history=ok; all processes and ports were cleaned up. - Browser verification: Playwright rendered the public feature response, authenticated admin response, audit response, and owner-source snapshot response; screenshots are recorded under
output/playwright/. - Command:
GOTOOLCHAIN=go1.25.11 go test -race ./services/admin-service/internal/http ./services/admin-service/internal/ownersource -count=1 - Result: passed.
- Current isolated runtime recheck:
admin-serviceon:8094used its in-memory store and probed two disposable owner endpoints on:18100throughADMIN_OPERATIONS_SOURCE_TARGETS. Theai.providersandaudit.historykeys returnedokwith HTTP 200;wallet.reviewsand every other unconfigured source remained explicitlyunconfigured. The owner fixture requiredX-Internal-Service: admin-serviceand the test-only internal token. - Current gateway/browser recheck: the non-default owner-source route table on
:18085returnednative_readfor exact source-map and source-snapshot reads to anADMINJWT, rejected anonymous traffic withAUTH_UNAUTHORIZEDand aTEACHERJWT withAUTH_FORBIDDEN, and rendered the authenticated snapshot JSON in Playwright desktop/mobile captures. Restarting the Gateway with the active default table returned the broadadminroute withlegacy_proxyand the expected 502 from a deliberately unavailable legacy target. Evidence is retained inoutput/qa/admin-owner-source-route-proof-20260713/andoutput/playwright/admin-owner-source-route-proof-20260713/; all temporary processes were stopped. - Command:
pnpm docs:build - Result: passed after adding the QA page and VitePress links.
- Command:
git diff --check - Result: passed.
Current Working-Tree Re-verification
On 2026-07-14, configured owner-source snapshots changed from serial probing to bounded parallel probing, with at most eight requests in flight. The reader keeps the configured source-map order and reports each source status independently. The gated TestHTTPReaderProbesConfiguredTargetsConcurrently requires both configured owner targets to begin before either response is released; it passed 100 consecutive runs.
GOTOOLCHAIN=go1.25.11 go test ./services/admin-service/... -count=1,GOTOOLCHAIN=go1.25.11 go test -race ./services/admin-service/... -count=1, andGOTOOLCHAIN=go1.25.11 go vet ./services/admin-service/...passed.make test-admin-owner-source-routes test-admin-audit-routes test-feature-maintenance-routespassed.- This changes no database ownership or default Gateway route and is not production dashboard-metric parity evidence.
Current Admin Operations Browser Candidate (2026-07-15)
- Command:
make test-admin-owner-source-routesandmake test-admin-owner-source-browserpassed, followed by the focused admin-service suite and race checks. - Runtime: a memory-only admin-service read only two configured owner fixture endpoints. Both required
X-Internal-Service: admin-serviceplus the test-only internal token and returned HTTP 200;wallet.reviewsremainedunconfiguredand no owner database was read. - Browser: actual Admin Operations at
/admin/operations?adminOperationsGateway=nativerendered all 20 source statuses in desktop and mobile contexts, then reload used the exactadmin-operations-source-snapshotsnative_readroute again. ADMIN was allowed, anonymous was401, and TEACHER was403. The direct Gateway check took1.47 ms; browser observations took16 msand17 ms. - Rollback: restarting the temporary Gateway with
deploy/gateway/routes.jsonreturned broadadmin/legacy_proxyand the expected unreachable-legacy502. Artifact:output/qa/admin-owner-source-browser-local-runtime-20260715-035834/; its browser request recordsBearer [redacted]only. All temporary processes and the runtime directory were removed.
Required Evidence
- owner-service source proof:
GET /v1/admin/operations/source-mapnames owner services/APIs for each source,GET /v1/admin/operations/source-snapshotsprobes only configured targets, and the disposable owner runtime returnedokwithout database joins or synthesized totals. - route/browser proof: real gateway requests and Playwright navigation passed for feature-maintenance public/admin routes, admin audit read, and the owner-source snapshot response; default routing remained legacy.
- rollback notes:
deploy/gateway/routes.jsonremained active; the rehearsal can be rolled back by switchingGATEWAY_ROUTE_TABLEback to that file and disabling owner target configuration. - current isolated evidence:
output/qa/admin-owner-source-browser-local-runtime-20260715-035834/records current owner-map metadata, owner status, role/anonymous rejections, internal fixture authentication, default rollback headers, and actual Admin Operations desktop/mobile renders. It remains source-status UI evidence, not dashboard UI or production parity evidence.
Route State
- Legacy route: default
deploy/gateway/routes.jsonkeeps broad/api/admin*,/api/support*,/api/feature-maintenance*,/api/admin/operations*, and fallback traffic on legacy. - Native route: non-default examples rehearse only
GET /api/feature-maintenance/public,GET /api/admin/feature-maintenance,PATCH /api/admin/feature-maintenance/{key}, andGET /api/admin/operations/auditwith gateway auth and globalADMINchecks where required. - Gateway state: mutating support/moderation implementation is blocked until the support owner and recipient-resolution contract are named. This handoff does not approve default promotion.
- Delegated gateway scope: route proof only; default gateway route tables remain orchestrator-owned.
- Rollback notes: switch
GATEWAY_ROUTE_TABLEback todeploy/gateway/routes.json, remove non-default route entries, and disableADMIN_OPERATIONS_SOURCE_TARGETSif owner responses regress. Review response parity, tenant behavior, browser/runtime evidence, and rollback before promotion.
Data Notes
- Tables touched: none outside the isolated in-memory admin store; no shared or legacy database was modified.
- Migration run: none.
- Validation report: disposable owner fixture on
127.0.0.1:18100, admin-service:8094, and gateway:18085were stopped; no rehearsal process remained.
Risks / Blockers
- Support ticket owner API and recipient-resolution source are still unnamed for mutating support/moderation workflows.
- Default admin/dashboard/operations routes still require broader response parity, tenant behavior, and route/browser rollback review.
- Admin source snapshots prove owner reachability and status only; they are not dashboard metric parity or production monitoring.
- The current browser captures render a protected JSON response only; admin-web operations UI parity remains a separate frontend proof.
- IAM/Profile production-like populated-target cutover remains open for the broader goal.
Next Step
- Name the support ticket owner and recipient-resolution contracts, then add a separate bounded support/moderation route slice with owner API, audit/notification fanout, browser proof, and rollback evidence before any public default admin promotion.