Skip to content

draft-03 initial commit - #2

Merged
andreibesleaga merged 1 commit into
mainfrom
v03
Jul 10, 2026
Merged

draft-03 initial commit#2
andreibesleaga merged 1 commit into
mainfrom
v03

Conversation

@andreibesleaga

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 10, 2026 08:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR advances the repository to the prepared draft -03 / wire format “2.0” data model, aligning schemas, docs, examples, and both reference implementations (publisher + consumer) around the new mandatory target reporting subject, optional energy/carbon quartet (omission-based “not reported”), CO2e key renames, and updated privacy/noise semantics.

Changes:

  • Update the formal schemas (JTD + CDDL) and documentation to reflect the 2.0 field set (mandatory target, optional energy/carbon, CO2e renames).
  • Update publisher/ normalization, validation gate, security/noise behavior, and tests to enforce -03 constraints (no negative sentinels; gross metrics non-negative; scopes may be negative).
  • Update consumer/ validation, transforms, sentinel/legacy compatibility behavior, and package interfaces (including legacyCompat + legacy flag).

Reviewed changes

Copilot reviewed 86 out of 103 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
sfc-compliance/SFC.md Align grid intensity key name
schemas-validators/response-schema.json JTD: add mandatory target, rename keys
schemas-validators/response-schema.cddl CDDL: make target mandatory; optionalize energy/carbon
schemas-validators/README.md Document prose-only constraints/defaults
README.md Repo-level model + status updates
publisher/USAGE.md Usage docs updated for target + optional metrics
publisher/test/server.test.ts Server/security tests updated for 2.0
publisher/test/normalize.test.ts Normalization tests updated for 2.0
publisher/test/integration.test.ts Integration tests updated for 2.0
publisher/test/hardening.test.ts Hardening tests updated for target + sparse docs
publisher/test/co2js.test.ts Adapter tests updated for CO2e key rename
publisher/test/carbontxt-api.test.ts Adapter tests updated for normalize.target
publisher/test/adapters.test.ts Adapter suite updated for mandatory target
publisher/src/validate.ts Add -03 range/dependency validation at gate
publisher/src/util.ts fromWire updated for optional energy/carbon + defaults
publisher/src/types.ts Types updated for mandatory target + renamed keys
publisher/src/security.ts Noise logic updated for negative scopes
publisher/src/schema.ts Embedded JTD updated for 2.0
publisher/src/normalize.ts Implement -03 normalization + constraints/defaults
publisher/src/cli.ts CLI docs updated for normalize.target
publisher/src/adapters/computed.ts Comment/key rename alignment
publisher/src/adapters/carbontxt-api.ts Adapter behavior clarified for -03 omission model
publisher/README.md Publisher docs updated for 2.0 semantics
publisher/package.json Bump publisher package to 0.2.0
publisher/examples/transformed/watershed.json Regenerated example (2.0 + target)
publisher/examples/transformed/static-file.json Regenerated example (2.0 + target)
publisher/examples/transformed/salesforce-nzc.json Regenerated example (2.0 + target)
publisher/examples/transformed/ms-sustainability.json Regenerated example (2.0 + target)
publisher/examples/transformed/kepler-prometheus.json Regenerated example (2.0 + key renames)
publisher/examples/transformed/computed.json Regenerated example (2.0 + key renames)
publisher/examples/transformed/co2js.json Regenerated example (2.0 + key renames)
publisher/examples/transformed/climatiq.json Regenerated example (2.0 + target)
publisher/examples/transformed/carbontxt-api.json Regenerated example (2.0 + key renames)
publisher/examples/README.md Example docs updated for CO2e key rename
publisher/examples/originals/static-source-document.json Update fixture to 2.0 + target
publisher/examples/generate-examples.js Generator updated to supply normalize.target
publisher/examples/config.kepler.json Example config adds normalize.target
publisher/examples/config.computed.json Example config adds normalize.target
publisher/examples/config.co2js.json Example config adds normalize.target
publisher/examples/config.carbontxt.json Example config adds normalize.target
llms.txt Repository overview updated for -03/2.0
example-scripts/test_security.py Tests updated for negative scopes/no sentinel
example-scripts/test_security.php Tests updated for negative scopes/no sentinel
example-scripts/test_security.js Tests updated for negative scopes/no sentinel
example-scripts/test_request_handler.py E2E tests updated for mandatory target
example-scripts/security.py Security helper updated for -03/no sentinel
example-scripts/security.php Security helper updated for -03/no sentinel
example-scripts/security.js Security helper updated for -03/no sentinel
example-scripts/request-handler.py Handler fixtures updated for 2.0 + target
example-scripts/README.md Script docs updated for 2.0 field set
example-responses/example-response.json Example updated to 2.0 + target
example-responses/example-response-yearly-monthly-target.json Example updated to target (no target-path)
example-responses/example-response-unreported.json Update example to omission-based partial reporting
example-responses/example-response-extended.json Update example to 2.0 + vendor extension
example-responses/example-response_yearly.json Trend example updated to 2.0 + target
documents/README.md Draft status + build instructions updated for -03
documents/CHANGELOG.md Add -02→-03 breaking changes section
discovery/07-greenweb-carbontxt-integration.md Update field names + optionality notes
discovery/04-requirements.md Requirements updated for 8 mandatory fields
discovery/02-opportunity-assessment.md Status/model updated for -03 preparation
discovery/01-market-scan.md Mention mandatory target reporting subject
consumer/USAGE.md Document legacyCompat and new transforms behavior
consumer/test/validate.test.ts Validation tests updated for mandatory target + sparse docs
consumer/test/transform.test.ts Transform tests updated for target + defaults
consumer/test/sentinel.test.ts Sentinel tests repurposed for legacy-compat semantics
consumer/test/interop.test.ts Interop tests updated for 2.0 publisher behavior
consumer/test/fetch.test.ts Fetch tests updated + legacy pre-pass tests added
consumer/test/conformance.test.ts Conformance test updated for mandatory target
consumer/src/validate.ts Update cross-entry rule to use target
consumer/src/types.ts Types updated for 2.0 + legacy flag
consumer/src/transform.ts Update CSV/flatten/aggregate for optional metrics + defaults
consumer/src/sentinel.ts Implement field-driven legacy compatibility
consumer/src/schema.ts Embedded JTD updated for 2.0
consumer/src/index.ts Export NUMERIC_KEYS and updated sentinel API
consumer/src/fetch.ts Add legacyCompat pre-pass injecting target
consumer/src/conformance.ts Force strict (legacyCompat:false) in conformance runner
consumer/src/client.ts Thread legacyCompat + cache legacy flag
consumer/README.md Consumer docs updated for 0.2.0 / -03
consumer/PLAN.md Append 2.0 migration section
consumer/package.json Bump consumer package to 0.2.0
consumer/dist/validate.js Rebuilt dist for updated validation
consumer/dist/types.js Rebuilt dist types header
consumer/dist/types.d.ts Rebuilt dist types definitions
consumer/dist/transform.js Rebuilt dist transforms
consumer/dist/transform.d.ts Rebuilt dist transform typings
consumer/dist/sentinel.js Rebuilt dist sentinel module
consumer/dist/sentinel.d.ts Rebuilt dist sentinel typings
consumer/dist/schema.js Rebuilt dist embedded schema
consumer/dist/schema.d.ts Rebuilt dist schema typings
consumer/dist/index.js Rebuilt dist exports
consumer/dist/index.d.ts Rebuilt dist index typings
consumer/dist/fetch.js Rebuilt dist fetch with legacyCompat
consumer/dist/fetch.d.ts Rebuilt dist fetch typings
consumer/dist/conformance.js Rebuilt dist conformance runner
consumer/dist/client.js Rebuilt dist client with legacyCompat
consumer/dist/client.d.ts Rebuilt dist client typings
ADOPTION.md Adoption narrative updated for -03/2.0 model
.gitignore Add V03 execution plan ignore
.github/workflows/full-verify.yml Update test JSON fixture version string
.github/workflows/example-scripts.yml Update test JSON fixture version string

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread publisher/src/security.ts
@andreibesleaga
andreibesleaga merged commit 96e7cff into main Jul 10, 2026
23 of 24 checks passed
Copilot stopped work on behalf of andreibesleaga due to an error July 10, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants