Repository navigation
refactor(gestures): move gesture algorithms out of contracts into @agent-device/gestures - #4823
Conversation
Size Report
Startup median (7 runs, lower is better):
|
|
This PR is ready at 6131f8c. The move is clean: the gesture reader, normalization and plan geometry now live in the new package, the types stay in contracts, and exported names are unchanged. Smoke Tests (ios), Smoke Tests (macos), Coverage and Ownership and context budgets pass at this commit; one Smoke Tests job was still running at review time, so merge once it is green. Not verified here: the diff was read and CI was relied on for the unit suite and layering; the counts in the PR body were not re-measured. Not blocking, take or leave:
|
This comment has been minimized.
This comment has been minimized.
|
Optional note applied at |
This comment has been minimized.
This comment has been minimized.
…ice/gestures Contracts is the shared vocabulary package, but gesture-plan.ts and gesture-normalization.ts held pure algorithms. They move unchanged, with their tests and fixtures, to a new private package that depends only on contracts and kernel. ad-script and the platform packages call these functions, so no existing package is below every consumer. The gesture plan and payload types stay in contracts. Consumers change only their import specifiers. R13 names gestures as platform substrate. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
readGesturePayload and its validators are logic, so they join the gesture algorithms in @agent-device/gestures with their test. The payload types and the gesture kind lists stay in contracts/gesture-input, where client-gesture and other vocabularies name them. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…esture algorithms Amend ADR 0033 with the owner rule for pure algorithms over a contracts vocabulary, the rejected alternatives, and the ordered follow-up slices for the logic that remains in contracts. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…s (R18) R18 banned only host, process, and timer calls, so pure gesture logic could return to contracts unnoticed. A contracts gesture input, plan, or normalization module now fails the check when it declares any function. The other contracts logic files stay out of scope until their slices move. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…lgorithms Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
a611da8 to
5e95c4b
Compare
|
Second optional note taken at |
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
|
This PR is ready at 5e95c4b. The earlier review of 6131f8c found nothing to fix, and the changes since then are an ADR sentence and a module rename; the rename leaves no stale importers. All checks pass and there are no conflicts. Not blocking, take or leave: the R18 path matcher at https://github.com/callstack/agent-device/blob/5e95c4b/scripts/layering/contracts-implementation-policy.ts#L36 still targets the old Not verified here: typecheck and tests were not run locally; this relies on CI and on a search that found no old-path imports. |
…s under R18 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Optional note taken at |
…nts-main * origin/main: refactor(contracts): bind only the interactor families an owner implements (#4821) refactor(gestures): move gesture algorithms out of contracts into @agent-device/gestures (#4823) docs(command-docs): add the shared option table and per-action option tables (#4824) docs(agents): hold a review to the PR's invariant and stop at a third round (#4835)
Summary
packages/contractsis the shared vocabulary package, but R18 only banned host, process, and timer calls, so pure logic lived there against the rule's own statement that contracts owns vocabulary only. Plugin bundling is unchanged: a plugin inlines every@agent-device/*package it imports.This PR moves one slice: gesture payload reading, public gesture normalization, and gesture plan geometry now live in a new private package,
@agent-device/gestures(depends only on contracts and kernel). The payload and plan types stay in contracts. Exported names are unchanged; consumers change only import specifiers. No behaviour or wire change, so this is not device-facing.A new package is needed because ad-script (contracts + kernel only) and the platform packages call these functions, and no existing package is below both.
refactor(move):gesture-plan.ts,gesture-normalization.ts, tests, fixtures, package wiring. R13 names gestures as platform substrate.refactor(gestures):readGesturePayloadleavescontracts/gesture-input; types stay.docs(adr): ADR 0033 amendment with rejected alternatives and ordered follow-up slices.chore(gates): R18 rejects any function in a contracts gesture input, plan, or normalization module.Value
R4 cycles 0 and R5 back-edges 0 at both.
Validation
At 4ccfbbc, locally:
pnpm build,check:quick,check:layering(513 pass),check:fallow,check:production-exports,check:package,check:adr-citations, eager-closure budget test (no budget changed),pnpm format. Targeted vitest for gestures, contracts, ad-script, command-surface, command-runtime, daemon, maestro, replay-port, platform-android, platform-apple, platform-linux, provider-webdriver,src/mcp: all pass. The full unit suite and integration lanes are left to CI.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.