Harness Intelligence Wiki
SpecsCLIIP-138-backoffice-project-usage

Implementation Notes: IP-138 Backoffice Project Usage Visibility

Implementation Notes: IP-138 Backoffice Project Usage Visibility

Execution Mode

Sequential (parallel: false). The shared contract, API read model, auth boundary, and app UI were tightly coupled around one M4.5 vertical slice.

Completed Scope

IssueStatusEvidence
IP-139ImplementedBackoffice contract/API exposes ProjectUsage summaries/details, observed repositories, events, reports, and repository mapping. DB mapping also moves events/reports tied to the observed repository.
IP-140PreservedExisting five-event taxonomy remains unchanged. Backoffice adoption summaries count only normal-source counted events and keep local/test/debug/CI as non-adoption context.
IP-141ImplementedBetter Auth bearer/device auth is the operator identity flow and git identity remains observed metadata.
IP-142Implementedapps/backoffice exists separately from apps/web with project usage list/detail, repository table, recent events, and manual repository mapping form.
IP-143ImplementedBackoffice report cards support status transitions and GitHub issue/PR URL linking. Reports remain distinct from happy-path usage stats.

Files And Artifacts

  • packages/contract/src/schemas.ts, api.ts, errors.ts: backoffice schemas, endpoint group, and typed errors.
  • apps/api/src/backoffice.ts: in-memory and database-backed backoffice store.
  • apps/api/src/backoffice.test.ts: adoption source filtering, repository mapping, report triage, and status schema tests.
  • packages/auth/src/index.ts: Better Auth bearer/device authorization configuration.
  • packages/auth/src/index.test.ts: auth option regression coverage.
  • apps/backoffice: separate internal Next.js backoffice app.
  • docs/README.md, docs/reference/harness-intelligence.md: setup and architecture docs.
  • apps/wiki/content/docs/harness/*, apps/wiki/content/docs/harness/trust-and-adoption/*: docs-ingest output.

Manual Review Checklist

  • Confirm backoffice remains separate from apps/web.
  • Confirm no UI or API field ranks, scores, or compares developers.
  • Confirm GitHub URL linking is stored but automatic GitHub issue creation is not introduced.
  • Confirm local/test/debug/CI sources do not inflate adoption counts.
  • Confirm Better Auth bearer/device authorization remains available for CLI/API/backoffice sessions.

Validation

  • bun run --filter=@punks/contract check-types passed.
  • bun run --filter=@punks/api test -- backoffice.test.ts passed.
  • bun run --filter=@punks/auth test passed.
  • bun run --filter=@punks/backoffice check-types passed.
  • bun run --filter=@punks/backoffice build passed.
  • bun run --filter=@punks/api test passed.
  • bun run check-types passed.
  • bun run test passed.
  • bun run check passed after adding apps/backoffice/.gitignore for generated Next output.
  • git diff --check passed.
  • Browser smoke passed with agent-browser against http://localhost:3002: project usage list rendered, project detail rendered, observed repository table rendered, recent event rendered, and report triage form rendered.

On this page