feat(api.ht): shapes tool — link-shape comparison for dot-do/data#36 - #31
Open
nathanclevenger wants to merge 1 commit into
Open
feat(api.ht): shapes tool — link-shape comparison for dot-do/data#36#31nathanclevenger wants to merge 1 commit into
nathanclevenger wants to merge 1 commit into
Conversation
One new HypertextTool, `shapes` (shapes.api.ht), serving the founder's
deferred link-map comparison IN the live api.ht worker's own conventions
(no parallel implementation — supersedes the standalone workers.dev demo
and the data-repo poc/api-ht-live-demo branch):
- shapes.api.ht/{dataset}/{id}?shape=a|b|c — the SAME entity in three
candidate link shapes: (a) typed camelCase edges (postedBy, locatedIn,
sameAs, potentialAction) as the envelope links block; (b) label-keyed
maps as the recovered workers did; (c) = (a) + a `variations` block of
real representation alternates (classes: Wikidata JSON/TTL/HTML).
- Datasets embedded at build time, zero request-time fetches: 53 canonical
Job records (dot-do/data#34 adapter PoC, Greenhouse) + top-20 head
Wikidata classes (wiki-sources catalog snapshot 2026-08-23, CC0-1.0),
plus companies/locations Views over jobs.
- A miss is a page: 404 + suggestions as the current shape's link map
(jobs/staff-engineer, classes/Q42). Every response carries a `shapes`
hop map to the same page in the other shapes.
- shapes.api.ht/ root is a clickable HTML index explaining the three
shapes (new optional HypertextTool.landingHtml, shared page shell).
- encodeValue now keeps '/' readable so multi-segment values are
first-class in the link grammar.
- 12 new offline tests (34 total in api-ht.test.ts, all green).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Integrates the dot-do/data#36 link-shape examples INTO the live api.ht v0.1.0 worker as one new registry tool — per the founder ruling (2026-08-24): integrate and coordinate, no parallel implementations.
What it adds
One
HypertextTool,shapes, in the worker's own conventions (samerespondenvelope, sameLinkContextgrammar, same registry expansion path — no second envelope):?shape=:linksblock keyed by verb-register edge names (postedBy,locatedIn,memberOf,sameAs,potentialAction)linkskeyed by arbitrary human labels, as the original recovered workers diddata.variationsblock of REAL representation alternates (classes: Wikidata JSON / TTL / HTML; jobs: Greenhouse HTML + board-API JSON) — relation edges and representation alternates never share a namespacedata.shapeshop map to the same page in the other two shapes, so the founder can compare in place.suggestionsrendered as the current shape's link map.HypertextTool.landingHtml, reusing the property's shared page shell).companies/locationsViews over jobs.landingHtmlonHypertextTool;encodeValuenow keeps/readable so multi-segment values are first-class;page/escexported fromlanding.ts.Routes once deployed
http://localhost:8787/shapes/jobs/4266196009?shape=aVerification
tests/api-ht.test.ts: 34/34 green (12 new shapes tests, fully offline)tsc -p tsconfig.json) and example typecheck: cleanbuild.tsbundle: OK (221KB_worker.js)wrangler dev --localsmoke-tested: all three shapes, hop maps, miss pages, HTML landing, apex tool index — all verifiedapi.example.com.aiURLs / workerd) are unrelated to this changeSupersedes
Closes the loop on dot-do/data#36 and feeds the dot-do/data#13 per-brand link-contract ruling. The standalone api-ht-live-demo.dotdo.workers.dev worker and the data-repo branch
poc/api-ht-live-demoare SUPERSEDED by this PR and should be torn down after merge + deploy.🤖 Generated with Claude Code