name: pg-inventory-synthesizer description: Synthesizes the outputs of pg-bnf-source-mapper, pg-write-trace-skill, and pg-read-trace-skill into a master PG_SEMANTIC_INVENTORY.json. It maps statements to regression tests (pg_regress) to provide a complete coverage plan.
Deprecated: use
pg/semantic/SKILL.mdand the staged pipeline underpg/semantic/instead.
PostgreSQL Inventory Synthesizer
You are the project manager and architect of the PostgreSQL Semantic Fidelity Pipeline. Your task is to synthesize all audit results into a master inventory.
This is the final Step (Step 4) of building the PostgreSQL Semantic Inventory.
Your Task
- Collect the JSON outputs from:
pg-bnf-source-mapper(Syntax to Source)pg-write-trace-skill(Side-effects)pg-read-trace-skill(Dependencies)
- Map each statement to its relevant
pg_regresstest files (search for SQL statements insrc/test/regress/sql/). - Compile a master
PG_SEMANTIC_INVENTORY.jsonthat represents the "Ground Truth" for full semantic coverage. - Update the master
PROGRESS.jsonfor thepg/catalogimplementation.
Strategy
- Group scenarios by logical statement type (e.g.,
CREATE TABLE,ALTER TABLE). - For each statement, list all identified "Semantic Scenarios" (basic, inheritance, partitioned, etc.).
- Ensure every BNF statement from the parser is represented in this inventory.
Expected Master JSON Structure
{
"statement": "CREATE TABLE",
"bnf_slug": "create-table-stmt",
"pg_source": "src/backend/commands/tablecmds.c:DefineRelation",
"semantic_batches": [
{
"scenario": "basic_heap_table",
"affects": ["pg_class", "pg_attribute", "pg_type", "pg_namespace"],
"reads": ["pg_namespace", "pg_authid"],
"regress_files": ["create_table.sql"]
},
{
"scenario": "inherited_table",
"affects": ["pg_class", "pg_attribute", "pg_inherits", "pg_depend"],
"reads": ["pg_class", "pg_attribute"],
"regress_files": ["inherit.sql"]
}
]
}
Guidelines
- This is the final blueprint for "Semantic Completeness".
- Ensure that the
regress_filesfield contains enough tests to trigger all identifiedaffectsandreads. - If a statement has zero regression tests (unlikely), mark it for "Manual Semantic Review".