How tiangong-lca/pcr works
TianGong LCA PCR Library stores canonical product-category-rule methodology and classification mappings, with tooling to author, validate, publish and consume them. The authoring path imports classification data or edits PCR records, checks and publishes revisions, then exposes the catalog through the public documentation site and viewer. Consumers resolve classification codes or read PCR guidance through the CLI. The local Goal Harness coordinates bounded authoring tasks and integration/landing. The README documents major subsystems not represented in sampled source; those links are shown only where it explicitly establishes the relationship.
Main entry points: cli/index.mjs Builder CLI · orchestrator.mjs Goal orchestration · src/index.mjs PCR core · cpc-scaffold.mjs CPC import
Components 22
PCR authoring
- Builder CLI
builder/cli/index.mjs - PCR lifecycle tools
builder/lib/builder-operations.mjs - CPC import
builder/lib/cpc-scaffold.mjs
Catalog and classification
- Canonical PCR records
library/pcrs - Classification data
classifications
Consumer products
- PCR core
packages/pcr-core/src/index.mjs - PCR consumer CLI
packages/tiangong-pcr-cli/src/commands.mjs - Documentation content source
packages/pcr-docs/lib/content-source.mjs - Public documentation site
packages/pcr-docs/app - Documentation search
packages/pcr-docs/components/search-dialog.tsx - Search client
packages/pcr-docs/lib/search-client.ts - Search worker
packages/pcr-docs/lib/search-worker.mjs - PCR viewer
packages/pcr-viewer/static/app.js - Viewer snapshots
packages/pcr-viewer/scripts/snapshot-store.mjs
Goal Harness
- Goal CLI
builder/cli/goal.mjs - Goal orchestration
builder/goal-harness/orchestrator.mjs - Author review
builder/goal-harness/author-review.mjs - Repository coordinator
builder/goal-harness/repository-coordinator.mjs - Harness event state
builder/goal-harness/event-store.mjs
Other components
- PCR author
- PCR guidance consumer
- CPC source data
Connections 25
- PCR author → Builder CLI: runs commands
- Builder CLI → PCR lifecycle tools: dispatches lifecycle
- Builder CLI → CPC import: dispatches import
- CPC source data → CPC import: provides source
- CPC import → Classification data: writes normalized data
- PCR lifecycle tools → Canonical PCR records: updates lifecycle
- Builder CLI → Canonical PCR records: checks records
- Canonical PCR records → PCR core: provides PCR data
- Classification data → PCR core: provides mappings
- PCR core → PCR consumer CLI: serves consumption
- PCR guidance consumer → PCR consumer CLI: requests guidance
- PCR core → Documentation content source: provides read model
- Documentation content source → Public documentation site: supplies content
- PCR guidance consumer → Public documentation site: browses guidance
- Documentation search → Search client: submits queries
- Search client → Search worker: posts query
- Search worker → Search client: returns results
- Viewer snapshots → PCR viewer: provides snapshots
- PCR guidance consumer → PCR viewer: browses snapshots
- PCR author → Goal CLI: starts goal
- Goal CLI → Goal orchestration: dispatches operation
- Goal orchestration → Harness event state: records events
- Goal orchestration → Author review: reviews commits
- Goal orchestration → Repository coordinator: coordinates integration
- Repository coordinator → Harness event state: persists coordination