Hermes 284313f908
Some checks are pending
Bidi Control Character Guard / bidi-control-guard (push) Waiting to run
Circular Dependency Check / Check for new circular dependencies (push) Waiting to run
Citus Migration Smoke / Combined migrations on single-node Citus (push) Waiting to run
E2E Fresh Install Tests / fresh-install-e2e (push) Waiting to run
ext-v2 guardrails / Run ext-v2 guard and ESLint (push) Waiting to run
Integration Tests / Check for relevant changes (push) Waiting to run
Integration Tests / ${{ (github.event_name == 'schedule' || github.event.inputs.suite == 'full') && 'Full integration suite' || 'Tier-1 integration subset' }} (push) Blocked by required conditions
Mobile checks / Mobile lint + typecheck (push) Waiting to run
Mobile checks / Mobile unit tests (push) Waiting to run
Mobile checks / Mobile dependency audit (report) (push) Waiting to run
Mobile checks / Mobile reproducibility checks (push) Waiting to run
Secrets guard (env backups) / Ensure no tracked env backup files (push) Waiting to run
Temporal Readiness / fast-readiness (push) Waiting to run
Temporal Readiness / docker-parity (push) Waiting to run
TypeScript Type Check / Nx affected typecheck (push) Waiting to run
Unit Tests / Skipped-test budget (push) Waiting to run
Unit Tests / Nx affected unit tests (push) Waiting to run
Unit Tests / Server unit coverage (informational) (push) Waiting to run
Validate Tenant Management Schema / Check for relevant changes (push) Waiting to run
Validate Tenant Management Schema / Validate Tenant Management Schema (push) Blocked by required conditions
EE Workflows Build Guard / ee-workflows-build-guard (push) Waiting to run
Initial import of AlgaPSA codebase from PSA server
Excluded: .git, node_modules, secrets/, compose.env, assemblyscript tgz

Source: /opt/alga-psa on psa.joliet.tech
2026-06-22 16:12:17 -05:00

3.1 KiB

Recurring Service-Period Troubleshooting Runbook

Purpose

This runbook covers the staged-rollout period where future recurring work is materialized in recurring_service_periods, but not every downstream workflow has been fully rewritten around that ledger yet.

Use it to diagnose:

  • missing future materialized rows
  • preserved user edits that now conflict with regenerated candidates
  • unexpected gaps or overlaps after regeneration
  • billed rows whose invoice linkage looks wrong

Generation Failure Triage

  1. Query recurring_service_periods by tenant, obligation_id, obligation_type, and schedule_key.
  2. Confirm whether future active rows exist at all.
  3. Compare source_rule_version and source_run_key across the active future set.
  4. Distinguish ordinary missing future rows from continuity problems that need repair.

Suggested query:

select
  record_id,
  lifecycle_state,
  service_period_start,
  service_period_end,
  invoice_window_start,
  invoice_window_end,
  provenance_kind,
  reason_code,
  source_rule_version,
  source_run_key,
  supersedes_record_id
from recurring_service_periods
where tenant = :tenant
  and obligation_id = :obligation_id
order by service_period_start, revision;

Override Conflict Investigation

When regeneration preserved an edited row, inspect the conflict kind before attempting repair.

The v1 conflict kinds are:

  • missing_candidate
  • service_period_mismatch
  • invoice_window_mismatch
  • activity_window_mismatch

Treat the preserved edited row as the active future truth until a deliberate repair step supersedes it.

Regeneration Troubleshooting

When source rules changed and the future schedule looks wrong:

  1. Check whether the row was eligible for ordinary regeneration.
  2. Use supersedes_record_id to follow revision lineage.
  3. Separate continuity repair from ordinary regeneration.

Ordinary regeneration may replace generated future rows, but it must not silently repair continuity drift or overwrite preserved edits.

Invoice Linkage Repair Triage

If billed history looks inconsistent:

  1. Load the billed row from recurring_service_periods.
  2. Confirm invoice_id, invoice_charge_id, and invoice_charge_detail_id are either all present or all null.
  3. Join the row to invoice_charge_details.
  4. If the linkage is wrong, use invoice_linkage_repair; do not mutate the billed row through ordinary edit or regeneration flows.

Suggested query:

select
  rsp.record_id,
  rsp.lifecycle_state,
  rsp.invoice_id,
  rsp.invoice_charge_id,
  rsp.invoice_charge_detail_id,
  icd.item_detail_id,
  icd.service_period_start,
  icd.service_period_end
from recurring_service_periods rsp
left join invoice_charge_details icd
  on icd.tenant = rsp.tenant
 and icd.item_detail_id = rsp.invoice_charge_detail_id
where rsp.tenant = :tenant
  and rsp.record_id = :record_id;

Guardrails

  • Do not delete canonical invoice_charge_details rows to make persisted linkage look cleaner.
  • Do not rewrite billed historical coverage through ordinary regeneration.
  • Do not treat edited future rows as disposable staging data.