-
-
02-start-with-the-operation
-
05-plan-before-searching
-
14-built-with-codex-powered-by-gpt-5-6
-
03-structure-material-facts
-
01-regtrace-overview
-
04-keep-uncertainty-visible
-
06-show-every-tool-call
-
10-correct-facts-explicitly
-
11-update-without-losing-audit-trail
-
12-open-the-exact-provision
-
13-export-reviewable-case-file
-
07-distinguish-source-authority
-
08-return-a-typed-verdict
-
09-gate-every-material-claim
Inspiration
In day-to-day airline operations, groups such as flight crews, dispatchers, and flight standards teams regularly need to reference regulations while dealing with operational scenarios.
These questions rarely arrive with a regulation number attached. Teams usually start with an operational problem and search by keywords. The answer may span the Aeronautics Act, Canadian Aviation Regulations, Commercial Air Service Standards, advisory circulars, and Transport Canada manuals. RegTrace currently focuses on Canadian airlines and operators.
Finding a section is only the first step. Teams still need to identify missing facts, determine which sources are binding, reconcile related provisions, and preserve a defensible trail back to the official text.
I originally built FlightRef as a side project to make these regulations easier to search. During Build Week, I extended that foundation with RegTrace so the application could investigate an operational scenario instead of simply returning search results.
What it does
RegTrace turns an operational problem into a structured, citation-gated regulatory investigation. It translates the facts of the scenario and connects them to the applicable regulations and supporting material.
A user describes the situation in plain language. RegTrace:
- extracts relevant facts such as aircraft type, type of operation, and duty time while flagging uncertainty;
- asks up to three focused questions when missing facts could change the answer;
- creates an investigation plan;
- searches a 44-document Canadian aviation corpus using purpose-built tools;
- reads exact sections and follows related documents;
- distinguishes Acts, Regulations, Standards, Advisory material, and Guidance by authority tier;
- returns a verdict of supported, conditional, insufficient, or conflicting;
- deep-links every accepted basis claim to the exact source section; and
- produces a printable RegTrace Case File for future reference.
Users can correct extracted facts or add operational details and update the answer without starting over. The previous verdict remains visible while the revised investigation runs.
RegTrace is an investigation aid, not a legal determination. Users are directed to verify results against official Transport Canada and Justice Laws publications.
How I built it
RegTrace is an OpenAI-powered extension to FlightRef, an existing Next.js application that I built as a side project to improve how Canadian aviation regulations are searched and reviewed.
GPT-5.6 runs the investigation through the OpenAI Responses API. Structured outputs support separate fact-extraction, gap-analysis, planning, and verdict phases. Function calling gives the model four bounded evidence tools: regulation search, exact-section reading, related-document lookup, and definition lookup. The retrieval layer combines PostgreSQL full-text search with pgvector search in Supabase.
The server streams typed events to the interface over SSE so users can see the extracted facts, clarification questions, investigation plan, tool activity, evidence, and verdict progress. Citation gating checks every model-proposed reference against evidence actually returned by the tools and removes unsupported references before display.
Zod validates API inputs and model outputs, while authenticated routes, usage limits, and friendly failure states protect the live service.
The product uses Next.js 14, TypeScript, React, Tailwind CSS, Supabase, PostgreSQL, pgvector, the OpenAI Responses API, GPT-5.6, and Vercel.
How I used Codex
Codex was my engineering collaborator throughout Build Week. I used it to turn the RegTrace design into a task-by-task implementation plan, implement the typed orchestration and retrieval tools, build the investigation interface, add editable fact refinement and progress states, write tests, harden citation grounding, and run browser and production QA.
I also used Codex to help create and render the final demonstration video.
The repository preserves the development evidence. REGTRACE_TASKS.md maps implementation tasks to Codex session IDs and commits, while the README and Git history distinguish the pre-existing FlightRef foundation from the RegTrace work completed during the submission window.
Challenges I ran into
The hardest problem I encountered was making an answer auditable rather than merely plausible. A model can generate a convincing section number that was never retrieved. I therefore decided that tool output would be the only admissible evidence and that every proposed citation had to be verified before it could be displayed.
Another challenge was representing legal authority accurately without presenting advisory guidance as binding law. I addressed this by keeping Acts, Regulations, Standards, Advisory material, and Guidance visibly separated by authority tier.
I also had to make a multi-phase investigation understandable while it streamed, preserve state across clarification and refinement, and keep the previous answer available while a revised verdict was being generated.
Accomplishments I’m proud of
- Citation-gated verdicts with exact reader deep links and visible authority tiers.
- A structured investigation workflow instead of a single prompt-and-response screen.
- Editable extracted facts and answer regeneration with explicit user-provided provenance.
- Live rehearsals covering fatigue, MEL, ground-icing, and line-check scenarios.
- All 35 unique citation links from those rehearsals opened the intended source sections.
- Live end-to-end investigations completed in approximately 34–53 seconds during recorded QA.
- A clear repository history separating the pre-existing FlightRef foundation from the Build Week implementation.
What I learned
I learned that a fixed-phase agent with constrained tools is more dependable for regulatory work than asking one large prompt to reason, retrieve evidence, and cite sources at the same time.
I also learned that uncertainty must remain visible. When a missing operational fact could change the outcome, asking one focused question is more useful than producing a confident answer based on an assumption.
The biggest lesson was that citations alone are not enough to create trust. Users also need editable facts, visible progress, authority labels, exact source links, and a reproducible evidence trail.
What's next for RegTrace
My next steps are persisted and shareable case files, deeper section-level cross-reference extraction, source-version conflict detection, support for additional jurisdictions, and voice input for operational scenarios.
I also want to expand the current 44-document corpus to cover more Transport Canada publications and regulatory material.
Built With
- codex
- gpt-5.6
- next.js
- openai-responses-api
- pgvector
- playwright
- postgresql
- react
- supabase
- tailwind-css
- typescript
- vercel
- vitest
- zod