Project

General

Profile

Actions

Feature #3515

open
BA

[drcarrot-mobile-inpatient-list-v3] orchestration run

Feature #3515: [drcarrot-mobile-inpatient-list-v3] orchestration run

Added by Bot AI about 1 month ago. Updated about 1 month ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
09/23/2026
Due date:
% Done:

0%

Estimated time:
Source:

Description

Orchestration run tracking ticket. Not the real implementation ticket — this exists only so the live timing table has somewhere to post from step 1 onward. The real backend/mobile/web ticket(s) are created and cross-linked here once the run reaches that step.

Requirement:
"Write comprehensive Jest unit tests for the Inpatient list module to achieve full code coverage.

Target Coverage

  • Statements: 90%+
  • Branches: 85%+
  • Functions: 90%+
  • Lines: 90%+

These targets must match the repo's global coverage thresholds in jest.config.js.

Scope

Cover every layer that exists for the Inpatient list module:

  • Service: src/services/<module_name>.ts or equivalent
  • Hooks: src/hooks/<module_name>/**
  • Screens: src/screens/<module_name>/**
  • Sections/components: src/sections/<module_name>/** or src/components/<module_name>/**
  • Utils: src/utils/<module_name>/**
  • Redux slice, if present: src/store/slices/<module_name>.ts
  • Storybook stories, if present:
    • src/sections/<module_name>/**/*.stories.tsx
    • src/components/<module_name>/**/*.stories.tsx
  • Tracing, if present: src/traces/<module_name>.ts

Storybook Tests

If Inpatient list contains .stories.tsx files:

  • Create tests under:
    src/__tests__/sections/<module_name>/<Component>.stories.test.tsx
  • Import every named story export.
  • Render every exported story using the same RTL helpers already used elsewhere in the project.
  • Verify every story renders without crashing.
  • Verify story args/controls match the component prop types.
  • Tag Storybook tests with @p2, unless the story is the only meaningful coverage for a component, in which case use @p1.

Trace Tests

If src/traces/<module_name>.ts exists, create:

src/__tests__/traces/<module_name>.test.ts

Mock src/utils/otel.ts exactly as existing trace tests do.

For every exported span-builder/helper, verify:

  • Span name
  • Span attributes
  • Successful execution
  • status=ERROR on failure
  • Error recording on failure

Use:

  • @p1 for successful execution tests
  • @p2 for failure-path tests

Test Priority Tags

Every it() / test() title must start with @p1, @p2, or @p3.

@p1 — Critical Path

Cover:

  • Component/hook renders or initializes without crashing
  • Empty/loading/no-records states
  • Core <module_name> happy paths
  • Primary API success and failure handling
  • Required-field validation
  • Status/data mapping
  • Auth/permission gates that block access

@p2 — Important Secondary Behavior

Cover:

  • Search/sort/filter interactions
  • API parameter wiring
  • Pagination
  • Dialog open/close/cancel
  • Permission-based UI hiding
  • Refresh/pull-to-refresh
  • Secondary API errors
  • File upload validation, if applicable
  • Report generation/download/sequence behavior, if applicable

@p3 — Edge Cases

Cover:

  • null / undefined / boolean coercion
  • Malformed or partial API responses
  • Invalid/boundary dates
  • Non-matching selections
  • Whitespace-only/empty search
  • Independent toggle states

Test Implementation Requirements

  1. Inspect all <module_name> source files line by line before writing tests.

  2. Exercise every:

  • Conditional
  • Ternary
  • Optional-chaining fallback
  • Switch/case branch
  • Validation branch
  • Success path
  • Error path
  1. Use the existing mock boilerplate patterns in this repo.

Use these reference tests:

  • src/__tests__/services/ProcurementsService.test.ts
  • src/__tests__/hooks/procurement/usePurchaseBill.test.ts
  1. Mock the following exactly as the reference tests do:
  • ApiClient
  • AsyncStorage
  • Logger
  • Navigation

Do not introduce a new mocking approach.

  1. Organize tests using describe() blocks by behavior area:
  • Core behavior
  • Search & sort
  • Pagination
  • Permissions
  • Error handling
  • Edge cases
  1. Do not use any or other explicit unsafe types in test code.

  2. Do not add:

  • Skipped tests
  • Pending tests
  • Unnecessary snapshot tests
  1. Do not modify production/business logic.

  2. Only add or update the required Jest test files and test configuration if absolutely necessary for priority filtering.

  3. Do not create unnecessary documentation.

Coverage Validation

After implementing the tests, run:

npm run test:coverage -- <path-to-<module_name>-tests>

BA Updated by Bot AI about 1 month ago Actions #1

Account status — using account 2

  • Window usage so far: 37,955,243 tokens ($42.61) — 198% of its own last observed ceiling
  • Total dispatches on this account: 136

BA Updated by Bot AI about 1 month ago Actions #2

Account status — using account 2

  • Window usage so far: 37,955,243 tokens ($42.61) — 198% of its own last observed ceiling
  • Total dispatches on this account: 137

BA Updated by Bot AI about 1 month ago · Edited Actions #3

Phase Timeline

# Process Start (IST) End (IST) Duration Input Output Cache Create Cache Read Tokens Cost Model
1 Requirement scope detection 23-09-2026 13:31:17 23-09-2026 13:31:25 8s 2 140 30,865 0 31,007 $0.1909 claude-sonnet-5
2 Initialise run ticket (timing anchor) 23-09-2026 13:31:26 23-09-2026 13:31:27 1s not available not available not available not available not available not available Script
3 Probe environment 23-09-2026 13:31:27 23-09-2026 13:31:36 8s not available not available not available not available not available not available API Script
4 Extract ticket-spec, acceptance criteria & test scenarios (re-dispatched ×2; first attempt 23-09-2026 13:31:36) 23-09-2026 13:33:38 23-09-2026 13:35:28 2m 2,563 14,373 0 38,390 55,326 $0.2379 claude-sonnet-5
5 Prepare execution plan 23-09-2026 13:35:28 23-09-2026 13:35:28 0s not available not available not available not available not available not available Script
6 Initialise timing note 23-09-2026 13:35:28 23-09-2026 13:35:29 0s not available not available not available not available not available not available API Script
7 Execution plan — human gate 23-09-2026 13:35:29 23-09-2026 13:36:35 1m n/a n/a n/a n/a n/a n/a n/a
8 Mobile & Web task redmine ticket creations — mobile 23-09-2026 13:36:43 23-09-2026 13:36:45 2s not available not available not available not available not available not available API Script
9 Cross-link tickets 23-09-2026 13:36:46 23-09-2026 13:36:47 0s not available not available not available not available not available not available API Script
10 Write contract file 23-09-2026 13:36:47 23-09-2026 13:36:47 0s 0 0 0 0 0 (SKIPPED — capability absent — sides.backend.live_verified.verdict = , want one of ['PASSED', 'SKIPPED']) 0 (SKIPPED) --
11 Validate contract vs screens 23-09-2026 13:36:48 23-09-2026 13:36:48 0s 0 0 0 0 0 (SKIPPED — capability absent — contract.path exists=False, want True) 0 (SKIPPED) --
12 Propagate contract to consumer repos 23-09-2026 13:36:48 23-09-2026 13:36:48 0s 0 0 0 0 0 (SKIPPED — capability absent — contract.path exists=False, want True) 0 (SKIPPED) --
13 Determine backend connection 23-09-2026 13:36:49 23-09-2026 13:36:49 0s 0 0 0 0 0 (SKIPPED — capability absent — contract.path exists=False, want True) 0 (SKIPPED) --
14 Mobile: Create feature branch 23-09-2026 13:36:49 23-09-2026 13:37:17 27s not available not available not available not available not available not available API Script
15 Mobile: Repo context 23-09-2026 13:37:18 23-09-2026 13:37:19 1s not available not available not available not available not available not available Script
16 Mobile: Resolve test target files 23-09-2026 13:37:20 23-09-2026 13:37:21 1s not available not available not available not available not available not available Script
17 Shared Context Bundle 23-09-2026 13:37:21 23-09-2026 13:37:22 0s not available not available not available not available not available not available Script
18 1. Unit Tests 23-09-2026 13:37:22 23-09-2026 14:09:14 32m 131 82,346 241,461 12,214,400 12,538,338 $6.5075 claude-sonnet-5
19 Git & MR 23-09-2026 14:09:15 23-09-2026 14:09:19 3s not available not available not available not available not available not available API Script
20 Validate verification evidence 23-09-2026 14:09:20 23-09-2026 14:09:21 1s not available not available not available not available not available not available API Script
21 Completion Summary 23-09-2026 14:09:22 23-09-2026 14:09:22 0s not available not available not available not available not available not available API Script
22 Write handoff doc 23-09-2026 14:09:22 23-09-2026 14:09:22 0s not available not available not available not available not available not available Script
23 Resolve tickets + post usage summary 23-09-2026 14:09:23 23-09-2026 14:09:26 2s not available not available not available not available not available not available Script
24 Mobile: Join parallel gates -- 23-09-2026 14:09:15 -- n/a n/a n/a n/a n/a n/a n/a
25 Join — all active sides implemented -- 23-09-2026 14:09:20 -- n/a n/a n/a n/a n/a n/a n/a
— ORCHESTRATOR TOTAL (rows 7–25) — — 1m 0 0 0 0 0 $0.0000 —
— SHARED TOTAL (rows 1–23) — — 35m 2,696 96,859 272,326 12,252,790 12,624,671 $6.9363 —
— GRAND TOTAL (wall clock) 23-09-2026 13:31:17 23-09-2026 14:09:26 38m 2,696 96,859 272,326 12,252,790 12,624,671 $6.9363 —

ORCHESTRATOR TOTAL: 1m, 0 tokens, $0.0000 (rows 7–25)
SHARED TOTAL: 35m, 12,624,671 tokens, $6.9363, 15 row(s) with no token data (rows 1–23)

Total Run Time: 38m (wall clock, 23-09-2026 13:31:17 → 23-09-2026 14:09:26 IST — not a sum of the per-side totals above, since sides overlap)
Total Tokens Consumed: 12,624,671 (plus 15 row(s) whose usage was never captured — run execution_tracker.py enrich-audit to backfill. This is a floor, not the total.)
Token breakdown: input 2,696 · output 96,859 · cache-create 272,326 · cache-read 12,252,790 (97% of the total). Cache-read is context a node re-sends to itself across its own tool-use turns, billed at roughly a tenth of fresh input — a large Tokens number that is mostly cache-read is a long tool loop, not a large workload.
Total Cost: $6.9363 (plus 15 row(s) whose usage was never captured — run execution_tracker.py enrich-audit to backfill. This is a floor, not the total.)

BA Updated by Bot AI about 1 month ago Actions #4

Account status — using account 2

  • Window usage so far: 38,010,569 tokens ($42.85) — 199% of its own last observed ceiling
  • Total dispatches on this account: 138
Actions

Also available in: PDF Atom