Skip to content
Data

Every Fact Needs a Source and a Date

14 min read

In short: PYOKO tells visitors which of 107 Tokyo museums should be open on the day they pick. This post is about the rules that decide what data may enter it: a class for every finding, a dated record for every check, CI gates, and checks against the day a visitor will actually go. AI agents can propose facts; none ships without evidence and a human decision. It is the same kind of work I did on data infrastructure before.

Even when every official website is correct, piecing them together does not necessarily give you a correct plan.

On 21 July 2026, a Tuesday, I bought Tokyo’s Grutto Pass, a museum pass that covers 107 venues. It costs ¥2,500 and is valid for two months from first use (until 31 March 2027 at the latest); most venues let you in free and the rest give a discount.

Grutto Pass usage log

The day before, 20 July, was Marine Day, a Monday public holiday. Many Tokyo museums close on Mondays, and when Monday is a holiday they close on Tuesday instead. Here the closing day itself moves with the holidays, so the same museum can be open one Tuesday and shut the next — which is why planning a museum day in Tokyo takes more checking. Each museum’s own site said so correctly. But to find out where I could actually go that afternoon, I had to open dozens of them one by one.

So I built PYOKO, an unofficial guide that answers one question: which of these venues are expected to be open at the date and time you choose, and what does the Pass cover there? To help you decide, it also lists what is on, from current exhibitions to guided tours and workshops at some venues. As of 11 November 2026 it holds 92 dated check batches (a record of each check against an official site) and runs a freshness monitor every morning. AI coding agents wrote almost all of its code; I set the rules for what data they may ship, and I make the final call.

This post is not about how agents write code. That gets its own post. This one is about how I decide which data may enter the product — the rules that keep it trustworthy. They all come down to one sentence.

Every fact needs a source and a date. AI can propose a fact; it cannot decide one.

One missing year once made PYOKO treat a 2026 closure as if it would happen again in 2027. Most of what follows is about stopping mistakes like that one.

What PYOKO is

PYOKO is a static site in Japanese, English and Chinese. For each venue it shows whether it is expected to be open at a chosen date and time, based on published schedules and known exceptions, until when, what is on, and what the Pass covers.

PYOKO venue listing

Behind that is a small data pipeline, and the hard part is not moving data but deciding what is allowed to become a fact.

A fact reaches visitors only after a source check, CI and a human review: official pages, daily monitor, agent checks, check batch + PR, CI gate, owner review, release gate, pyoko.jp

Agents do most of the work along the top row. By my rules, a fact needs a dated source record to cross into the bottom row (CI blocks a change to a fact file unless it adds a new check batch or every commit declares that no fact changed; CI cannot tell whether that batch actually supports the change, so that stays the reviewer’s call). Nothing reaches visitors without a human decision.

Data sources: who to trust, and staying consistent

The Pass operator: what the pass covers

The operator’s PDFs

The Pass’s official page is on the website of the Tokyo Metropolitan Foundation for History and Culture: https://www.rekibun.or.jp/grutto/

I originally built PYOKO for personal use, drawing mainly on two PDFs that the operator publishes. The first lists each venue’s Pass benefit — free entry, a discount, or a fee — and runs to seven pages. The second, 23 pages in its August edition, lists the eligible exhibitions with their dates. Unlike museum passes in other cities, the Grutto Pass ties some benefits to specific exhibitions: Ueno-no-Mori only accepts the Pass for certain shows, and Tokyo Metropolitan Art Museum had only one Pass-eligible exhibition in the second half of 2026. You cannot simply look up a venue; you have to cross-reference the exhibition schedule.

The benefits PDF: which venues give free entry, which give a discount, and what the discount is.

The benefits PDF: which venues give free entry, which give a discount, and what the discount is.

The exhibitions PDF: which exhibitions are eligible, with dates and special conditions. This is what you would have to read through every time you plan a visit.

The exhibitions PDF: which exhibitions are eligible, with dates and special conditions. This is what you would have to read through every time you plan a visit.

I built the first version in July, when only the March edition of the exhibition PDF was available. When the August edition arrived, rather than asking an AI model to compare it with the whole site in one shot — which produced mostly false alarms — I worked with agents step by step, making each stage small enough to verify:

  1. Data extraction. Turn the PDF into structured rows, then check the count: 107 facility numbers against 109 rows, and every difference explained before going on.
  2. Atomization. Split the rows into hundreds of single facts: one title, one date range, one fee, one Pass benefit.
  3. Reconciliation. Find where each fact lives in PYOKO. Exhibition names, dates and opening arrangements are checked against the venue’s own page; Pass eligibility and benefit terms are checked against the operator’s published materials. When two sources contradict each other, both are recorded, and no unsettled judgment is treated as fact.

The staged version found real problems: three venues still showed provisional exhibition titles that had since been finalized. It also showed where not to act. For one museum, the official page and the PDF disagreed, so I kept both sides on record and changed nothing until the venue settled it.

The operator’s monthly blog sometimes announces new Pass-eligible shows or changed conditions before the next PDF edition, so a monthly skill reads it and double-checks each finding against the venue’s own official page.

Each venue’s own website: when they are actually open

The PDFs give Pass benefits, exhibition dates and some closures, but they cannot keep up with every temporary closure, special opening or later change. To actually use the Pass, I also need to know whether a venue is open today, whether it has special hours, and whether it is closed for maintenance. That information lives on each venue’s own website.

These sites record changes that never appear in the operator’s PDFs: temporary closures, exhibition changeovers, maintenance shutdowns. In 2026, for example, the Olympic Museum closed for an inspection on 3 November, a public holiday.

And every venue publishes its hours differently. Some put closing days in plain text on the page; others embed them in a calendar image; others generate them with JavaScript. Shoto Museum, for example, uses PNG images inside a calendar widget:

Shoto Museum calendar widget

To keep PYOKO trustworthy, I built a daily monitor that captures snapshots of the official pages and compares them with the data PYOKO currently holds.

Official pages can change without notice: a new exhibition, a night opening, a maintenance closure. A monthly check is too slow for that, and having an agent re-read 107 sites every day would be expensive and noisy.

The monitor runs on a small VPS under a systemd timer at around 06:30 JST:

  1. Fetch each watched official URL once and compare it with the last saved snapshot (only sites whose robots.txt permits crawling).
  2. For pages that did not change, do nothing. No model call.
  3. For each page that changed, send Claude only the changed lines and three lines around them (a size-capped excerpt when there is no usable diff, never the whole page), with PYOKO’s current data for that venue, and ask whether it affects what visitors see.
  4. Post the answer as a comment on one GitHub issue.

It never edits data. A scheduled task picks up the issue and rechecks each finding against the official page; what is left comes to me, so I check one specific change instead of comparing 107 pages. If something must change, I ask an agent for a pull request, and that pull request still needs its check batch.

The model only sees changed pages, but the cost is not trivial: the 9 days from 1 to 9 November cost $8.03 (all Opus 5.5, about $27 a month if that rate holds). My original estimate was $1–3 per month, proposed by an AI agent and accepted without verification. I now validate cost assumptions with a small live run before committing to a monitoring setup. That cost is currently covered by API gift credits. Once monitoring stabilizes I can switch to the cheaper Sonnet, but not before comparing miss rates and false positives.

Console cost view: pyoko API key, 1 to 9 Nov 2026, $8.03, all Claude Opus 5.5

An unchanged page does not mean its facts were checked again, and a detected change is only a lead until someone confirms what it means. Monitoring tells me where to look. Verification tells me what I can claim.

Keeping it true: every check leaves a record

Both kinds of source share two rules: a finding must say how it was obtained, and every check must leave a record.

Agents are confident in the same tone whether they opened a page or guessed. My monthly refresh skill hands work to cheaper subagents, and the easy mistake is to let their summaries flow straight into the data. A summary that says “the official site lists 12/7–12/18” reads exactly like one written after opening the site.

So every finding carries a class, and only one class may change data:

Class Meaning May change data?
OFFICIAL_CONFIRMED The venue’s own page was opened in this run and matches Yes
REPO_ONLY Only PYOKO says it; no current official source found No
CONFLICT Two official sources disagree; both are recorded No
UNVERIFIED Unreachable, ambiguous, or not yet checked No

Dates get a second tag. FETCHED_PRIMARY means this run, or a reviewer, opened the official page. LEAD_ONLY means a subagent reported it. In the skill’s own words: “Subagent output is a lead, not evidence, including its access failures.” A subagent saying a site was down does not prove it was down either.

Classes decide what a finding may do. The second rule keeps the data true week after week, while agents keep editing closing days and fees.

So every check against an official site leaves a record. Before an agent looks up a fact, it runs node scripts/check-log.js <No.> <topic>; a fresh record already answers the question. After the check, matching or not, it commits a dated batch file to data/review/checks/ with the URL and what was found. On 11 November 2026 there were 92 such batches.

Then CI makes the rule hard to skip. A pull request that touches any of the eight files holding visitor-facing facts (hours, closures, exhibitions, fees, Pass benefits, access) fails unless it adds a new batch. Translations and the holiday list are outside this gate (the holidays have their own test against the official list), so changes there rely on review. The repository is private, so here is a simplified excerpt:

// scripts/check-batch-required.js (simplified excerpt)
const factFiles = changed.filter(file => FACT_FILES.includes(file));
// Only a newly added .json counts: editing or moving an old batch records no new check.
const batches = added.filter(file => file.startsWith(BATCH_DIR) && file.endsWith('.json'));
if (!factFiles.length) return { ok: true, reason: 'No facility-fact file changed.' };
if (batches.length) return { ok: true, reason: `Check-log batch added: ${batches.join(', ')}.` };
// No batch: every commit that touched a fact file needs its own No-fact-change trailer.
const missing = factCommits.filter(c => !hasReason(c));
if (factCommits.length && !missing.length) return { ok: true, reason: 'No-fact-change on every fact commit.' };
return { ok: false, reason: 'Fact file changed without a check batch.' };

A change that really alters no fact, such as a refactor, says so with a No-fact-change: <reason> trailer (a tagged line at the end of the commit message) on each commit. One early refactor commit cannot excuse a later fact change.

CI only checks that a batch exists. Whether the batch actually covers the change is still a reviewer’s call, and I say so in the script’s own header.

A second gate covers the code that decides whether a venue is open. When a pull request changes it, CI reports every venue whose day-level opening status would change, from today to the Pass’s last day; it compares the status of each day, not every change in hours. The list alone does not fail the build. Instead the pull request must include it and give each changed venue its official evidence or the reason the change is intended, and a check on the pull request description fails if that section is missing. A fix meant for one museum that also moves another shows up there before review.

Dates: which day does a fact apply to?

A fact actually has three kinds of date: the date the source was published, the date PYOKO checked it, and the date it applies to. Exhibitions, closures and temporary openings are hard mostly because of the third: a record with a complete source date and check date still cannot prove that a visitor’s chosen day is correct if no one knows which day the record applies to.

The most instructive bug in PYOKO was not in the code. It was in how a date was written.

Japanese closure notices usually omit the year: 展示替休館 12/7–12/18. PYOKO’s status logic reads a closure without a year as a rule that repeats every year, which is right for 年末年始 but wrong for a one-off exhibition changeover. A one-off written without a year quietly closes the museum again on the same days next year.

Tokyo Fuji Art Museum (No. 97) is the clearest example. Its long-closure note, taken from the operator’s exhibitions PDF, read only 6/22–10/2, with no year. This was a one-off 2026 closure, but the status logic read it as a rule that repeats every year, so on 25 June 2027 PYOKO would still show it as closed. No. 76 had the same problem and would “close” again on 4 August 2027. When I fixed these I did not delete the expired notices. Instead I added “2026” to each one-off closure across 18 facilities (plus one note on No. 1), preserving the history and confirming that 2026 results stayed correct while next year’s would not repeat. Fiscal-year schedules from the official list are the same kind of trap: January to March dates belong to the next calendar year.

I fixed this class of date error in four steps; the first three are required for any defect fix in PYOKO:

  1. Reproduce on main first, through the same load path the site uses, including the corrections file. If main already behaves correctly, the answer is “no change required”, not an edit.
  2. Fix the data or the parser, with the year written on every one-off date.
  3. Show the effect, not just the tests. For each changed window, pick a date inside and a date outside, then compare checkStatus and getFacilityOpeningState before and after the fix to confirm that the status visitors actually see matches expectations.
  4. Make the class of error fail loudly. A closure line that mixes dated and year-less dates is now a validation error, and a script that runs in CI and in the monthly refresh lists year-less one-off closures that have already passed.

Step 3 is the easiest one to skip. “All tests pass” says the code still does what the tests describe. It does not say the museum is open on the day a visitor will go.

Making the check record part of the product

The check log started as an internal tool. But I felt that letting visitors know when a fact was last confirmed helps build trust, so I made part of it public: for facilities with a citable check record, the page shows the date PYOKO confirmed the official information behind its opening hours, last admission and closing days.

Different facts may have been checked on different days. An ⓘ panel lists those checks separately, each with a link to the official page it was checked against.

Facility page: the sources and check records panel

A label like “Up to date” would sound safer and explain less: a museum can announce a closure an hour after any check. A date shows the basis instead, and it has to be the right date. A deploy, an automated fetch and a comparison with the official page are different things, and only the last one is shown. If the latest check found a difference, an older match is no longer shown either.

PYOKO in data-team terms

None of this is specific to museums.

The data sources are different — at Tencent I worked with ad-campaign metrics and game-publishing analytics; at PYOKO the sources are PDFs, websites, text, images and JavaScript — but the process is the same: understand data sources and clarify who owns each one; wrangle incoming data, reject invalid values, and load it; ensure the data shown to users is trustworthy and traceable.

In PYOKO On a data team
Check log + CI gate Lineage and provenance, enforced at merge
Evidence classes, lead vs primary Data quality states and source trust levels
Year-less date validator A data contract that rejects ambiguous values
Daily freshness monitor Freshness checks and alerting, with a human in the loop
Reproduce on main, show checkStatus before and after Verify actual results, not just test status

PYOKO started by trying to answer a very small question: which museums can I still visit this afternoon? I learned that answering it requires more than knowing what official websites say. I also need to know when it was written, when it was last checked, and which day it is actually talking about.

PYOKO is live at pyoko.jp.