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
- Revisions don't open Inspection; it's already open after installation. ZT-559 only moves an Inspection that's waiting (KAJ, 2026-11-06).
- Production test on 28349 without a staging run (Michael Lowry, 2026-11-06).
- Keep the banner Revised permit approved – new plans required on site (KAJ, 2026-11-06).
- 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.
- 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.
- 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.)
- 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)
- Widen Permit Revision Complete (auto) so it also moves Inspection from the waiting statuses, not only Pending Permit Revision.
- Settle the
Latest Permit Revision Approved EQUAL current Datecondition. - 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.
- Statuses and controls today (Inspection block):
- Needs Permit Revision (button): block at Ready to Schedule Final Inspection, Not Ready to Schedule Final Inspection or Pending All Inspections Passed, or Scope Review active. Creates Permitting at Review Revision and Resubmit; block → Pending Permit Revision. Pending Permit Revision has no queue and 0 live projects, so this path is rarely used.
- Permit Revision Complete (auto) (auto, timed, Allow Reset Run Flag):
[(Project) Project Milestones-Latest Permit Revision Approved EQUAL current Date]and block at Pending Permit Revision. Block → Ready to Schedule Re-Inspection. No messages are known (check 2). - Waiting statuses and live counts (Oct 26): Pending Final Inspection 173 (ON HOLD, no queue), Not Ready to Schedule Final Inspection 49 (14-day queue), Ready to Schedule Final Inspection 25 and Ready to Schedule Re-Inspection 7 (both in Ready to Schedule Final w/ Customer, 5 days).
- What goes wrong: 28158. Engineering opened the as-built Permitting block Sep 22; Inspection went to Pending Final Inspection Sep 28; Neki approved the as-built Nov 4; Inspection didn't move; KAJ set it to Ready to Schedule Re-Inspection by hand. Pending Final Inspection has no queue, so nobody would have seen it.
- How ZT-573 changes the input: after ZT-573, Revision Approved (auto) stamps Latest Permit Revision Approved (OSC 4399) = now whenever a Permitting block with Rework Type filled reaches All Permits Approved in that save (its condition needs the block's All Permits Approved, OSC 626, to equal today). So the date is stamped once per approved revision or as-built, on the day of approval, before or after installation. Old blocks are never re-stamped. That makes "the date equals today" a fair signal for "a revision was approved today".
- The "equals today" condition:
- Why it's fragile: an auto only runs when the project is saved or, if timed, on the nightly run (DOC-GUIDE, "When auto controls run"). The approve click is a save, so if Inspection's auto is evaluated after Permitting's Revision Approved (auto) in the same save, it fires straight away. If it isn't, it waits for the next save that day or the nightly run, and if the nightly run is after midnight, the date no longer equals today and it never fires.
- Better: a rule meaning "Latest Permit Revision Approved is later than the day the Inspection block was created". That would also stop a pre-install revision moving an Inspection opened later. Whether Albatross rules can compare a field with the block's created date isn't known (check 1).
- Fallback: a "within the last few days" rule (for example Latest Permit Revision Approved no more than 7 days ago), if relative past-date rules exist (check 1). The once-per-block run flag still stops repeats.
- If neither exists, keep
EQUAL current Date. The banner (step 7) still shows, and the test (step 12) shows whether the same-save firing works.
- Run flag (once per block): the auto fires once per Inspection block. Today Needs Permit Revision probably resets it (check 2). On the new path nothing resets it, so a second revision on the same Inspection block wouldn't move it. Options:
- Add Reset Other Control → Permit Revision Complete (auto) (Inspection) to Permitting's Populate Revision (auto) and Populate As-Built (auto) (they fire once when each revision block opens, per ZT-573). Only possible if a reset can name a control on another block (check 3).
- Otherwise accept it: the second revision on one Inspection block is rare; the banner shows and the team moves it by hand.
- Caution: in the ZT-531 test on 28349 a reset auto did not fire again (raised with Red Oak). Step 12 tests it.
- Statuses the auto moves from (decision 4): Pending Permit Revision (today's path), Ready to Schedule Final Inspection, Pending Final Inspection. Ready to Schedule Re-Inspection is already the target. Not Ready to Schedule Final Inspection stays out: the team parks jobs there for other reasons, and Open Inspection after As-Built Approved (auto) opens a new Inspection there in the same save as the approval.
- Downstream blocks:
- Open Inspection after As-Built Approved (auto) (Permitting, kept by ZT-573) opens a new Inspection at Not Ready to Schedule Final Inspection when no Inspection is active. With Not Ready left out, the widened auto doesn't touch it.
- No block is created or closed by this change. Final Inspection events stay as they are.
- Battery Only: covered. ZT-573 archives All Permits Approved (Battery Only); battery-only jobs use Permits Complete, which stamps OSC 626, so Revision Approved (auto) fires for them too.
- Fit with ZT-564 (same block): ZT-564 edits Permit Extension Complete (auto), adds a reset to Needs Permit Extension, and puts Pending Permit Extension in a queue. This ticket doesn't touch any of those, and leaves Pending Permit Extension out. If an as-built opened by Extension Not Needed - Ready to Submit As-Built is approved, ZT-564 releases Inspection to Ready to Schedule Final Inspection; in the same save this auto may then move it on to Ready to Schedule Re-Inspection. Both sit in the same queue, so either result is fine.
- Fit with ZT-558: ZT-558 only changes Permitting, Plan Set and Engineering Stamps. No overlap on Inspection.
- Fields: none created or changed. Read: Latest Permit Revision Approved (Project Milestones, OSC 4399). The auto sets no field values.
- Work queues: no status added or removed. Jobs moved from Pending Final Inspection (no queue) to Ready to Schedule Re-Inspection appear in Ready to Schedule Final w/ Customer (5 days). That's the point of the change.
- Customer and rep messages: none from this change. The Inspection team calls the homeowner from the queue as normal.
- Projects in flight: only blocks where Latest Permit Revision Approved matches the date rule move. With
EQUAL current Date, only revisions approved on go-live day. With a 7-day window, any waiting Inspection whose project had a revision approved in the last 7 days moves on its next save (count in check 5). Blocks where the auto already ran once won't move (check 5). - Money and integrations: none. Nothing named Send to…, no pay milestones.
- Reporting: Total Number of Re-Inspection doesn't change (it counts events). Other re-inspection reports will be monitored after go-live (decision 6).
- Project types: Residential and Battery Only. R&R not affected.
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
- ZT-573 is built, or is being built in the same sitting. This auto reads the date ZT-573's Revision Approved (auto) stamps.
- 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.
- 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)
- 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). - 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 Daterule is local to Inspection and is the fallback only if the relative rule misbehaves in the test.)
Permit Revision Complete (auto)
- 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
- 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)
- On Permitting, add action Reset Other Control → Permit Revision Complete (auto) (Inspection) to Populate Revision (auto), after its Rework Type action.
- Add the same action to Populate As-Built (auto) (Permitting).
- 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)
- 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.
- 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.
- 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.
- Set Inspection to Pending M1 Audit and repeat. Expect no move; banner shows.
- Cancel the test Permitting blocks, tasks and Inspection, and restore the values from step 11.
After go-live
- 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
- 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.
- 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.
- If an inspection is already booked, keep the date and make sure the new approved plans are on site for it.
- 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.
- 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
- Restore Permit Revision Complete (auto)'s condition (and name) from the copy taken before step 6.
- Archive the banner Revised permit approved – new plans required on site.
- Remove the Reset Other Control actions added in steps 8–10.
- The new rules can stay unused.
Open Phoenix checks
Checked against production through Phoenix on 2026-11-06.
- 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. - 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. - 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.
- 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_historyfor 1164 on that date only). - 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. - 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).
- Answered: Inspection Types Required Blank Banner is at position 1 of the Inspection Details section.
- 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
- Built 2026-11-09 (KAJ via Chrome, steps 4–8).
- Permit Revision Complete (auto) now moves Inspection to Ready to Schedule Re-Inspection from Pending Permit Revision, Ready to Schedule Final Inspection or Pending Final Inspection, when Latest Permit Revision Approved is within the last 7 days. It's still auto + timed + Allow Reset.
- New banner Revised permit approved – new plans required on site: it can't show the date, so its text points to the field.
- Populate Revision (auto) now resets the Inspection auto.
- A new global copy of the rule "Inspection status IN All Inspections Passed, Canceled" was created for the banner.
- Steps 9–10: done. Populate As-Built (auto) and Needs Permit Revision both reset Permit Revision Complete (auto) (Needs Permit Revision already did, since July).
- Left for KAJ: drag the banner to the top of Inspection Details. Rename the three unused duplicate rules to "DO NOT USE": two from this ticket (one with R&R's Pending Permit Revision, one an exact copy, made by a second Chrome tab running the same brief) and one from ZT-558. The banner is now at the top of Inspection Details.
- Go-live check: tonight's run can move only 27753. Its Inspection is at Ready to Schedule Final Inspection, and its revision was approved 11/03, after the Inspection opened. That's the intended case.
- Note: status names repeat in the rule builder (for example two Pending Permit Revision statuses). Check status IDs after saving.
- Overnight check, 2026-11-10: passed. At 09:13 UTC the timed run moved 27753's Inspection from Ready to Schedule Final Inspection to Ready to Schedule Re-Inspection. ZT-559 works.
- Duplicate rules not renamed (2026-11-10): the Global Requirements page doesn't show rule ids, so the unused copies can't be told apart from the ones in use. Left as is. They're unused and harmless, but when picking these rules in the builder, check the id in Phoenix afterwards.
Config check, 2026-11-10 (Claude, Phoenix): pass.
- Before you start (steps 1, 3): pass. ZT-573 was built the same day, 16:08–19:48 UTC, before this.
- Rules (steps 4–5): pass.
(Process Block: Inspection) System Data: Process Block Object Status IN Pending Final Inspection, Pending Permit Revision, Ready to Schedule Final Inspectionand(Project) Custom Field: Project Milestones-Latest Permit Revision Approved GREATER THAN OR EQUAL 7exist, both global. - Permit Revision Complete (auto) (1164, step 6): pass. Condition is the step 4 rule AND the step 5 rule. Auto, timed, Allow Reset Run Flag. Action: block → Ready to Schedule Re-Inspection. Not renamed (optional step).
- Banner (1638, step 7): pass. Revised permit approved – new plans required on site, on Inspection Details at position 1. Condition: step 5 rule AND NOT Inspection at All Inspections Passed / Canceled. Text says to see Latest Permit Revision Approved on Project Milestones in place of the date.
- Run flag (steps 8–10): pass. Populate Revision (auto) (258) and Populate As-Built (auto) (471) now end with Reset Other Control → Permit Revision Complete (auto). Needs Permit Revision (1163) already had that reset (since 2026-07-23), so step 10 needed no change.
- Limit: a second approved revision on the same Inspection block may not move it again. Populate Revision (auto) and Populate As-Built (auto) run on open Permitting blocks and do fire, so the reset is sent, but a reset auto control hasn't been seen to fire a second time (ZT-531). The banner still shows.
- Tests (steps 11–15): replaced by the next-day check, as on ZT-558. Since go-live, 1164 has been evaluated on 172 projects and fired once, on 27753 (2026-11-10 09:13 UTC, the nightly run).
- After go-live (step 16): the Inspection team still needs to check the blocks waiting from check 5 (27326, 27335, 27585, 27672, 28200, 28550, 28664, 28617). Not re-run here.