
Class Society Surveillance — sources, download skill, immutable evidence log, analysis skill, and senior compliance output in one traceable workflow.
Executive summary
Maritime class compliance is the single largest source of operational risk a Technical Superintendent manages. A missed survey can trigger a Condition of Class. An overdue Continuous Machinery Survey item can escalate into a hold. A statutory certificate that lapses at sea is a vessel detention waiting to happen at the next port. The Class Society Surveillance pipeline keeps every vessel’s class state visible, current, and audit-ready. It scrapes the class society’s own portal — ABS today, with the same pattern extending to BV, DNV, LR, CCS, KR, RINA, NK, IRS — pulls the structured data behind every page, captures a screenshot of each page, then runs a battery of analyses that classify surveys and certificates against operating thresholds and produce a senior expert review. The pipeline is designed so every number on the review traces back to a timestamped portal snapshot. Class disputes are won on documentation, not arguments.Architecture
Stage 1 — Data collection
Where the data comes from
Each major class society has a dedicated portal scraper. The pipeline reads from the society directly — no ERP intermediary, no email parsing — so the snapshot matches what the society itself shows.
When a vessel is dual-classed (class with two societies for different statutory items), the pipeline reads both and reconciles by certificate type. The fleet view always renders the primary class first.
Class society logos shown are sourced from Wikimedia Commons / public press kits and used under nominative trademark fair use to identify the respective organisations. Each logo remains the trademark of its owner.
What gets captured
A timestamped screenshot is captured alongside each page so a reviewer can verify the recorded numbers came from the live portal.
Acquisition flow
1
Verify portal reachability
Confirms the class portal is up before launching the scraper. A failed health check stops the run rather than producing partial evidence.
2
Open portal in foreground browser
The user’s Chrome opens to the portal. Useful for live demos and for spot-checking the data the scraper sees.
3
Run headless scraper in parallel
Playwright walks the portal pages in a separate browser context. Every page’s API call is intercepted; the structured response and a full-page screenshot are saved.
4
Bundle into evidence record
JSON + screenshots land in a single timestamped folder. The case file is updated so any reviewer or analyzer knows new evidence is available.
Output structure
Every collection is append-only. Re-running the scraper never overwrites earlier snapshots — historical class state is preserved.
Stage 2 — Analysis battery
The scraper produces evidence; eight analysis templates turn that evidence into actionable intelligence. Each template is independently runnable but they share a common set of primitives — date parsing, status classification, age scoring — so the verdicts compose cleanly into the final review.2.1 Certificate status
Every statutory and class certificate is classified against an effective expiry date. The effective date is the maximum of the issued expiry and any extension on file: The remaining validity in days drives the verdict:Code snapshot
2.2 Survey due dates
Surveys carry an extra dimension certificates don’t: a window period. A vessel is in compliance if a survey is completed within the window, even if the formal due date has passed. The effective date for a survey: Survey verdicts add an “In Window Period” state that certificates don’t have:Code snapshot
2.3 Conditions of Class & findings
Findings are classified by the header they fall under — Conditions of Class are operationally restrictive; Memoranda and Notes are advisory. The classifier reads the criticality field and routes the finding:2.4 Continuous Machinery Survey (CMS)
CMS items are credited if they were last completed within a 365-day window. Otherwise the item is classified by its remaining days, with class-specific date sources: Different class societies use different precedence rules — RINA only honours the original due date, while NK / LR / CCS / IRS / BV / ABS / KR / DNV all consider the extended date if present. The script encodes that per-society logic explicitly.2.5 Docking and next periodical survey
These are special-case surveys that drive dry-dock planning. The same windowing maths applies, but the verdict carries operational weight: an imminent docking survey couples to charter party off-hire, drydock-yard slot booking, and SIRE / vetting calendars.2.6 Survey dashboard rollup
The final step assembles a vessel-level dashboard combining every analysis above into a single status grid: how many overdue, how many due-soon, how many in-window, count per class society. This is what populates the executive summary of the senior review.Stage 3 — PSC detention-risk score
Open findings, overdue items, and impending CoC deadlines compose into a weighted detention-risk composite: where:- — count of surveys overdue
- — open critical findings
- — Conditions of Class within 30 days
- — recurring deficiency themes (3+ findings on same system)
- — recent PSC inspection density at the next port’s regime
Worked example
Vessel:MV POSUN (IMO 9388340), ABS classed, Panama flag.
After a refresh:
The detention-risk composite scores HIGH — driven primarily by the overdue annual hull survey and the 18-day CoC. The pipeline:
- Tags the run with
escalation_required: true - Updates the case to
awaiting-tsi-review, priority CRITICAL - Sends an A2A message to the TSI inbox with links to the snapshot, the dashboard, and the recommended actions
- Schedule annual hull survey at next port — co-ordinate surveyor attendance window. Estimated cost USD 4–6k.
- Steering-gear function test — workshop attendance required before 2026-05-19.
- Turbocharger CMS inspection — book superintendent attendance at next docking window (28 days out).
Output deliverables
The senior review produced by the analyzer contains:- Executive summary — overall class status and headline counts
- Survey status table — per-survey verdict, due date, window
- Certificate portfolio — every certificate with effective expiry and verdict
- Findings analysis — distribution by severity, age, recurring themes
- Conditions of Class — deadlines and remediation plan
- CMS items — credited / overdue / due-soon list
- PSC detention-risk — score, contributing factors, mitigation
- Recommendations — prioritised by deadline and impact, with cost estimate
- Escalation decision — auto-routed to TSI when triggers met
Escalation triggers
Why a script-driven pipeline
Surveys are quantitative — dates and rules. Threshold logic, age clustering, and the per-society precedence rules all live in deterministic Python. The language model interprets the result and writes the review; it never recomputes the verdicts. That keeps reviews consistent across vessels and audits, traceable (every figure in the review traces to a date in the snapshot), and cheap (analysis is a script, not a model call).References
Source skill: class-society-data
Browser scraper that drives the portal and bundles the snapshot.
Source skill: class-society-analyzer
Senior agent that runs the analysis battery and writes the review.
Templates: class_analysis/
Eight analysis templates: certificate status, survey due dates, conditions of class, CMS, docking, periodical, dashboard.
Related: certificates
Statutory and trade certificates not covered by class.


