Ensure that when an inspection is rescheduled after a client has already signed, the client portal and internal surfaces reflect outdated agreement state and prompt or block per product rules for stale agreements, so teams and clients are not shown a false “all signed” story.
Stale agreements are supposed to be detectable when job facts used in merge templates change. Today that story breaks for portal users after a date move.
datetime changes enqueue queueAgreementStaleCheck in attik-backend/src/events/streamHandlers/inspectionStream.ts, which runs delayed hash checks in attik-backend/src/events/bullmq/agreementStaleWorker.ts against merged agreement content and contentHash on attik-backend/src/models/agreementSchema.ts.jobCreationType === 'attik'; other job origins never enter that path.sectionStatus.agreementsSigned in attik-frontend/src/app/client/job/[slug]/page.tsx from status === 'signed' (or Spectora buyer_signed) and does not treat isStale as blocking completion, so the portal can show agreements as done while work order tooling still flags stale rows in attik-frontend/src/app/tools/inspections/[id]/components/Agreements.tsx.Backend
datetime and whether change streams always fire for those updates; verify queueAgreementStaleCheck runs and agreementStaleWorker marks or clears isStale as intended for the reported inspection IDs.attik-backend/src/events/streamHandlers/agreementStream.ts (inspection.agreement.present / signed) in case portal consumers rely on synced fields instead of per-agreement isStale.Frontend
attik-frontend/src/app/client/job/[slug]/page.tsx, attik-frontend/src/app/client/job/[slug]/components/JobAccordion.tsx, attik-frontend/src/app/client/job/[slug]/components/Timeline.tsx, and routes under attik-frontend/src/app/client/job/[slug]/agreement/) so stale signed agreements cannot present as fully complete without an explicit outdated or re-sign path, matching product expectations.attik-backend/src/events/streamHandlers/inspectionStream.tsattik-backend/src/events/bullmq/agreementStaleWorker.tsattik-backend/src/models/agreementSchema.tsattik-backend/src/events/streamHandlers/agreementStream.tsattik-frontend/src/app/client/job/[slug]/page.tsxattik-frontend/src/app/tools/inspections/[id]/components/Agreements.tsxThe Monday kickoff surfaced a related failure mode that raises the severity of this area. Chris explained that the team changed signed agreements to save the rendered HTML at signature time so the signed copy cannot silently change later. The remaining gap is that agreement-change detection still runs against the underlying blocks rather than the saved signed HTML path, which can break the expected re-sign flow and creates legal risk if agreement contents change after signature without the system requiring a new agreement.
Please authenticate to join the conversation.
Completed
Main App
About 2 months ago
Linear
Get notified by email when there are changes.
Completed
Main App
About 2 months ago
Linear
Get notified by email when there are changes.