Repository navigation
test: add focused Hypothesis coverage and daily exploration - #69
hesreallyhim wants to merge 32 commits into
Conversation
Development-only in both projects, locked with uv. Each suite registers an ordinary and an extended profile; both disable per-example deadlines and explicitly randomize, overriding Hypothesis's derandomized CI profile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JSON can carry lone surrogates. Escapes of bytes that form valid UTF-8 (\udcc2\udc80 for U+0080) passed validation, then changed identity when a document or transport re-encoded them. Only the canonical surrogateescape decoding now identifies a path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Documents: generated trees render and parse to facts built from the model, updates preserve bytes outside the region across BOM, CRLF, and fenced examples, unsupported entries are document errors, and parsed documents re-render to the same meaning. Unrepresentable symlink targets must be rejected. Sessions: rejected edits change nothing, and JSON transport preserves curation and later behavior. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A placement conflict on a non-UTF-8 path put the raw question into the error's extra fields, which bypassed message escaping, so the JSON response failed to encode and the request returned 500 instead of 409. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Equivalent config is retained verbatim, so an undecodable byte in a config comment reached the region text and the preview failed with 500 after the snapshot was cached. The service shows the region as text, so it now reports a curation error before caching. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Define the browser test mechanism and Node requirement, the identity domain and controlled errors, the fabricated-commit and server-state requirements, unrepresentable entries on printed text, execution profiles, the shared startup validator, and the URL-sink checks. Independent review corrected two first-draft claims and found two hosted 500 responses, now fixed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hypothesis auto-loads its CI profile when CI is detected; deriving from the default profile keeps local and CI settings identical apart from what the suite chooses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A test-owned predicate reads names, targets, and annotations as printed, with trailing whitespace escaped. The renderer must reject exactly the rows it matches and round-trip all others, so an unexpected rejection and an over-broad predicate both fail. Corrects the ADR example accordingly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Arbitrary JSON and single-field mutations of valid operation and placement requests must end in domain rejections. Accepted requests keep their source and stay within the snapshot tree; rejected ones leave the cache, including expiry, unchanged and make no upstream request. Pinned commits drawn from real objects and random hex never name the commit upstream or read trees or blobs. Each example uses a fresh application. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A link or saved draft whose settings root was null, missing, or a malformed byte path passed the shallow startup guard and threw while filling the form, before the service could reject it; a draft failed later, on resume. One validator now gates both journeys, so such links show the invalid-session error and such drafts are never offered. Responses also derive the repository link and history address from their own identity: a forged permalink could otherwise yield a protocol-relative address, and a forged link any URL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JSON.parse accepts very deep input, but restoring the session serializes it again, and JSON.stringify overflows the stack, leaving an unhandled rejection at startup. Saved states nest about five levels; decodeState now returns null beyond 32, so such links report invalid editing state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hypothesis generates fragments, routes, queries, captured sessions, stored drafts, and synthetic responses; a persistent Node worker evaluates them with the page's own logic.js and draft.js. Supported states keep identity, accepted sessions can be displayed, offered drafts can be resumed, and everything else ends in null or a controlled Error. Length and depth boundaries are explicit. The worker reports exceptions as data, checks Object.prototype, and restarts if it exits. Needs Node 24: skipped locally without it, failed under CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mutations choose a depth before a member and favor type swaps, and each example runs several independent single-field mutations in its fresh application. A deterministic sweep replaces every member of a valid operation and placement request with one value of each JSON type; it catches an injected missing revision check on every run, which random mutation found in about half of extended runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A dedicated fixture repository commits HTML, SVG, and event-handler payloads as Git paths and notes. Journeys through placement, the editor, Markdown output, the source browser, query errors, script-scheme input, and a synthetic forged repository link check literal text and the absence of foreign markup, executed sentinels, dialogs, stray requests, and navigation. Rendering journeys repeat with CSP bypassed in the test browser; a control shows the sentinels notice a payload that does run. Regressions cover links and drafts whose settings cannot be displayed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
make test-properties runs only the generated tests in both suites, and make test-properties-extended raises the example budget. The coverage workflow installs Node from .nvmrc, as the hosted job already does, because the hosted suite now drives the page's JavaScript modules. The testing policy describes generated tests, profiles, reproduction, and limits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Budgets, measured runtimes, the defects found and fixed, and the intentional-defect checks that each property detected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An absolute forged permalink with an empty owner still matched its own repository fields and yielded a protocol-relative address. Owner, name, and commit must now match the identities the service accepts, and the address is built from them, keeping only the permalink's query. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
capturedValues returns the form values startup shows, or null, and both the fragment and draft journeys use it. The decoding worker calls the same function instead of repeating app.js's conversions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The earlier check rejected any undecodable byte in the loaded region, so a hand-written row with a raw byte, which used to open and re-render with escapes, returned 422. Only bytes retained verbatim, such as a config comment, now need to be UTF-8; the composed region is checked before the snapshot is cached. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The error showed internal surrogates. It now names the text the escapes spell, and a document-level regression covers a row written with escapes of valid UTF-8. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Parametrized cases cover every rule the ADR lists, including representable neighbors, for both the predicate and the renderer; generators now often end names and targets with row syntax. The unsupported-entry property starts from a representable model, avoids name collisions, and matches the error. The prose filter follows the region finder's own boundary rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The clock advances before each mutated request, so a rejected request that renewed the snapshot lease now fails the expiry check. Request parsers may not raise MarkerError; only SVG export may. The request log records full URLs. Mutation documents its semantics and is never a no-op. Browser identity compares JSON text, and synthetic addresses must resolve on the page's origin. The worker shuts down through end of input, closes its pipes, and gives each process its own reply queue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop comments that narrate provenance or restate readable code, keeping only those that give a non-obvious reason. Names now carry what comments explained: RESPONSE_TIMEOUT_SECONDS, WORKER_EXITED, UNLIMITED, servable_object_ids, isDisplayableSession, lenient_json_values, TYPE_SWAP_VALUES, and test parameter ids. The prose filter imports the region finder's boundary pattern instead of copying it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
BittuBarnwal7479
left a comment
There was a problem hiding this comment.
I reviewed the test results and identified the following points:
Test results:
- Core suite: 1267 passed, 3 symlink-related failures caused by Windows permission restrictions.
- Web Python: 56 setup errors related to the
quote "me".txtfixture, which also reproduces onmain.
Review findings:
PUBLIC_BASE_URLdoes not correctly handle URLs containing a path.- Configuration comments containing non-UTF-8 bytes are not handled correctly.
Both issues are reproducible and need to be addressed. Thanks!
|
Thanks @BittuBarnwal7479 ! Could you clarify the first review finding a little bit? We operate the editor at the domain root and don't permit prefixes in the format of the URL. Could you share a URL or request that fails on the hosted service or the PR preview? For the second one: this branch regenerates otherwise valid config containing non-UTF-8 comment bytes, with regression coverage for preview and exchange between editors. If you can still reproduce a failure on 3abaabb, could you share the document and the steps you used? Thanks! 🙏 |
Thanks for the clarification! I checked both findings again. 1. I'll withdraw this finding. I couldn't reproduce it on the hosted service or PR preview. My test used a hypothetical URL with a path prefix ( 2. Non-UTF-8 configuration comments I can still reproduce this on I created a README with a generated Treestamp configuration and added a comment containing a non-UTF-8 byte ( Running
I understand that regenerating the configuration may be intentional. However, existing READMEs that passed |
4d83f10 to
9fc9de1
Compare
Clarify supported config formatting edits and refresh the README treestamp. Signed-off-by: Really Him <git-dev@hesreallyhim.com>
9fc9de1 to
70ada24
Compare
Signed-off-by: Really Him <git-dev@hesreallyhim.com>
|
ok thanks @BittuBarnwal7479 nice catch on that one - this was not sufficiently documented - we don't support manual editing of the config block, but we tolerate certain discrepancies - since treestamp doesn't write comments to the config, this is not officially supported behavior, but it was a regression compared to the behavior on |
Thanks for quick fix and clarification! |
|
@BittuBarnwal7479 can you submit a review when you have a chance? |
Adds generated tests for document semantics and preservation, core session transport, and hosted request parsing. Independent expectations catch input combinations missed by fixed examples, while durable documentation distinguishes product requirements from revisable format limitations and cache mechanics.
Supersedes the implementation proposal in #67. This branch includes the retained implementation and defect fixes from that PR, with the scope and interoperability changes described below.
Changes
tests/properties/andweb/tests/properties/. They run in ordinary test and coverage suites, with 100 examples per property and an extended 1,000-example profile. The initial scope excludes the Python-to-Node worker, broad service/cache mutation apparatus, and separate injection corpus; focused JavaScript and browser regressions remain.main.THIRD_PARTY_NOTICES. Accepted ADR 0006 records that convention; accepted ADR 0007 supersedes 0003. Current requirements live in durable documentation.Validation
Local validation on macOS, Python 3.11:
CI=true: 26 core cases and 3 hosted properties.Windows and container builds were not rerun locally for this branch. GitHub CI results and execution of the new scheduled workflow remain to be observed.