Skip to content

Platform Audit — Current Writer And Evidence Inventory 2026-08-08

  • Status: CURRENT STATIC SOURCE INVENTORY / ENVIRONMENT EVIDENCE REQUIRED
  • Repository baseline: qa/master@1a71a21d39828dda5c4155d728e1dd6d2da36f74
  • Evidence package: RBR-AUDIT-002
  • Source authority: PLATFORM_AUDIT_TRANSITION_CORRELATION_SUPPORT_SOURCE_AUTHORITY.md
  • Canonical rule: .agents/rules/AUDIT_AND_TRANSITION_EVIDENCE.md
  • Read-only environment package: RBR-AUDIT-002-READONLY-ENVIRONMENT-PREFLIGHT.md
  • Program state: PHASE IMPLEMENTATION USER HOLD
  • Effects: repository source inspection and documentation only

1. Purpose

The repository contains four evidence families that are easy to confuse:

KJDatabase request/mutation diagnostics
Business transition audit
Operation-event notifications
Domain evidence owned by business modules/providers/files

This inventory establishes the current source-level writer and reader map before any named environment is queried.

It answers:

Which source constructs transition envelopes?
Which source persists transition rows?
Which business callers invoke that writer?
Which evidence references are produced?
Which current source creates and ACKs operation notifications?
Which facts remain environment questions rather than source facts?

It does not claim that a table is installed, a caller is deployed, a transition row exists, or a support user can read the evidence in a named environment.


2. Authority Separation

KJDatabase mutation diagnostic
!= business transition

Business transition audit
!= authoritative business record

Operation event
!= business transition

Operation-event ACK
!= approval
!= confirmation
!= completion

Evidence reference
!= copied evidence payload

Static source caller
!= deployed/runtime caller

Source migration
!= applied schema

The support model must correlate these owners without replacing them.


3. Source Set Reviewed

Transition contract and store

app/platform/process/ProcessContext.php
app/platform/process/AuditEnvelope.php
app/platform/process/TransitionAuditStore.php
app/platform/tenant/TenantExecutionContext.php
app/platform/tenant/tenant_execution_context_adapter.php

Selected current business writer

app/systems/TMS/transload/loader_transition_evidence.php
app/systems/TMS/transload/api_routes.php
app/systems/TMS/transload/post_helper.php

Request and mutation diagnostics

app/utils/KJDatabase.php
app/utils/JsonlLogger.php
app/shared/api/logging.php
app/shared/endpoint/*

Notification owner

app/platform/operation_event_helper.php
app/platform/api_routes.php
app/systems/TMS/transload/post_helper.php
app/systems/TMS/delivery/api_routes.php
app/systems/TMS/ai-voice/voice_helper.php
app/systems/YMS/yard-move/post_helper.php

Schema and source evidence

scripts/migrations/2026-07-15_task-1190_transition_audit_store_forward.sql
scripts/migrations/2026-06-16_task-856_operation_event_framework.sql
scripts/transition_audit_store_smoke.php
tests/unit/transition_audit_store_test.php
tests/unit/ctc_loader_transition_evidence_test.php

Repository symbol search located direct static references. Dynamic invocation, runtime includes, deployed source identity, current database state, log files, and external consumers remain separate evidence.


4. Transition Contract

4.1 ProcessContext

A transition process context is expected to preserve:

strict tenant context
actor and optional subject
request ID
process contract ID/version
process instance ID
optional parent process instance
correlation ID
optional causation ID
source type/name
entity references
maximum recovery class

A compatibility-only tenant context is not accepted for a strict transition write.

4.2 AuditEnvelope

Current result values:

SUCCEEDED
REJECTED
FAILED
PARTIAL
COMPENSATION_REQUIRED

Current recovery classes:

R0 R1 R2 R3 R4 R5

Current effect boundaries:

NONE
DATABASE_COMMITTED
EXTERNAL_PENDING
EXTERNAL_COMMITTED
PHYSICAL_COMMITTED
COMPENSATION_REQUIRED

Current evidence type/relation pairs:

Evidence type Required relation Source meaning
KJ_MUTATION MUTATION request/mutation diagnostic reference
OPERATION_EVENT NOTIFICATION_ONLY notification/read-state reference
STAFF_EVENT STAFF_ACTIVITY workforce event reference
FILE FILE_EVIDENCE object/metadata/link/readability owner
MAIL_ITEM MAIL_WORK_ITEM mail/request-item owner
EXTERNAL_ATTEMPT EXTERNAL_ATTEMPT provider-attempt owner
BUSINESS_RECORD BUSINESS_STATE authoritative business-record reference

High-impact R4/R5 evidence requires an approval reference and at least one non-notification evidence reference.


5. Transition Store

5.1 Current source owner

app/platform/process/TransitionAuditStore.php

5.2 Persistence family

T_PROCESS_TRANSITION_AUDIT
T_PROCESS_TRANSITION_ENTITY
T_PROCESS_TRANSITION_EVIDENCE

The store writes bounded scalar fields and typed references. It does not define an unrestricted JSON/text/blob payload.

5.3 Transaction modes

append()
= store-owned transaction

appendInCallerTransaction()
= business caller already owns transaction
= store does not commit or roll back it

The second form is the current source mechanism for placing the business mutation and transition evidence in one local commit boundary.

5.4 Duplicate semantics

same CLIENT_ID + same audit UUID + same canonical envelope hash
-> existing audit returned as IDEMPOTENT

same CLIENT_ID + same audit UUID + different hash
-> TRANSITION_AUDIT_DUPLICATE_CONFLICT

5.5 Retention calculation in source

STANDARD
-> occurredAt + 400 days

EXTENDED
-> occurredAt + 2,555 days

R4, R5, EXTERNAL_COMMITTED, PHYSICAL_COMMITTED, and COMPENSATION_REQUIRED produce EXTENDED.

These are engineering defaults. They are not approved legal/customer retention policy.

5.6 Stale source comments

Two source-provenance locations still contain historical wording that the writer is inactive:

TransitionAuditStore class comment
2026-07-15 transition-audit migration comment

Current static source contains a selected Loader writer. The comments remain historical implementation provenance and do not override current caller evidence.


6. Static Writer Inventory

6.1 Direct business writer located

CtcLoaderTransitionEvidence

Source:

app/systems/TMS/transload/loader_transition_evidence.php

Direct static store construction:

(new TransitionAuditStore($db))->appendInCallerTransaction($envelope)

6.2 Current Loader writer contract

Field Start Transloading Undo
Process contract PROC-TMS-INBOUND-PLANNING same
Contract version 0.5.0 same
Source /api/tms/transloads/start-transloading /api/tms/transloads/undo
Transition START_TRANSLOADING UNDO_TRANSLOADING
Before normalized current state TRANSLOADING
After TRANSLOADING DOCKED
Reason LOADER_STARTED LOADER_UNDO
Result SUCCEEDED SUCCEEDED
Recovery R1 R1
Effect boundary DATABASE_COMMITTED DATABASE_COMMITTED
Transaction mode caller-owned caller-owned

Entity references:

T_TRANSLOAD        PRIMARY
T_EQUIPMENT_LOAD   RELATED when present
T_LOADING_PLANNER  RELATED when present

Evidence references:

BUSINESS_RECORD / BUSINESS_STATE
KJ_MUTATION / MUTATION

6.3 Other direct business writers

Static repository search for direct TransitionAuditStore construction or appendInCallerTransaction use located:

selected Loader writer
transition-store smoke/fixture source
store implementation itself

No second direct current business writer was located in this source review.

This is a static-source conclusion only:

no other direct writer located
!= dynamic invocation impossible
!= deployed caller absent
!= database rows limited to Loader

The read-only environment package checks actual process/source/transition distributions rather than assuming source-search completeness.

6.4 Process coverage boundary

The selected writer covers specific Transloading Start/Undo behavior. It does not establish transition coverage for:

Loader non-load Work Assignment
Clock In / Clock Out
Break / Final Break
Final Loading Review
Street Turn
Yard / Driver
Billing / QBO
MK processes
Provider effects
File lifecycle

7. KJDatabase Diagnostic Inventory

7.1 Current role

KJDatabase can record bounded diagnostic metadata such as:

request context
statement/table family
operation
statement fingerprint
insert ID
affected rows
tables touched
transaction used/committed/rolled back
timing
statement/connection error metadata

7.2 Before-state boundary

Current source does not establish a general immutable before/after business-row snapshot.

captureBeforeSnapshot
-> current source authority classifies policy as NOT_CAPTURED

A KJ_MUTATION reference such as request:<requestId> is therefore a diagnostic correlation reference. It is not the authoritative before/after state.

7.3 Readability dependency

Transition evidence can reference:

KJ_MUTATION
reference = request:<requestId>

Whether that reference remains readable depends on the named environment's:

JSONL channel/location
retention/rotation
request-ID propagation
redaction
support access

The database cannot prove KJ diagnostic readability by itself.


8. Operation Event Inventory

8.1 Current owner

T_OPERATION_EVENT
app/platform/operation_event_helper.php

8.2 Current data shape

tenant
event type
severity
source type/id
display payload
ACK timestamp/user
lifecycle timestamps

8.3 Current writers

Direct operation_event_create() callers were located in multiple current module families, including:

TMS Transload
TMS Delivery
TMS AI Voice
YMS Yard Move
Platform/API support

Each process retains its own transaction/failure/idempotency boundary.

8.4 ACK/unack

Current source supports both ACK and unack.

ACKED_AT / ACKED_BY
= notification marked read in the notification UI

unack
= ACK fields can be cleared

Therefore ACK cannot be immutable approval or business completion evidence.

8.5 Correlation limitation

T_OPERATION_EVENT has source type/id and display payload but no universal columns for:

process instance
correlation
causation
request ID
transition audit ID

A transition can reference an Operation Event only as:

OPERATION_EVENT / NOTIFICATION_ONLY

The read-only package checks whether any current transition row appears to use a notification as approval/completion evidence.


9. Evidence-Reference Static Maturity

Evidence type Current source-level owner Current transition writer use located Environment question
BUSINESS_RECORD business module record yes, Loader referenced row still exists and matches tenant/state
KJ_MUTATION KJDatabase/JSONL yes, Loader log channel still resolves request reference
OPERATION_EVENT notification ledger no selected Loader use any transition rows use it; relation is notification-only
STAFF_EVENT staff-time owner no direct writer located any rows/references and exact resolver
FILE file object/metadata/link owners no direct writer located any rows/references and readability
MAIL_ITEM mail intake/outgoing owner no direct writer located any rows/references and provider/local meaning
EXTERNAL_ATTEMPT provider-specific owner no direct writer located registry and unknown-result resolution

The allowed type list is broader than current writer adoption. Do not interpret an allowed enum as an implemented resolver.


10. Required Environment Questions

The source inventory cannot answer:

  • whether all three transition tables exist;
  • whether the applied schema matches source migration;
  • whether foreign keys/check constraints are enforced;
  • whether transition rows exist;
  • whether selected Loader rows are present;
  • whether other process/source rows exist;
  • whether entity/evidence children are orphaned or tenant-mismatched;
  • whether UUID/hash idempotency conflicts exist;
  • whether retention dates match current source calculations;
  • whether legal holds exist;
  • whether referenced business records remain readable;
  • whether KJ diagnostic references resolve to retained logs;
  • whether Operation Event ACK has been treated as approval/completion by a consumer;
  • whether current support roles can read evidence safely.

These questions are owned by:

RBR-AUDIT-002-READONLY-ENVIRONMENT-PREFLIGHT.md

11. Static Result

Transition contract source: PRESENT
Transition store source: PRESENT
Selected Loader writer source: PRESENT
Other direct business writer located: NO
Universal Process coverage: NO
Operation Event writer family: PRESENT
KJ diagnostic family: PRESENT
Environment schema: NOT READ
Environment rows: NOT READ
Diagnostic logs: NOT READ
Retention/legal policy: OPEN

12. Next Step

After exact environment/read authorization:

  1. run environment and schema identity checks;
  2. inspect transition and child distributions by tenant;
  3. characterize selected Loader rows;
  4. inspect evidence-type/relation consistency;
  5. inspect Operation Event ACK/reference boundaries;
  6. inspect KJ diagnostic channel shape and retention without exporting sensitive payloads;
  7. classify the named environment without repair.

No source, row, notification, retention, or support-access change is authorized by this inventory.

---

Source: docs/reconstruction/PLATFORM_AUDIT_CURRENT_WRITER_AND_EVIDENCE_INVENTORY_2026-08-08.md — ctc repository · This page is an English translation of the source document. Identifiers, file paths and code symbols are unchanged.