Inspiration

Film and TV productions that cast minors operate under a real, expensive constraint: child labor law dictates exactly how many hours a minor can work, when they must stop, and how those rules shift by age and by whether it's a school day. A production manager juggling a dozen schedule changes a day has no realistic way to hold all of that in their head, and a single missed curfew or overtime violation isn't a paperwork problem, it's a legal one. We wanted an agent that reads a plain-English schedule change and tells you, with the actual statute in hand, whether it's safe to make.

What it does

Minor Working-Hour Auditor is a compliance co-pilot. A production manager types a schedule change in natural language, for example "Extend Rowan Castellan's shoot on 2026-08-25 from 08:00-16:00 to 08:00-17:00", and the agent:

  1. Identifies the cast member and looks up their age and the day's shoot details.
  2. Determines the governing labor-law rule for that age band and day type (school day vs. non-school day).
  3. Calculates the compliance delta (hours worked, wrap time, rest between calls) against the statutory ceiling.
  4. Returns a structured Audit Report: compliant or violating, which statute governs, and, critically, whether the applicable law is settled or contested.

That last point is the feature we think matters most. California's own labor code doesn't fully agree with itself: Title 8 of the California Code of Regulations, Section 11760, permits up to 10 hours at the workplace for a 16-17 year-old on a school day (6hr work + 3hr schooling + 1hr rest), while California Labor Code Section 1308.7 caps total daily employment at 8 hours, a direct, unresolved 1-hour conflict. Rather than silently picking a side, the agent surfaces this as rule_confidence: contested_interpretation, cites both statutes, explains the "more-protective-governs" interpretive canon it's applying, and flags it for human legal review. We found and sourced this exact same conflict independently on the non-school-day version of the same age band, and the agent flags that identically. An agent that quietly resolves genuine statutory ambiguity and hands back a false "compliant" or "violation" is worse than useless in a legal-adjacent tool, it's a liability. Ours tells you when the law itself isn't settled.

How we built it

  • LLM Engine: Google Gemini 3.6 Flash via the google-genai Python SDK, driven by a manual tool-calling loop (not an agent framework) so every SQL query and every reasoning step is inspectable. That mattered both for debugging and for making the agent's work legible to judges.
  • Data layer: ClickHouse, queried exclusively through the Model Context Protocol. The agent has a single frozen tool, run_select_query(sql: str), exposed over a stdio MCP server with a hard-enforced read-only guardrail (SQL keyword allow/deny-listing) so the agent can query cast data and labor law but can never write to the database.
  • Schema: Three flat tables, cast_members, daily_schedule, labor_law_rules, deliberately denormalized so the LLM never has to reason through complex joins, and deliberately jurisdiction-agnostic (state is a lookup key, not a hardcoded assumption) so adding another jurisdiction later is a data change, not a redesign.
  • Frontend: Streamlit, including a built-in "Agent Reasoning & MCP Execution Trace" panel that shows the exact dynamic SQL Gemini generated and the exact rows ClickHouse returned for every audit. Full transparency into what the agent actually did, not just what it claims to have done.
  • Workflow: Built with Antigravity (Google's coding agent) driving parallel worktree slices with a frozen contract between them. The ClickHouse/MCP layer and the Gemini/Streamlit layer were built independently against a schema and tool signature we locked up front, then verified against each other by reading the actual diffs, not by trusting either agent's self-reported summary.

Data sources

Labor law data for California is sourced directly from primary legal text, not secondary summaries or LLM training-data recall:

  • Title 8, California Code of Regulations, Section 11760 (Working Hours of Minors in Entertainment): official text via dir.ca.gov
  • California Labor Code Section 1308.7: verified against the verbatim statute text (not a secondary paraphrase, which we found to contain at least one real error. An early source we checked claimed the non-school-night curfew extension applied only to 16-17 year-olds, which turned out to be the scope of a different statute, Section 1391; the actual Section 1308.7 text has no age qualifier)

Every row in labor_law_rules carries its source citation inline, including an explicit note when a figure represents an interpretive reconciliation between two provisions rather than a single unambiguous source.

Challenges we ran into

  • The statutory conflict itself. Reconciling Section 11760 and Section 1308.7 for the 16-17/school-day band required an actual interpretive judgment call (the "more-protective-governs" canon), which we made deliberately visible in the product rather than hiding it behind a single computed number.
  • A live model deprecation, mid-build. gemini-2.5-flash, what we'd built and documented against, returned a 404 for new API keys partway through development, with Google's own error pointing us to gemini-3.6-flash. We caught this via an actual live smoke test against a real API key, not just a diff review, and it's the kind of bug that a demo run without live testing would have shipped straight into the judging video.
  • Secondary-source legal research is unreliable. One of our early web sources incorrectly scoped Section 1308.7's curfew extension to 16-17 year-olds only. We caught the discrepancy by cross-checking against the verbatim statute text rather than trusting a single summary, a reminder that for a compliance tool, primary sources aren't optional.

Accomplishments that we're proud of

  • A working, end-to-end agentic pipeline: natural language in, real MCP-driven ClickHouse queries, real Gemini reasoning, structured compliance verdict out, verified with a live smoke test against real infrastructure, not just code review.
  • A legal-nuance feature (contested interpretation flagging) that we believe is genuinely non-obvious. It would have been easier, and would have looked "more correct" in a quick demo, to just pick an answer and move on.
  • A schema and data-sourcing pattern designed from day one to extend beyond California without a rewrite.

What we learned

Corners cut in legal-domain agent tooling show up specifically as false confidence. An agent that's always sure is more dangerous than one that knows when it's uncertain. We also learned, concretely, that "verify with a live smoke test" isn't a nice-to-have step for an agent-built application. It caught a real, deadline-relevant bug (the model deprecation) that a pure diff review would have missed entirely.

What's next

The schema's state field means expanding beyond California is additive, not architectural: source seed_data_<COUNTRY>.sql per jurisdiction following the same pattern (primary-source citations, explicit conflict flagging via rule_confidence, verified against real audit scenarios before merging). We scoped this hackathon submission to California specifically because we'd rather ship one jurisdiction that's genuinely correct than several that are shallow. Post-hackathon, natural next steps also include write-back capability (currently read-only by design), a secondary agent for SAG-AFTRA meal-penalty rules, and PDF call-sheet ingestion via Document AI.

What we learned

What's next for Minor Working-Hour Auditor

Built With

Share this project:

Updates

Submission history