Skip to content

feat(v0.2-finish): faceLabels API + FaceQuery polish + retroactive demos#64

Merged
w1ne merged 22 commits intodevelopfrom
feat/v0.2-finish
May 4, 2026
Merged

feat(v0.2-finish): faceLabels API + FaceQuery polish + retroactive demos#64
w1ne merged 22 commits intodevelopfrom
feat/v0.2-finish

Conversation

@w1ne
Copy link
Copy Markdown
Owner

@w1ne w1ne commented May 4, 2026

Summary

Closes workstream #1 (v0.2 finish) per docs/superpowers/specs/2026-05-04-v0.2-finish-design.md. Cuts the v0.2 chapter complete: tracked face/edge refs already on develop (PR #53) + new `faceLabels` API for user-named refs at creating ops + minor `FaceQuery` polish + retroactive demo set under `docs/demos/v0.2/`. No npm publish.

What ships

Headline kernel work

  • `faceLabels` option on `box`, `cylinder`, `extrudeRect`, `extrudeCircle`, `extrudePolygon`, `extrudeRoundedRect`, `revolveRect` + sketch-derived `Sketch.extrude/revolve/sweep/loft`. Map keys are user-chosen labels; values are canonical face name OR `FaceQuery` descriptor. Labels survive transforms + unambiguous booleans via the canonical-ref walker. `sphere` rejects with `feature.label.unsupported-on-shape`.
  • `FaceQuery` polish: `byNormal: 'X'|'-X'|'Y'|'-Y'|'Z'|'-Z'` (signed-axis normal selector), `minArea` / `maxArea` (face-area filters in mm²), `boundingBoxIn: BoundingRegion` (face bbox containment). `feature.face-query.invalid-axis` runtime defense.
  • 3 new diagnostic codes with HINTS entries: `feature.label.collision`, `feature.label.query-no-match`, `feature.label.unsupported-on-shape`. Plus capture-time codes `capture.faceLabels.invalid-shape/-key/-value`.

Agent-facing surface

  • `list_face_labels` MCP tool extended to surface `faceLabels` declarations (with `source: 'sketch-segment' | 'faceLabels'` discriminator) alongside existing sketch-segment labels.
  • `list_api` advertises `faceLabels` per accepting kind via new `featureKindFaceLabels` section.
  • SKILL.md: per-op signatures updated, "Labels" subsection added, all new diagnostic codes documented.

Quality + demo

  • 2 new eval tasks under `eval/tasks/`: `labeled-bracket-fillet`, `labeled-cylinder-shell`. Expert solutions score 100% via `corpus-v0.2.test.ts`.
  • 3 demos under `docs/demos/v0.2/`: `labeled-extrude-bracket` (FaceQuery form), `labeled-cylinder-cap` (canonical-alias form), `subtract-then-fillet-rim` (refreshed `whats-new.md` to three-section policy format). All pass `npm run lint-demos`.
  • AST round-trip locked via `tests/integration/v0.2-faceLabels-ast-roundtrip.test.ts`.
  • CHANGELOG `[Unreleased]` → `[0.2.0]` split.

Discipline notes

  • Closures (predicate functions) deliberately excluded — anti-agent-first per spec A7.
  • Edge labels deferred to v0.3 alongside `hole()` / `cut()`.
  • npm publish explicitly deferred per spec D-strategy.
  • Memorable-builds-policy `v0.2` grandfathering applies — `heroArtifact` slug not enforced for these demos.

Stats

  • 22 commits
  • 569/569 tests pass; typecheck clean
  • All drift sentinels green

Test plan

  • CI `qc` job passes
  • Eval `corpus-v0.2.test.ts` passes for all 5 tasks (3 tracked-refs + 2 label-driven)
  • `npm run lint-demos` passes for all 3 v0.2 demos
  • HINTS coverage sentinel green (`tests/unit/mcp/hintsCoverage.test.ts`)
  • SKILL.md drift sentinels green (`tests/unit/skill/`)
  • Manual: `list_face_labels` returns both label sources for a script using both forms

w1ne added 22 commits May 4, 2026 16:59
…sweep/loft

Adds `faceLabels` to the six creating ops (box, cylinder, extrudeRect,
extrudeCircle, extrudePolygon, extrudeRoundedRect, revolveRect via api.ts;
Sketch.extrude, Sketch.revolve, Sketch.sweep, Sketch.loft via sketch.ts).
Sphere rejects faceLabels with feature.label.unsupported-on-shape.

Validation helper validateFaceLabels lives in src/capture/faceLabels.ts to
avoid a circular dep (captureSession.ts ↔ sketch.ts). captureSession.ts
re-exports it. Errors: capture.faceLabels.invalid-shape / invalid-key /
invalid-value. FaceQuery values pass through unvalidated to resolution time.

22 unit tests (4 pre-existing + 18 new) in captureSession.test.ts.
…ketch fallback

Adds findFaceLabelInMetadata + resolveFromMetadataHit helpers to edgeSelection.ts.
Both pickEdges (fillet/chamfer) and resolveLabeledFace (shell/pickFace) now check
upstream feature.metadata.faceLabels before falling through to the sketch-segment
path, enabling box(..., { faceLabels: { lid: 'top' } }).fillet({ face: 'lid' }).
New diagnostic codes feature.label.collision and feature.label.query-no-match added
to HINTS and SKILL.md; seven integration tests (A–G) cover the new path.
Extend listApi.ts GLOBALS signatures and descriptions for all seven
accepting primitives (box, cylinder, extrudeRect, extrudeCircle,
extrudePolygon, extrudeRoundedRect, revolveRect) to advertise opts.faceLabels.
Add FeatureKindFaceLabels to ListApiOutput returned by list_api, listing
accepting kinds and the canonical-name/FaceQuery value schema. Update
add_feature and list_api tool descriptions in server.ts. Sphere explicitly
excluded. Tests added to listApi.test.ts; all 115 tests pass, typecheck clean.
Add faceLabels? to per-op signatures for box, cylinder, extrudeRect,
extrudeCircle, extrudePolygon, extrudeRoundedRect, and revolveRect;
insert Labels subsection after Face refs through operations with
canonical-alias and query-based examples, lineage rules, sphere caveat,
and list_face_labels reference.
@w1ne w1ne merged commit 5268ee6 into develop May 4, 2026
2 checks passed
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.

1 participant