ZT-559 · Inspection: an approved revision or as-built moves the Inspection that's already waiting

Status Done (2026-11-10)
Ticket ZT-559
Requested by Michael Lowry (Permitting chat review, Oct 14 – Nov 6; Neki's Nov 4 report on 28158); scope settled by KAJ Jacobs's Permitting click review (2026-11-06, item 9)
Made by KAJ Jacobs (Albatross audit data: Populate Revision / As-Built 2026-11-09 16:11–16:14 UTC; Inspection 23:17–23:23 UTC). Asked by Michael Lowry.
Date made 2026-11-09
Sections affected 09 · Inspection and energization (Inspection block: Permit Revision Complete (auto), new banner). Reads a date stamped by 07 · Permitting (ZT-573).
Project types Residential and Battery Only (both use the Inspection block and the Permitting block). R&R isn't affected: R&R Inspection got its own fix on Oct 30 (Revised Permit Approved - Ready to Schedule (auto), Untracked in the changelog).

Depends on ZT-573. Build this with or after ZT-573. ZT-573's new Revision Approved (auto) on Permitting is what stamps Latest Permit Revision Approved (Project Milestones, OSC 4399) for every approved revision and as-built, and only on the day of the approve click. Without ZT-573, only As-Built/Post Install Revision Approved stamps it, and only when Rework Type is filled correctly.

Decisions

  1. Revisions don't open Inspection; it's already open after installation. ZT-559 only moves an Inspection that's waiting (KAJ, 2026-11-06).
  2. Production test on 28349 without a staging run (Michael Lowry, 2026-11-06).
  3. Keep the banner Revised permit approved – new plans required on site (KAJ, 2026-11-06).
  4. Statuses (KAJ, 2026-11-06): move Inspection to Ready to Schedule Re-Inspection from Pending Permit Revision, Ready to Schedule Final Inspection and Pending Final Inspection only. Not Ready to Schedule Final Inspection, Pending All Inspections Passed, Pending M1 Audit, Pending Review or Correction Work, Pending Permit Extension and Pending Rough Inspection stay out.
  5. A Final Inspection already booked (KAJ, 2026-11-06): keep the booked date. The coordinator keeps the date and makes sure the new plans are on site. No different status.
  6. Re-inspection reporting (KAJ, 2026-11-06): will be monitored later. Not a blocker. (Total Number of Re-Inspection counts events, not the status, so it doesn't change: Open Phoenix check 6.)
  7. No-permit revisions (ZT-573 decision 11): a revision or as-built closed with No Permit Required doesn't stamp Latest Permit Revision Approved, so this ticket won't move Inspection for it. Accepted for now; a follow-up ticket if it causes problems.

Request

When Permitting approves an as-built or revised permit, Inspection only reacts if Inspection itself started the revision with Needs Permit Revision (block at Pending Permit Revision). When Engineering starts the as-built (the usual case after install), Inspection stays where it was, often at Pending Final Inspection with the old plans. Permitting thinks it's done, Inspections doesn't know, and KAJ moves the block by hand.

Proposed solution (ticket draft, click review item 9)

  1. Widen Permit Revision Complete (auto) so it also moves Inspection from the waiting statuses, not only Pending Permit Revision.
  2. Settle the Latest Permit Revision Approved EQUAL current Date condition.
  3. Add a banner on Inspection: Revised permit approved – new plans required on site.

Review

Based on the 2026-11-06 production checks in the ticket and the click review (items 6 and 9), 09 · Inspection (generated Oct 26) and the ZT-573, ZT-564 and ZT-558 records. No Phoenix queries were made for this record; open questions are under Open Phoenix checks.

Admin checklist

All on the Inspection block unless stated. Before editing Permit Revision Complete (auto), copy its condition and actions for rollback (also in docs/sections/09-inspection-and-energization.md).

Before you start

  1. ZT-573 is built, or is being built in the same sitting. This auto reads the date ZT-573's Revision Approved (auto) stamps.
  2. Decided (KAJ, 2026-11-06): target Ready to Schedule Re-Inspection, from Pending Permit Revision, Ready to Schedule Final Inspection and Pending Final Inspection only; a booked Final Inspection keeps its date.
  3. Claude runs the Open Phoenix checks below and confirms which date rule to use in step 5 and the banner rule in step 7.

Rules (create as global rules)

  1. Create rule (Process Block: Inspection) System Data: Process Block Object Status IN Pending Permit Revision, Ready to Schedule Final Inspection, Pending Final Inspection (Fail if none exist = false).
  2. Create a global date rule: Custom Field Latest Permit Revision Approved (Project Milestones) GREATER THAN OR EQUAL with value type current date minus X days, X = 7. Albatross shows it as (Project) Custom Field: Project Milestones-Latest Permit Revision Approved GREATER THAN OR EQUAL 7. (No rule can compare with the block's created date; the existing … EQUAL current Date rule is local to Inspection and is the fallback only if the relative rule misbehaves in the test.)

Permit Revision Complete (auto)

  1. Edit Permit Revision Complete (auto) condition to: the step 4 rule AND the step 5 rule. Keep the flags: auto, timed, Allow Reset Run Flag. Keep its action: Change Status → Ready to Schedule Re-Inspection. Rename it Revision Approved - Ready to Schedule Re-Inspection (auto) so its name says what it does (optional).

Banner

  1. Create banner Revised permit approved – new plans required on site on the Inspection block's Inspection Details section, next to Inspection Types Required Blank Banner (position 1). Condition: the step 5 rule. AND not (Process Block: Inspection) System Data: Process Block Object Status IN All Inspections Passed, Canceled. Text: "A revised or as-built permit was approved on [Latest Permit Revision Approved]. Make sure the new approved plans are on site before the inspection. If an inspection is already booked, keep the date and make sure the new plans are there."

Run flag (Phoenix check 3: resets across blocks already exist)

  1. On Permitting, add action Reset Other Control → Permit Revision Complete (auto) (Inspection) to Populate Revision (auto), after its Rework Type action.
  2. Add the same action to Populate As-Built (auto) (Permitting).
  3. On Needs Permit Revision (Inspection), add action Reset Other Control → Permit Revision Complete (auto). Nothing resets it today (check 2).

Test on 28349 (after ZT-573 is built; no staging run)

  1. Note 28349's current Latest Permit Revision Approved, Installation Started and any Inspection block status. 28349 has no Inspection or Permitting block: add an Inspection block at Pending Final Inspection.
  2. Open a Permitting block at Review As-Built and Resubmit, approve its Permit Submission task and click Permits Complete. Expect: Latest Permit Revision Approved = today; Inspection → Ready to Schedule Re-Inspection in the same save (if not, save the project once more and note it); the banner shows.
  3. Move Inspection back to Pending Final Inspection and repeat step 12 with a second Permitting block. Expect it to move again if steps 8–9 were done; otherwise expect it to stay (banner shows) and note it.
  4. Set Inspection to Pending M1 Audit and repeat. Expect no move; banner shows.
  5. Cancel the test Permitting blocks, tasks and Inspection, and restore the values from step 11.

After go-live

  1. Inspection team checks the waiting blocks found in check 5 (27326, 27335, 27585, 27672, 28200, 28550, 28664 at Pending Final Inspection; 28617) and moves any that were missed, like 28158. Claude re-runs the list at go-live.

New SOP

Permitting team: no change. Approve revisions and as-builts with Permits Complete (ZT-573).

Inspection team

  1. When a revised or as-built permit is approved while the job waits at Ready to Schedule Final Inspection or Pending Final Inspection, the job moves to Ready to Schedule Re-Inspection by itself and shows in Ready to Schedule Final w/ Customer.
  2. The Inspection screen shows Revised permit approved – new plans required on site. Make sure the crew or homeowner has the new approved plans on site before the inspection.
  3. If an inspection is already booked, keep the date and make sure the new approved plans are on site for it.
  4. Jobs at Not Ready to Schedule Final Inspection, Pending M1 Audit, correction work or a permit extension don't move. Read the banner and carry on as normal.
  5. If a job didn't move after an approval, move it by hand to Ready to Schedule Re-Inspection and post in the Permitting chat so KAJ can check why.

Outside Albatross: tell the field crew lead that an approved revision means new plans on site before inspection (no change to how they get the plans).

Rollback

  1. Restore Permit Revision Complete (auto)'s condition (and name) from the copy taken before step 6.
  2. Archive the banner Revised permit approved – new plans required on site.
  3. Remove the Reset Other Control actions added in steps 8–10.
  4. The new rules can stay unused.

Open Phoenix checks

Checked against production through Phoenix on 2026-11-06.

  1. Answered: no rule compares a field with a block's created date (option a isn't available). Relative past dates are available: Albatross has a rule value type "current date minus X days" (also "plus X days"), shown in the rule's description as the bare number (e.g. (Process Block: Cancellation) Custom Field: Request Details-Cancellation Request Date LESS THAN OR EQUAL 3). So option b can be built. The existing rule is (Project) Custom Field: Project Milestones-Latest Permit Revision Approved EQUAL current Date (2765), local to Inspection. Latest Permit Revision Approved (OSC 4399) is a Date field.
  2. Answered: Permit Revision Complete (auto) (1164) is auto, timed, Allow Reset Run Flag ticked, not repeatable. Condition: rule 2765 AND (Process Block: Inspection) System Data: Process Block Object Status EQUAL Pending Permit Revision (Fail if none exist = false) (2766, local to Inspection). One action: block → Ready to Schedule Re-Inspection. No messages. Nothing resets it today, including Needs Permit Revision (1163, which creates Permitting at Review Revision and Resubmit and sets Pending Permit Revision). So step 10 must add the reset.
  3. Answered: yes. Reset Other Control already reaches controls on other blocks: Needs a Resurvey (Scope Review) resets three Site Survey autos, Needs Service Work (Energization Visit) resets Service Work Complete (auto) on Energization, and Send to Correction Work (Final Inspection) resets Correction Work Complete (auto) on Inspection. Steps 8 and 9 can be built. Whether the reset then lets the auto fire again is still the ZT-531 caution; test 13 shows it.
  4. Not checked. The nightly run time isn't visible in Phoenix (the cron table can't be read). Whether the auto fires in the approve save is checked after ZT-573 is built, from the 28349 test (control_history for 1164 on that date only).
  5. Answered, in part: the run flag needs control_history, so it's not checked. Inspection blocks waiting at Pending Final Inspection or Ready to Schedule Final Inspection whose project had a Permitting block approved after the Inspection opened, since Oct 1 (8): 27326 (approved Oct 6), 27335 (Oct 19), 27585 (Oct 14), 27672 (Nov 3), 28200 (Oct 6), 28550 (Oct 14), 28664 (Nov 2), all at Pending Final Inspection; and 28617 (Ready to Schedule Final Inspection, approved the day its Inspection opened, so likely already fine). None is at Pending Permit Revision. These are the step 16 list; the Inspection team should check whether each needs new plans on site.
  6. Answered: Total Number of Re-Inspection (field 1302) counts Final and Rough Inspection events on the block against the inspection types selected; it doesn't read the block status. Moving to Ready to Schedule Re-Inspection doesn't change it. Other readers of the status: the queue Ready to Schedule Final w/ Customer; buttons Not Ready to Schedule (241), Needs Plan Revision / As-built (246) and Send to Corrections (779); and the Inspection Pending - Combine Trip banners (Correction Work, Correction Work Appointment, M1 Funding). No auto reads it. Reports outside Albatross can't be seen in Phoenix; KAJ will monitor them after go-live (decision 6).
  7. Answered: Inspection Types Required Blank Banner is at position 1 of the Inspection Details section.
  8. Answered, in part: 28349 has no Inspection block (and no Permitting block), so the test must add both. 1164's condition has no project-status rule; whether Albatross runs autos on a canceled project at all is a UI check, shown by the test.

Checklist changed by the Phoenix check: step 5 now uses option b (a "current date minus 7 days" rule), since option a doesn't exist; step 7 names the Inspection Details section; steps 8 and 9 are possible (cross-block resets exist), so they're no longer conditional; step 10 adds the reset to Needs Permit Revision (it doesn't have one); step 11 adds a Permitting block as well; step 16 has its list.

Checklist changed by KAJ's decisions (2026-11-06): step 2 is decided; step 4 drops the optional Not Ready to Schedule Final Inspection; the banner (step 7) and the SOP keep a booked inspection date.

Config check

Config check, 2026-11-10 (Claude, Phoenix): pass.