Skip to content

feat(spec): v0.3 four-property schema with gsd-plugin alignment#1

Merged
qmarcelle merged 5 commits into
mainfrom
release/v0.3
May 13, 2026
Merged

feat(spec): v0.3 four-property schema with gsd-plugin alignment#1
qmarcelle merged 5 commits into
mainfrom
release/v0.3

Conversation

@qmarcelle
Copy link
Copy Markdown
Contributor

Summary

  • Rewrites schema/v1.json to the v0.3 four-property shape: manual, generated, agents, health
  • generated.specVersion const-locked to "0.3", with fileIndex and frameworkManifest as canonical gsd-plugin v2.42.3 read paths
  • manual.fragileFiles and manual.coChangePatterns are the two manual-side gsd-plugin read paths
  • Canonical write path corrected to .agents/agents.workspace.json (v0.2.0 incorrectly stated repo root)
  • Adds three examples: minimal-v0.3.json, populated-v0.3.json, with-manual-block-v0.3.json
  • Updates CHANGELOG with [0.3.0] breaking-change section

Breaking changes

  • Schema shape changed — v0.2 documents will fail validation against this schema
  • generated.filesgenerated.fileIndex; top-level versiongenerated.specVersion
  • Canonical path corrected from repo root to .agents/agents.workspace.json

Test plan

  • pnpm --filter @workspacejson/spec exec vitest run passes
  • validate() export accepts all three new example files
  • validateLegacy() gracefully rejects v0.3 documents (returns false, no throw)
  • Downstream: Stream-W-impl updates src/index.ts exports and bumps to 0.3.0

qmarcelle added 2 commits May 12, 2026 21:18
Aligns schema/v1.json with gsd-plugin v2.42.3 read paths:
- generated.frameworkManifest (framework detection)
- generated.fileIndex (per-file fragility + attribution counts)
- manual.fragileFiles (human-annotated fragile files)
- manual.coChangePatterns (human-annotated co-change observations)

Adds examples/ directory with minimal, populated, and manual-block examples.
Corrects canonical write path to .agents/agents.workspace.json.
All examples validate against the updated schema.
Copilot AI review requested due to automatic review settings May 13, 2026 02:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the @workspacejson/spec JSON Schema to the proposed v0.3 “four-property” document shape (manual, generated, agents, health) and adds example v0.3 documents, with corresponding release notes and a small package-metadata test adjustment.

Changes:

  • Rewrites schema/v1.json to the v0.3 structure with generated.specVersion const-locked to "0.3".
  • Adds three v0.3 example JSON documents under packages/spec/examples/.
  • Adds a 0.3.0 changelog entry and updates package metadata assertions in tests.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/spec/schema/v1.json Replaces the previous schema with a new v0.3 four-block schema layout and updated field locations.
packages/spec/examples/minimal-v0.3.json Adds a minimal v0.3 example document.
packages/spec/examples/populated-v0.3.json Adds a more complete v0.3 example document showing framework/fileIndex usage.
packages/spec/examples/with-manual-block-v0.3.json Adds an example demonstrating the manual block (fragile files and co-change patterns).
packages/spec/CHANGELOG.md Documents a 0.3.0 breaking-change release and migration notes.
packages/agents-audit/src/package-metadata.test.ts Adjusts package metadata expectations (repository directory and package versions).
Comments suppressed due to low confidence (4)

packages/spec/schema/v1.json:22

  • manual.fragileFiles[] entries don’t require a path (and allow arbitrary keys), so {} is currently valid even though it’s not meaningful. Consider adding required: ["path"] (and likely additionalProperties: false) on the item schema to enforce minimally useful entries and generate stronger TypeScript types.
          "items": {
            "type": "object",
            "properties": {
              "path": { "type": "string" },
              "reason": { "type": "string" }
            }
          }

packages/spec/schema/v1.json:56

  • generated.frameworkManifest[] items define name/version/confidence but don’t mark any of them as required, so objects like {} validate. If these are intended to be real detections, consider requiring at least name and confidence (and possibly additionalProperties: false) to keep validation and generated types aligned with the documented shape.
          "items": {
            "type": "object",
            "properties": {
              "name": { "type": "string" },
              "version": { "type": "string" },
              "confidence": { "type": "number", "minimum": 0, "maximum": 1 }
            }
          }

packages/spec/CHANGELOG.md:25

  • The migration guidance says “Fall back to v0.1 shape if specVersion is absent”, but the immediately preceding releases in this repo are 0.2.x and also used a different top-level versioning approach. Consider updating this guidance to reference the actual legacy shape(s) (e.g., v0.2) so consumers migrate correctly.
### Migration
Check `generated.specVersion === "0.3"` to detect v0.3 documents. Fall back to v0.1 shape if `specVersion` is absent.

packages/spec/CHANGELOG.md:21

  • The changelog says the package now includes an examples/ directory, but packages/spec/package.json’s files whitelist currently excludes examples, so these JSON files won’t be published to npm. Either add examples to the published files list or adjust the release notes to match what will actually ship.
### Added
- `examples/` directory with minimal, populated, and with-manual-block example files.
- `validate()` and `validateLegacy()` exports in `src/index.ts`.

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

Comment thread packages/spec/schema/v1.json Outdated
Comment on lines +3 to +4
"$id": "https://workspacejson.dev/schemas/v1.json",
"title": "workspace.json v0.3",
Comment thread packages/spec/CHANGELOG.md
Comment thread packages/agents-audit/src/package-metadata.test.ts
qmarcelle added 3 commits May 12, 2026 22:34
…0.3.0

- WorkspaceJsonV3, FrameworkEntry, FileIndexEntry, IntelligenceState types
- validate(): structural guard for v0.3 four-property shape
- validateLegacy(): accepts v0.1 docs (top-level version string, no specVersion)
- version constant exported as '0.3.0'
- 10/10 tests pass
- schema/v1.json: $id was 'schemas/v1.json' (wrong); restored to canonical
  'schemas/agents.workspace.v1.json' to match historical naming and
  prevent tooling breakage on schema identity
- schema/v1.json: title was 'workspace.json v0.3' (wrong); restored to
  'agents.workspace.json' consistent with schema.ts and package description
- package-metadata.test.ts: version pin updated 0.2.0 → 0.3.0 to match
  the version bump in this release

Findings from Copilot PR review on #1.
…+ invariant tests

Root cause of the recurring $id 404: the URL was defined in three places
(schema/v1.json, src/schema.ts, the live website) with no automated check
that they agree. This commit fixes the split-brain and adds a test suite
that will fail CI on any future drift.

Changes:
- schema/v1.json: $id fixed (schemas/agents.workspace.v1.json → canonical)
                  $schema fixed (http draft-07 → https draft-2020, matches site)
- src/schema.ts:  $id fixed (same wrong value → canonical)
- src/index.test.ts: 5 new invariant tests:
    1. TypeScript const $id == CANONICAL_ID
    2. schema/v1.json $id == CANONICAL_ID
    3. TS const == JSON file (no split-brain)
    4. CHANGELOG top version == package.json version
    5. $schema uses https (not http)

CANONICAL_ID = 'https://www.workspacejson.dev/schema/v1.json'
This constant is the single source of truth. Fix the source, not the test.
@qmarcelle qmarcelle merged commit b84f1e5 into main May 13, 2026
0 of 2 checks passed
@qmarcelle qmarcelle deleted the release/v0.3 branch May 13, 2026 03:27
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