feat(achievements): add Product Achievements grading axis#40
Conversation
- Compute per-theme achievement states (none, claimed, documented) for embodied carbon, circularity, material health, energy, dark sky, and emergency from the attestations a record already carries, keyed on attached evidence documents - Stamp index.achievements and index.restricted_substances_declared into the generated index and bump the builder version - Add the EmbodiedCarbonScope, CircularityTier, and AchievementState enums and the Attestation sustainability_metric and issuing_authority fields - Surface an achievements summary, per-theme state, and enrichment roadmap in the validator output - Re-stamp the eight example records and regenerate golden baselines additively, leaving conformance levels and completeness findings unchanged - Document the two computed axes and the additive-only compatibility commitment across methodology, how-it-works, compliance, README, ROADMAP, and the changelog
- Require an attestation_id for a best_metric_ref candidate so an id-less metric cannot shadow a referenceable one of the same or a better state - Make the achievements package the single source of the declaration-type to program-token mapping, read by the index builder through DeclarationProgramToken, so index.attestation_programs and the material_health theme cannot drift - Drop the unused Document and Standard fields from the roadmap Item - Cover all four declaration mappings, the best_metric_ref id rule and theme guard, and the restricted-substances disqualifier with tests - Correct the from-sheet ulc_version default in the sheet design note
Codex Automated Code ReviewCode Review SummaryPR: Adds Product Achievements as a second generated grading axis, updates schema/index builder/examples/docs, and adds achievement tooling/tests. P0 - Critical Issues (Must Fix)None found. P1 - High Priority Issues (Should Fix)
P2 - Medium Priority Issues (Consider Fixing)
P3 - Low Priority Issues (Optional)None found. Positive Observations
Note: I could not run Automated review by OpenAI Codex |
|
| Filename | Overview |
|---|---|
| tools/validator/internal/achievements/compute.go | Core computation engine — pure, total on hostile input, correctly separated from completeness. State ladder, evidence gate, expiry, status disqualifiers, and best_metric_ref selection are all logically sound and well-tested. |
| tools/validator/internal/achievements/themes.go | Program-to-theme classification; exhaustiveness guard enforced by TestEnumPartitionExhaustive. DeclarationProgramToken export is the single source of truth for declaration-to-program mapping consumed by both Compute and the index builder. |
| tools/validator/internal/index/builder.go | achievementsIndex uses strict JSON-normalized types (int64 via numberToJSON, non-nil []any, map[string]any) so Diff's reflect.DeepEqual comparison against a re-normalized stored record stays stable. RequiredKeys matches schema. |
| schema/ulc.schema.json | achievements and restricted_substances_declared added to Index.required; AchievementTheme $def added; sustainability_metric and issuing_authority added to Attestation; all changes are additive. The if/then conditional for embodied_carbon_kgco2e is correct Draft 2020-12 syntax. |
| schema/taxonomy.schema.json | Three new enums (EmbodiedCarbonScope, CircularityTier, AchievementState) added; AttestationProgram description updated to clarify ICEL as an emergency qualification. All additive. |
| tools/validator/internal/achievements/invariant_test.go | Covers REPRODUCIBLE-INPUTS-ONLY, kitchen-sink negative, mutation-safety, completeness isolation, and the AST-level copy-not-import boundary — a strong invariant suite. |
| tools/validator/internal/achievements/themes_test.go | Exhaustiveness guard (TestEnumPartitionExhaustive) verifies every AttestationProgram token is consciously placed; disjointness and real-enum-member checks close the classification against the taxonomy schema. |
| tools/validator/cmd/ulc/main_test.go | TestAchievementsIndexRoundTrip guards the nested-map type normalization path; TestManufacturerRecycleProgramIndexValidates pins schema-validity for the zero-program circularity claimed edge case. |
| tools/validator/internal/findings/findings.go | Three new achievement Code constants added; WriteText updated to suppress CodeAchievementsState and CodeAchievementsRoadmap in non-verbose mode alongside existing enrichment/observation suppression. Logic is consistent. |
| tools/validator/cmd/ulc/main.go | achievements.Report added to both the validate and from-sheet paths. Flag help text and usage description updated. No exit-code or error-handling changes. |
Reviews (5): Last reviewed commit: "docs(achievements): correct the roadmap ..." | Re-trigger Greptile
…theme - Require a well-formed FileReference (non-empty filename and 64-char lowercase-hex sha256) before a source_document_ref counts as evidence, so build-index cannot stamp a theme documented from a ref that schema validation would later reject - Select best_metric_ref only from an attestation whose sustainability_metric actually represents the theme (an embodied-carbon figure for embodied_carbon, a CEAM score or Cradle to Cradle level for circularity), never a mismatched payload - Add hostile-evidence and mismatched-metric regression tests - Clarify in the changelog that the two generated index members are required in the built index, not optional
Codex Automated Code ReviewCode Review SummaryPR: Adds v1.0.0 Product Achievements axis, generated index fields, sustainability attestation metrics, docs, examples, and validator support. P0 - Critical Issues (Must Fix)None found. P1 - High Priority Issues (Should Fix)
P2 - Medium Priority Issues (Consider Fixing)
P3 - Low Priority Issues (Optional)None found. Positive Observations
I could not run Automated review by OpenAI Codex |
…te carbon unit - Move just_label out of the material_health theme: ILFI JUST is an organization-level social-equity label, not a product ingredient disclosure, so it joins the deliberately-unthemed residue as a social-responsibility candidate - Regroup living_product_challenge as a multi-attribute product certification rather than a project- or company-level program, matching its ILFI definition - Document embodied_carbon_kgco2e as a standards-native single-unit field (kg CO2e, the universal EPD and TM65/TM66 unit), consistent with the schema's existing SI-native exceptions
Codex Automated Code ReviewCode Review SummaryPR: Adds Product Achievements as a second computed grading axis, updates schema/index projections, validator reporting, examples, and docs for v1.0.0. P0 - Critical Issues (Must Fix)None found. P1 - High Priority Issues (Should Fix)
P2 - Medium Priority Issues (Consider Fixing)
P3 - Low Priority Issues (Optional)
Positive Observations
Note: I could not run Automated review by OpenAI Codex |
- Redefine claimed and documented in the taxonomy enum, methodology, and compliance appendix so an attested but expired or status-disqualified theme reads as claimed with a document attached, matching the computed behavior - Gate evidence on the FileReference sha256 integrity anchor rather than a non-empty filename the schema does not constrain, keeping the code and schema aligned - Note in the validate usage and --verbose help that the report also emits the Product Achievements summary, state, and roadmap
Codex Automated Code ReviewCode Review SummaryPR: Adds Product Achievements as a second computed grading axis, extends the generated index, schema, docs, examples, and Go validator. P0 - Critical Issues (Must Fix)None found. P1 - High Priority Issues (Should Fix)
P2 - Medium Priority Issues (Consider Fixing)None found. P3 - Low Priority Issues (Optional)None found. Positive Observations
Note: I could not run Automated review by OpenAI Codex |
…chema - Require source_document_ref to be a schema-shaped FileReference (filename present as a string, sha256 matching the hash pattern) before it counts as evidence, so a ref missing the required filename cannot stamp a theme documented - Correct the claimed and documented definitions across the taxonomy enum, methodology, and compliance appendix: a status-disqualified attestation contributes nothing, and only record-relative expiry caps otherwise-qualifying evidence at claimed - Make the discriminator prose precise: documented needs an attached, unexpired document
Codex Automated Code ReviewCode Review SummaryPR: Adds Product Achievements as a generated second grading axis, with schema/index additions, validator reporting, examples, and docs. P0 - Critical Issues (Must Fix)None found. P1 - High Priority Issues (Should Fix)
P2 - Medium Priority Issues (Consider Fixing)None found. P3 - Low Priority Issues (Optional)None found. Positive Observations
Note: I could not run Automated review by OpenAI Codex |
- The README, how-it-works, methodology trust-boundary note, and roadmap summarized documented as simply an attached evidence document; state instead that documented requires an attached, unexpired evidence document on a qualifying attestation, matching the computed rule and the detailed definitions
Codex Automated Code ReviewCode Review SummaryPR: Adds Product Achievements as a second generated grading axis, extends attestation sustainability metadata, restamps examples, and wires validator/index tooling. P0 - Critical Issues (Must Fix)None found. P1 - High Priority Issues (Should Fix)None found. P2 - Medium Priority Issues (Consider Fixing)
P3 - Low Priority Issues (Optional)
Positive Observations
Verification note: I could not run Automated review by OpenAI Codex |
…n prose - The roadmap now scopes the additive claim to the authored surface and states that the two generated index members are required in the built index, matching the changelog - Distinguish the program token from the new issuing_authority field, which names the operator when a program runs under more than one - Drop the emission-order claim for achievements findings; output is sorted by finding code
Codex Automated Code ReviewCode Review SummaryPR: Adds Product Achievements as a second generated grading axis, updates schema/docs/examples, and wires validator/index tooling for v1.0.0. P0 - Critical Issues (Must Fix)None found. P1 - High Priority Issues (Should Fix)None found. P2 - Medium Priority Issues (Consider Fixing)None found. P3 - Low Priority Issues (Optional)None found. Positive Observations
I ran a read-only schema sanity check for JSON parse, Automated review by OpenAI Codex |
Summary
Adds Product Achievements, a second computed grading axis alongside the existing
data-completeness ladder. Both are pure computed views over one Master Ledger of the
attestations a record already carries. This is the v1.0.0 milestone: ULC's first formal
backward-compatibility commitment, delivered as an additive-only change (no field, token,
or code is removed or narrowed).
The achievements axis reports, per theme (embodied carbon, circularity, material health,
energy, dark sky, emergency), whether a record is
none,claimed, ordocumented, wherethe claimed/documented split is driven purely by whether an evidence document (a
sha256-anchored
source_document_ref) is attached. Expiry is record-relative(
valid_untilvsrecord_status_as_of, never wall-clock), so the output is reproducible.What is in it
internal/achievements/package: a pure, totalCompute(record)that merges theledger, applies status disqualifiers and record-relative expiry, and returns per-theme
state,
documented_count, the restricted-substances flag, and a claimed-to-documentedroadmap. Kept decoupled from
completenessby a copy-not-import boundary enforced by anAST-level import-graph test.
EmbodiedCarbonScope,CircularityTier, andAchievementStateenums;Attestation.sustainability_metricandissuing_authority;and the generated
index.achievementsandindex.restricted_substances_declaredmembers.(int64 counts, non-nil arrays, map nesting) so the stored index round-trips through
Diffwithout false drift.
roadmap findings.
to describe both axes and the additive-only commitment; CHANGELOG v1.0.0 entry.
Compatibility
re-stamp only their
builder_version(0.5.0 -> 0.6.0) plus the two additive index members.Authored
ulc_versionis unchanged (five at 0.8.0, three at 0.10.0), which is the liveproof of the compatibility commitment.
ulc build-indexto gain the two new index members.Review status
simplicity, and pattern-consistency: all findings resolved or backlogged; zero P1.
security concerns.
Test plan
go build ./...,go vet ./...cleango test ./... -count=1green across all packages (race-clean)gofmtcleanulc build-index --checkCallouts for reviewers
internal/achievements/compute.gois the core: the state ladder, record-relative expiry,evidence gate, and
best_metric_refselection (which requires anattestation_id).package and read by the index builder through
DeclarationProgramToken, soindex.attestation_programsand the material-health theme cannot drift.internal/index/builder.goachievements emission uses the type-strict normalization thatkeeps
index.Diffstable; the round-trip is guarded byTestAchievementsIndexRoundTrip.