Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/cp-tt-crm-01.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Tool Traceability foundation
on:
push:
branches: [main, cp-tt-crm-01-native-foundation]
paths:
- 'frontend/apps/ToolTraceability/**'
- 'frontend/tool-traceability-application.js'
- 'frontend/tests/tool-traceability-foundation.test.mjs'
- 'frontend/tests/fixtures/tool-traceability-preview*'
- 'scripts/cp-tt-crm-01-browser.mjs'
- '.github/workflows/cp-tt-crm-01.yml'
pull_request:
paths:
- 'frontend/apps/ToolTraceability/**'
- 'frontend/tool-traceability-application.js'
- 'frontend/tests/tool-traceability-foundation.test.mjs'
- 'frontend/tests/fixtures/tool-traceability-preview*'
- 'scripts/cp-tt-crm-01-browser.mjs'
- '.github/workflows/cp-tt-crm-01.yml'
permissions:
contents: read
jobs:
foundation:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
- run: npm ci --no-audit --no-fund
- name: Syntax and domain contract
run: |
for file in frontend/apps/ToolTraceability/*.js frontend/tool-traceability-application.js; do node --check "$file"; done
node --test frontend/tests/tool-traceability-foundation.test.mjs
- name: Isolated Chromium reference acceptance
run: |
export CHROME_BIN="$(command -v google-chrome || command -v chromium || command -v chromium-browser)"
test -n "$CHROME_BIN"
node scripts/cp-tt-crm-01-browser.mjs
- name: CRM build regression
run: npm run build
24 changes: 24 additions & 0 deletions docs/CP-TT-CRM-01.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# CP-TT-CRM-01 — Tool Traceability native foundation

## Evidence and decision

Baseline main commit: 2909fc06b094b19f73ca044523f9c7f69f98a9ba.
Read-only production catalog inspection on 2026-11-29 confirmed native tools, requests, request-tools, personnel, defect, activity, attachment, notification, presence, counter and membership tables. 31 matching migration-history entries include the 30 tool_traceability filenames and the workspace role sync. The first historical migration is a repository placeholder; its recorded SQL must be reconciled against the migration recovery manifest before replay. No migration or data write is authorized by this foundation.

Production aggregate readback: 77 unarchived tool rows, one unarchived request, 15 active personnel, zero tool rows with stock_quantity > 1. Do not seed screenshot names or counts.

Existing public RPCs: list_tools, list_requests, personnel_list_v2 (signed reads); create_request_with_team_v2 (later write integration); list_my_requests_v1, partial_return_v1, returnable_tools_v1, defects_page_v1, report_defect_v1, release_inspected_v1, resolve_defect_v1, activity_page_v2, activity_snapshot_v1, export_snapshot_v1, attachment_page_v2, notification_inbox_v2 and presence functions (later phases). All names carry tool_traceability_ prefix. Existing server generator uses TRC- and zero-padded counter; do not allocate a number separately. Team selection uses [{id}], tools uses {linkedItems:[{id}]}, quantities uses _toolQuantities, borrowWindow uses {from,to}. Live creation currently checks availability then updates without an obvious row lock or conditional UPDATE; reproduce concurrent reservation in disposable PostgreSQL before enabling writes. Existing bootstrap may insert a membership; this read-only foundation deliberately does not invoke it. No new role policy.

## Delivered foundation

ES modules and scoped CSS under frontend/apps/ToolTraceability, signed read adapter and host entry contract, isolated browser fixture and unit/browser CI. The preview supports dashboard counters, roster selection, search/category catalog, duplicate-name identity, click and drag/drop, validation, request review, fixture-only submission, inspection queue display and ledger filtering. No fixture fallback in the signed adapter. All preview records are synthetic; they are not persisted in production. Fixture My Requests uses an explicit synthetic isMine flag; signed My Requests needs existing scoped RPC integration.

## Reference mapping (14 screenshots in supplied order)

1 dashboard: baseline; 2 add personnel: deferred; 3 roster actions: selection baseline, edit/remove deferred; 4 edit personnel dialog: deferred; 5 role dropdown: role selection baseline, editing deferred; 6 add catalog: deferred; 7 tool/equipment type: displayed; 8 category dropdown: search filter baseline, creation deferred; 9 ledger: read/filter baseline, export/print/actions deferred; 10 extension modal: deferred; 11 override edit: deferred; 12 force add: deferred; 13 request detail and timeline: deferred; 14 My Requests: fixture baseline, signed RPC deferred.

## Activation boundary and remaining acceptance

The existing sidebar and board entry remain unchanged. The host exports a candidate route and mount function, not an activated route. Signed runtime acceptance and production deployment are separate from source/build success. No new dependencies, external system connections, training, role changes or database migrations. Stable asset identity is maintained even when names repeat. The preview intentionally selects one unit per asset; multi-unit stock reconciliation is a later gate. Dashboard counts catalog rows rather than inventing unit-level availability. Inspection list is read-only in this increment.

Next: verify the exact deployed RPC grants, migration source parity and signed two-account readback; prove atomic reservation under concurrent requests in a disposable database; integrate workspace route without duplicating sidebar entry, then enable verified writes through explicit production acceptance. Preserve existing data and authorization. Do not treat a successful fixture test as signed production acceptance.
8 changes: 8 additions & 0 deletions frontend/apps/ToolTraceability/dashboard.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading