feat(review): add bounded review contract surface - #378
Draft
seonghobae wants to merge 59 commits into
Draft
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: 오행석 <hohangseok@cwl.com>
Signed-off-by: 오행석 <hohangseok@cwl.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.
Scope
Refs #374. This Draft is the canonical single-writer lane for Inkspan's provider-neutral review contract and controlled presentation surface. It includes deterministic target validation, bounded insert/delete proposal metadata, revision-bound accept/reject evidence, bounded host-supplied thread presentation metadata, a controlled accessible React adapter, deterministic keyboard traversal among thread-selection targets, fail-closed collection-ingress preflight, and public typed-error normalization for host semantic-summary localization failures. It does not claim the full inline-marker/suggestion UI, editor transaction adapter, durable review workflow, or shipped review product is complete.
Protected shipped truth remains exact
main@3b38ead2d00f44eb578d0689087b9293b3dabe1e. The current exact Draft head iseb91c8ff945b9f6dac0a3b9edd10433313969eea; the immediate pre-write refetch reports the Draft mechanically mergeable against that protected base. Mergeability is not authorization.Current active-PR surface
This Draft exports a React-free
@contextualwisdomlab/cwl-editor/reviewpackage subpath plus optional@contextualwisdomlab/cwl-editor/review-reactpresentation. The review core uses Inkspan's canonical document revision and W3C TextPositionSelector evidence rather than DOM offsets. Targets, suggestions, operation results, and thread presentation snapshots are strictly validated, detached/bounded where applicable, and do not become host authorization, persistence, identity, tenancy, transport, or durable-audit state.CwlReviewThreadListvalidates the collection before rendering and then validates every presentation item. The collection is capped at 1,024 entries before any item inspection. Every slot must be a dense, enumerable own data property; accessor-backed, sparse, or non-enumerable slots fail closed. An accessor-backed slot's getter is not invoked by collection entry extraction. Each accepted data value still passes through the React-free review presentation validator, and duplicate validatedthreadKeyvalues are rejected. The 1,024 value is a private adapter render-work bound, not an external protocol/schema limit. This contract intentionally does not claim that JavaScriptProxyreflection traps cannot execute.The component also treats actor/label/action inputs as untrusted host presentation data. Current behavior covers host actor labels with whitespace normalization, optional timestamps, custom
renderActor, native submit proposal actions, read-only rendering, hostile React-node/accessor/prototype inputs, and deterministic keyboard traversal.ArrowDown,ArrowUp,Home, andEndmove DOM focus only among thread-selection targets; traversal does not commit host-controlled selection or invokeonSelectThread. Native activation remains the selection boundary. Semantic-summary label callbacks are normalized through the publicCwlReviewPresentationErrorboundary rather than leaking private host-localization exceptions. The component emits presentation/action intent only; the host remains admission/transport/authorization authority.Standalone product boundaries remain intact: no service, database, credential, network, model, host identity, tenancy, or durable persistence authority is introduced. Model/provider output remains untrusted proposal data.
Exact TDD / failure lineage
The keyboard behavior was added test-first on this existing owner branch:
2fb8a12c192f38194c646e164ae2abd187f66e09added a realistic two-thread traversal contract. Exact CI run32601503553failed in build/test job97100353882before the production change, while Security and SAST remained terminal success.ed0fe008facc1fae051f76fb25aaed6acda6e01badded a neutral-key control so non-navigation keys do not move focus.7423f6ca69dfa16afaaaeb9c8bc5b4b42bc81867added the narrow focus-only implementation insrc/review-react/index.tsxwithout adding persistence, transport, authorization, or selection authority.The collection-ingress behavior was then repaired test-first on this same owner branch:
987c27692bfd8e164b1d99e65c14351bad9fe68fadded realistic contracts for accessor-backed entries and an oversized collection. Exact CI run32613146473failed in build/test job97129296916on exactly the two new assertions while 863 existing tests passed. This falsified the prior collection-preflight claim: an accessor-backed entry could be evaluated before validation, and an oversized array was not rejected before entry inspection.771c156d1eb787908e75dfcaea9a9d6c1c8fc39cadded the narrow collection preflight and extended the contract tests to sparse and non-enumerable entries. No host getter is used to extract an array-slot value, and the bound is checked before slot inspection.A later exact-head CI failure exposed a test-contract contradiction in the semantic-summary failure case rather than a production behavior defect:
d0ebe3c52c854d9e7ed93b199b24366f9f13e60dfailed CI run32632930281, build/test job97178334460, becausesemanticSummary.test.tsxcompared a newly constructed genericErrorwhile production deliberately normalized private host callback failures to the publicCwlReviewPresentationErrorcontract.eb91c8ff945b9f6dac0a3b9edd10433313969eea: the test now asserts the exportedCwlReviewPresentationErrortype. Production error normalization was not weakened or bypassed.All workflow evidence attached to predecessor heads, including prior
7423f6...,987c276...,771c156..., andd0ebe3...runs, is lineage only and is non-passing for the current head.Exact-current evidence
For exact head
eb91c8ff945b9f6dac0a3b9edd10433313969eeaagainst protected base3b38ead2d00f44eb578d0689087b9293b3dabe1eat the immediate pre-write refetch:32638108233: completed / success.97190787031: completed / success; steps include checkout, frozen-lock install, typecheck, test with 100% coverage, library build, packed-package consumer verification, and demo build.97190786861: completed / success.97190787017, 3.1297190786985, 3.1397190787058, and 3.1497190787032: completed / success, including 100% docstring coverage, 100% branch coverage, wheel build, and packaged schema/license verification.32638108228: completed / success.32638108250: completed / success.Pending, queued, in-progress, skipped, cancelled, absent, neutral, failed, stale, predecessor, status-only, model-only, or wrong-head evidence is non-passing. Repository checks do not substitute for separately applicable central workflows, qualifying review, or then-live governance. The generic cross-engine repository job is not represented as proof of all review-specific browser or screen-reader scenarios that remain in #374.
Ownership boundary
Inkspan owns deterministic review target/suggestion validation, canonical revision/selector evidence, revision-only operation classification, bounded provider-neutral presentation metadata, controlled accessible presentation, collection-ingress workload/preflight semantics, focus-only keyboard navigation semantics, and normalization of presentation callback failures to its public presentation-error contract in this slice. Hosts continue to own durable comment/thread/suggestion IDs and bodies/records, actor identity, authentication/authorization, tenancy, persistence, retention/legal hold, notifications, durable audit, cross-revision re-anchoring/conflict policy, collaboration-provider admission/room authorization, credentials, transport, model policy, and network services.
Remaining #374 work
This PR does not close #374. Remaining work includes:
Integration boundary
Keep this PR Draft while #118 owns the frozen
v0.6.0publication/provenance/digest boundary. Before any lifecycle transition, refetch exact head/live base, ancestry/mergeability, live governance, formal reviews/threads, and all applicable exact-head repository/central workflows. Do not self-approve, weaken gates, transfer predecessor evidence, fabricate release identity, or represent Draft behavior as protected-main shipped truth.