Repository navigation
Parse the Victorian general order and add Kanon fallback - #4
daviddiviny wants to merge 6 commits into
Conversation
|
@claude - review this PR |
|
Claude finished @daviddiviny's task in 2m 15s —— View job PR Review: Parse the Victorian General Order + Kanon Fallback
Overall AssessmentThe design is sound. The rename from Critical1. DB enum rename has no migration
Important2. Fixture loader exported in the production public API
// packages/parsers/src/index.ts
export * from "./general-order/vicgov"; // exports loadFixtureVicGovGeneralOrderEither export only the needed symbols with named exports, or move 3.
// packages/domain/src/government/schemas.ts:109
export const generalOrderParseStatusSchema = z.enum([
"parsed",
"partial",
"review", // never assigned by vicgov.ts or kanon.ts
]);Minor4. // packages/parsers/src/general-order/vicgov.ts:43
function normalizeText(value: string): string {
return normalizeGeneralOrderText(value);
}This adds a call-stack hop with no benefit. Call 5. // packages/parsers/src/general-order/kanon.ts:222
const batchSize = Math.max(1, Math.min(options.batchSize ?? DEFAULT_BATCH_SIZE, 8));The 6. The regex only recognises What's working well
|
|
Follow-up changes are in now:
I re-ran @claude is your feedback properly addressed? |
|
Claude finished @daviddiviny's task in 1m 37s —— View job Follow-up Review: Verifying Addressed Feedback
Verdict: Almost there — one migration/schema mismatch remainsFive of the six items are cleanly resolved. One issue slipped through. Still needs fixing
The TypeScript side is correct — -- packages/db/drizzle/0000_brown_serpent_society.sql:9
CREATE TYPE "public"."general_order_parse_status" AS ENUM('parsed', 'partial', 'review');If that migration is applied to a fresh DB, Since this is still a baseline migration with no live data, the fix is simple — regenerate the migration after the cleanup (or manually remove Confirmed resolved
|
ce194ae to
36083ea
Compare
|
Addressed the remaining migration mismatch. What changed:
What I verified locally:
The preview app is still running locally on port |
Summary
act_administration_rulestable, a shared DB client, and a new worker sync taskTesting
pnpm lintpnpm typecheckpnpm testDATABASE_URL=postgresql://postgres:postgres@localhost:54329/govgraph pnpm --filter @govgraph/db exec drizzle-kit migrateDATABASE_URL=postgresql://postgres:postgres@localhost:54329/govgraph infisical run --env=dev -- pnpm exec tsx -e "import { createDbClient, closeDbClient, persistGeneralOrderDataset } from './packages/db/src/index.ts'; import { fetchVicGovGeneralOrder } from './packages/parsers/src/general-order/vicgov.ts'; void (async () => { const snapshot = await fetchVicGovGeneralOrder({ kanonAssistance: true }); const client = createDbClient(process.env.DATABASE_URL); try { const result = await persistGeneralOrderDataset(client.db, snapshot); const ruleCount = await client.db.execute('select count(*)::int as count from act_administration_rules'); const sourceCount = await client.db.execute('select count(*)::int as count from source_documents where source_url = \'https://www.vic.gov.au/general-order-effective-30-october-2025\''); const assistedCount = await client.db.execute('select count(*)::int as count from act_administration_rules where kanon_assistance is not null'); console.log(JSON.stringify({ result, persistedRuleCount: ruleCount.rows?.[0]?.count ?? null, sourceDocumentCount: sourceCount.rows?.[0]?.count ?? null, assistedRuleCount: assistedCount.rows?.[0]?.count ?? null }, null, 2)); } finally { await closeDbClient(client); } })();"Risks
DATABASE_URLif present and otherwise falls back to the local development Postgres defaultScreenshots