Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions docs/known-blockers.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ contributors who start from the README.
- Dependency script retrieval now has segment-safe typed chunk and content
hashes, so the former packed/dynamic chunk-boundary Slither finding is fixed.
Current metadata golden fixtures now lock the pre-beta off-chain pending/final
URI behavior and current on-chain pending/final JSON output. ERC-4906 support
and current `MetadataUpdate` / `BatchMetadataUpdate` semantics now cover
`StreamCore` metadata mutations; dependency-registry reverse signaling remains
part of dependency versioning/freeze work. Remaining
metadata blockers include the final schema-versioned public-beta metadata
implementation, collection freeze manifests, immutable dependency version
records, registry identity pinning, burn semantics, escaping, and size limits.
URI behavior and schema-v1 on-chain pending/final base64 JSON output with
explicit `metadata_schema_version` and `metadata_state` fields. Pending
on-chain metadata no longer runs final generative HTML with a zero token hash.
ERC-4906 support and current `MetadataUpdate` / `BatchMetadataUpdate`
semantics now cover `StreamCore` metadata mutations; dependency-registry
reverse signaling remains part of dependency versioning/freeze work.
Remaining metadata blockers include collection freeze manifests, immutable
dependency version records, registry identity pinning, burn semantics,
escaping, and size limits.
- Dead public/allowlist mint-count mappings and retrieval APIs were removed
from `StreamCore`; the retained airdrop counter now has explicit regression
tests for zero initial state, authorized increments, and failed-mint rollback.
Expand Down
34 changes: 20 additions & 14 deletions docs/metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,42 @@ would produce `https://example.com/collections/abcpending` and
Current on-chain metadata is returned as:

```text
data:application/json;utf8,<json>
data:application/json;base64,<base64-json>
```

The current JSON includes:

- `metadata_schema_version` with value `6529stream-v1`
- `metadata_state` with value `pending` or `final`
- `name`
- `description`
- `image`
- `attributes`
- `animation_url`
- `animation_url` for final on-chain metadata only

The current on-chain pending output still embeds the zero token hash in the
generated HTML. ADR 0006 rejects that as the final public-beta behavior; future
metadata work must replace it with an explicit pending state and update the
golden fixtures intentionally.
Pending on-chain metadata no longer runs the final generative HTML path with a
zero token hash. It returns schema-versioned JSON with
`metadata_state: "pending"` and omits `animation_url`. Final on-chain metadata
returns schema-versioned JSON with `metadata_state: "final"` and the existing
base64-encoded HTML animation URL.

`StreamCore.metadataSchemaVersion()` exposes the active schema version and
`StreamCore.tokenMetadataState(tokenId)` exposes the current `pending` or
`final` state for minted tokens. The current schema version does not yet solve
JSON escaping, raw attribute validation, metadata size limits, freeze manifests,
dependency immutability, stale randomness display, or burn metadata semantics.

## Golden Fixtures

`test/StreamMetadataGolden.t.sol` compares live contract output against:

- `test/fixtures/metadata/offchain-pending-token-uri.txt`
- `test/fixtures/metadata/offchain-final-token-uri.txt`
- `test/fixtures/metadata/current-onchain-pending-token-uri.txt`
- `test/fixtures/metadata/current-onchain-final-token-uri.txt`
- `test/fixtures/metadata/onchain-pending-schema-v1-token-uri.txt`
- `test/fixtures/metadata/onchain-final-schema-v1-token-uri.txt`

The fixture names use `current-onchain-*` because the current on-chain JSON is
not yet the accepted public-beta schema. These fixtures are meant to make
metadata changes reviewable and deliberate.
The on-chain fixture names include the schema version so later schema migrations
are reviewable and deliberate.

## ERC-4906 Events

Expand Down Expand Up @@ -93,9 +101,7 @@ P1-META-003.

ADR 0006 requires future metadata work to add:

- schema version fields
- explicit pending, final, stale, and burned-state policy
- base64 JSON data URIs for on-chain metadata
- stale and burned-state policy
- JSON escaping and raw-attribute validation
- freeze manifests and immutable dependency version pins
- burn semantics and callback-after-burn tests
15 changes: 9 additions & 6 deletions docs/status.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ The current Gate A smoke baseline proves:
- Metadata tests now prove dependency chunk boundaries are included in typed
content hashes while preserving the existing rendered generative script
output, and `StreamMetadataGolden.t.sol` locks current off-chain pending/final
URIs plus current on-chain pending/final JSON data URIs against fixtures.
`StreamMetadataEvents.t.sol` proves ERC-4906 interface support and current
metadata update event semantics for token-level updates, collection-range
updates, randomness fulfillment, mint-only paths, and burn.
URIs plus schema-v1 on-chain pending/final base64 JSON data URIs against
fixtures. The on-chain schema exposes `metadata_schema_version` and
`metadata_state`, and pending on-chain metadata no longer runs final
generative HTML with a zero token hash. `StreamMetadataEvents.t.sol` proves
ERC-4906 interface support and current metadata update event semantics for
token-level updates, collection-range updates, randomness fulfillment,
mint-only paths, and burn.
- CI can run the same build/test smoke commands and publish logs.

The current tests are regression tripwires, not a correctness proof. Known
Expand All @@ -47,8 +50,8 @@ pull-payment ledger abstraction or protocol-wide aggregation layer, fuller
randomizer reserve lifecycle accounting,
callback-after-burn policy, canonical randomizer lifecycle
ownership, lower-impact static-analysis cleanup beyond the now-triaged
high/medium baseline, signer/deployment ceremony runbooks, final metadata
schema/escaping, dependency version/freeze manifest work, deployment
high/medium baseline, signer/deployment ceremony runbooks, metadata escaping,
dependency version/freeze manifest work, burn metadata policy, deployment
discipline, and the broader P0/P1 test suite.

Contributor and security intake files exist so future work can be packaged and
Expand Down
120 changes: 114 additions & 6 deletions ops/AUTONOMOUS_RUN.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ tests, security hardening, deployment discipline, and release/audit readiness.
| Field | Value |
| --- | --- |
| Remote | `https://github.com/6529-Collections/6529Stream.git` |
| Active PR branch | `codex/metadata-erc4906-events` |
| Last merged PR | `https://github.com/6529-Collections/6529Stream/pull/81` |
| Active PR branch | `codex/metadata-schema-state` |
| Last merged PR | `https://github.com/6529-Collections/6529Stream/pull/82` |
| Roadmap file | `ops/ROADMAP.md` |
| State file | `ops/AUTONOMOUS_RUN.md` |
| Last updated | `2026-06-10 23:15 UTC` |
| Last updated | `2026-06-10 23:55 UTC` |

## Packaging Notes

Expand Down Expand Up @@ -93,7 +93,8 @@ The queue will evolve as PRs merge and bot feedback arrives.
| 36 | Add payment ledger view aliases | Gate C/Gate D | Expose missing ADR 0003 local-ledger view names such as `totalReserved()` and `surplus()`, add category aliases where useful, assert them in payment invariants, and reconcile P0-PAY-002 roadmap state | Merged in PR #78 |
| 37 | Add signer lifecycle manager | Gate B1/Gate C | Implement P0-ADMIN-003 by separating drop-signing identity from signer-management authority, adding signer-manager role tests, proving rotation invalidates stale payloads, and updating ADR/roadmap state | Merged in PR #80 |
| 38 | Add metadata schema and golden-file tests | Gate D | Implement the first P1-META-001 test/docs slice: lock current off-chain pending/final tokenURI behavior, add on-chain JSON golden fixtures where feasible, document schema fields, and update roadmap/test traceability | Merged in PR #81 |
| 39 | Add ERC-4906 metadata update signaling | Gate D | Implement P1-META-004 for `StreamCore`: interface support, token-level and collection-range metadata update events, no misleading mint/burn-only events, docs, and roadmap/test traceability | PR #82 open; CodeRabbit inline review fix ready to push |
| 39 | Add ERC-4906 metadata update signaling | Gate D | Implement P1-META-004 for `StreamCore`: interface support, token-level and collection-range metadata update events, no misleading mint/burn-only events, docs, and roadmap/test traceability | Merged in PR #82 |
| 40 | Add schema-v1 metadata state outputs | Gate D | Continue P1-META-001 by adding schema-versioned on-chain base64 JSON, explicit pending/final metadata state views, golden fixtures, docs, and roadmap/test traceability | PR #83 open on `codex/metadata-schema-state` |

## Current PR Worklog

Expand Down Expand Up @@ -3341,7 +3342,7 @@ Outcome:

### PR #82: Add ERC-4906 metadata update signaling (Queue Item 39)

Status: PR open; CodeRabbit inline review fix applied locally and ready to push.
Status: Merged in PR #82.
Branch: `codex/metadata-erc4906-events`.
Pull request: `https://github.com/6529-Collections/6529Stream/pull/82`.
Related issue:
Expand Down Expand Up @@ -3435,14 +3436,121 @@ Review requests:
and implemented locally.
- CodeRabbit inline review thread `PRRT_kwDOM7REis6IpTxK` / review
`4472309839` identified the raw-topic negative-test gap; the local follow-up
is ready to push for rereview.
was pushed in commit `87e9634bb93681db7ffe3e9dec5bfcfd657614c5`.
- CodeRabbit latest-head comment `4675594572` confirmed all review items were
addressed, the thread was resolved, and no concerns remained.
- GitHub Actions CI passed in run `27312549432`.
- The aggregate CodeRabbit commit status stayed pending after the clean
latest-head review, so PR comment `4675606561` documented the autonomous
maintainer merge decision using green CI, resolved threads, and explicit
CodeRabbit approval evidence.
- Claude remains intentionally skipped per current user instruction; use
CodeRabbit unless risk or future user instruction changes.

Merge:

- Squash merge commit: `944f614688ea15ec6cd7317a940978dfa9aaeeb3`.
- Merged at `2026-06-10 23:20 UTC`.
- Issue `#49` closed by PR merge.

### PR #83: Add schema-v1 metadata state outputs (Queue Item 40)

Status: PR open; CodeRabbit assertion-label nitpick accepted and ready to push.
Branch: `codex/metadata-schema-state`.
Pull request: `https://github.com/6529-Collections/6529Stream/pull/83`.
Related issue:

- `https://github.com/6529-Collections/6529Stream/issues/46`

Goal:

- Continue P1-META-001 after the current-output golden baseline.
- Add an explicit `metadata_schema_version` field to on-chain JSON.
- Add an explicit `metadata_state` field for pending and final on-chain JSON.
- Base64-encode on-chain JSON data URIs.
- Stop pending on-chain metadata from running final generative HTML with a zero
token hash.
- Expose public schema/state views for tests and integrators.
- Update golden fixtures, docs, roadmap, and test traceability.

Candidate files:

- `smart-contracts/StreamCore.sol`
- `test/StreamMetadataGolden.t.sol`
- `test/fixtures/metadata/onchain-pending-schema-v1-token-uri.txt`
- `test/fixtures/metadata/onchain-final-schema-v1-token-uri.txt`
- `docs/metadata.md`
- `docs/status.md`
- `docs/known-blockers.md`
- `test/README.md`
- `ops/ROADMAP.md`
- `ops/AUTONOMOUS_RUN.md`

Implementation notes:

- Added `METADATA_SCHEMA_VERSION = "6529stream-v1"` plus public
`metadataSchemaVersion()` and `tokenMetadataState(tokenId)` views.
- Off-chain token URI behavior remains compatibility-preserving:
`baseURI + "pending"` before final randomness and `baseURI + tokenId` after
final randomness.
- On-chain token URI output now uses `data:application/json;base64,`.
- Pending on-chain JSON includes `metadata_state: "pending"` and omits
`animation_url`.
- Final on-chain JSON includes `metadata_state: "final"` and preserves the
existing base64 HTML animation URL.
- CodeRabbit correctly noted that `bytes32(0)` is now the pending sentinel, so
`setTokenHash` must reject zero hashes at the randomizer write boundary.
- Added the nonzero-hash guard plus a regression proving a configured
randomizer cannot finalize a token with `bytes32(0)` and the metadata state
remains pending after the rejected write.
- This PR intentionally leaves JSON escaping, raw-attribute validation, stale
state display, freeze manifests, dependency immutability, and burn semantics
to the remaining P1-META issues.

Validation so far:

- Focused metadata golden tests passed:
`forge test --match-contract StreamMetadataGoldenTest -vvv` with 6 tests,
0 failed, after the CodeRabbit zero-hash guard fix.
- Full canonical local gate passed: `make check` with 212 tests, 0 failed.
- Windows wrapper passed:
`powershell -ExecutionPolicy Bypass -File scripts\check.ps1` with 212 tests,
0 failed.
- Touched-file formatting passed:
`forge fmt --check smart-contracts\StreamCore.sol test\StreamMetadataGolden.t.sol`.
- Diff whitespace check passed: `git diff --check`.
- Markdown heading scan passed for `docs\metadata.md`, `docs\status.md`,
`docs\known-blockers.md`, `test\README.md`, `ops\ROADMAP.md`, and
`ops\AUTONOMOUS_RUN.md`.
- Traceability grep passed for `P1-META-001`, `metadata_schema_version`,
`metadata_state`, `metadataSchemaVersion`, `tokenMetadataState`,
`onchain-pending-schema-v1`, `onchain-final-schema-v1`,
`codex/metadata-schema-state`, and `Queue Item 40`.
- Slither baseline comparison remains non-blocking and high/medium unchanged:
`717` total findings, `4` High, `19` Medium, `92` Low, `591`
Informational, `11` Optimization. The only metadata-schema-related row is an
existing informational `too-many-digits` style finding.

Review requests:

- CodeRabbit was requested in issue comment `4675688299`.
- CodeRabbit review thread `PRRT_kwDOM7REis6IpsTo` requested the nonzero hash
guard; CodeRabbit marked it addressed in commit `3dc56d6`.
- CodeRabbit comment `4675802795` confirmed the guard and regression are solid
and suggested a clearer assertion label; the label nitpick was accepted.
- Claude remains intentionally skipped per current user instruction; use
CodeRabbit unless risk or future user instruction changes.

## Decision Log

| Time UTC | Decision | Rationale |
| --- | --- | --- |
| 2026-06-10 23:55 | Accept CodeRabbit PR #83 assertion-label nit | Clarified the zero-hash regression failure message after CodeRabbit confirmed the guard and coverage were solid; focused metadata tests, `make check`, Windows wrapper, formatting, and whitespace checks all pass |
| 2026-06-10 23:48 | Address CodeRabbit PR #83 zero-hash finding | Added `setTokenHash` guard for `bytes32(0)`, added pending-sentinel regression coverage, and reran focused metadata tests, `make check`, Windows wrapper, formatting, whitespace, and Slither baseline comparison |
| 2026-06-10 23:30 | Open PR #83 | Schema-v1 metadata state outputs are published with local validation evidence; next step is state follow-up push and CodeRabbit request |
| 2026-06-10 23:28 | Validate Queue Item 40 locally | Focused metadata tests, full `make check`, Windows wrapper, formatting, whitespace, heading scan, traceability grep, and Slither comparison all pass; Slither high/medium remain unchanged |
| 2026-06-10 23:26 | Start Queue Item 40 | ADR 0006 sequencing calls for schema versioning and explicit metadata state after current-output golden files and before freeze/dependency/burn hardening |
| 2026-06-10 23:20 | Merge PR #82 | CI passed, CodeRabbit resolved the inline thread and approved the latest head, and the stale aggregate CodeRabbit status was documented before merge |
| 2026-06-10 23:15 | Address CodeRabbit PR #82 inline test gap | Hardened negative-path ERC-4906 tests to assert no raw metadata event topics, added post-burn hash-storage no-event coverage, and refreshed focused/full/Windows/Slither validation with 210 total tests |
| 2026-06-09 22:34 | Use `ops/ROADMAP.md` as canonical roadmap | Existing roadmap already contains detailed gates, P0 issues, ADRs, Slither appendix, and test matrix |
| 2026-06-09 22:34 | Add `ops/AUTONOMOUS_RUN.md` as durable state | Long-running execution needs repo-persisted state across compaction and PR cycles |
Expand Down
Loading
Loading