Skip to content

test(fuzz): establish documentation extraction and source mapping fuzz coverage #1663

In review

Description

@dekobon

Current execution: locally complete and integrated; publication pending

Final 04dc92190555aa5ca6be55f95babd12f74a14a89 has Astra/Fable and focused
identity/cost acceptance. The parent fast-forwarded its exact reviewed tree into
the clean feat/1654-documentation integration branch.
Completion, exact commands and revision-qualified evidence.

Final validation: 19 fuzz tests, 15 intended mutation catches, seven producer
controls, fuzz-check, sanitized replay, a 2,367 ms inherited-depth replay, full
gate and hooks passed. All 53 seed bytes are unchanged. Parent verified 58 evidence
hashes. Final gate: 7,743 workspace tests and 413 Python tests passed; configured
skips, one ignored doctest, one Python expected failure and environment warnings
are recorded in the completion evidence.

Full campaigns remain attributed to 2c98909c: documentation smoke initialized
1,483 inputs despite 1,000 requested; the other 12 targets completed 1,000 each;
documentation completed 10,000 runs with seed 3795977872. Full campaigns were
intentionally not repeated solely for removing an unused observation allocation.
Fresh replay qualifies that final delta. Later adapter obligations remain separate.
This issue stays open pending publication and main merge.

Earlier acceptance review

Clean7c139410c947bc006cb2435209d891cf2994ee30 has fresh19-test/clippy/full-gate/
hook validation. Runtime-equivalent2c98909c has14maintained mutation catches,
7producer controls and fresh sanitized replay/smoke/10000documentation campaign.
Parent verified59 evidence hashes and the final test-only delta. Documentation
smoke initialized1483 corpus inputs despite1000requested; this is not reported
as1000mutation iterations. All53 seed bytes remain unchanged.
Persistent evidence and review limits.

Focused identity review approves the runtime correction. Astra requests a valid
resolution assertion outside the wrong-candidate rejection closure; cost review
requests cfg(test) around an allocating observation. Fable corroborates both and
requests discoverable producer-driver/env-var instructions in the guide. All
readers are finished; the sole fuzz writer has the local heavy slot for these
three narrow corrections and focused verification/replay. No final acceptance or
integration is claimed. Earlier full campaigns remain revision-qualified evidence;
any unrepeated campaign and exact runtime difference will be reported explicitly.

Approved remediation contract

Astra, Fable and Argon unanimously accept the revised
fuzz remediation V2.
The single fuzz writer resumes from clean099df858 with the local validation slot.
The plan fixes runtime provenance identity, actual mode-execution witnesses,
seed-resolution assertions and full public-field repeat comparisons. Reference
membership uses ID-keyed candidates plus full NodeEvidence validation; the active
flag witness is test-only through public APIs. Seed bytes and ratified budgets stay fixed.

Completed pre-fix probes found six expected catches and the mode, resolution,
runtime-evidence and strict repeat-role survivors recorded in the conversation.
No production-library failure was established. The restart removed local temporary
raw logs; those are marked unavailable, not reconstructed as execution. Completed
checks are not rerun solely for recovery. New verification records will be saved
persistently and in maintained regression artifacts. This issue remains incomplete
and unintegrated until fresh validation and remediation acceptance.

Earlier review and probe record

At frozen 099df858523ea318cb8175f02828dfbb66b405b3, all11 post-audit fuzz
tests now pass. All seven review roles returned after Fable's network retry.
Fable corroborates the four source-derived oracle gaps: qualification evidence
identity, witnessed mode execution, exact seed resolution and complete repeat-field
comparison. Mutation survival still needs execution; no production-library failure
is established. The consolidated draft preserves output-proportional checking and
distinguishes actual execution observations from merely echoing decoded flags.

The budget-unit clarification
has unanimous Astra/Fable/Argon approval: eight sampled subjects with at most
twenty ordinary cross-check invocations, and256 for new structured generators.
Inherited512 inputs retain the32KiB documentation cap. Parent executed the exact
512-construct Rust input:1050bytes and Outcome::Checked; the ASan nested_depth
target completed it in2468ms under60s timeout.
Execution evidence and scheduling.

#1662 completed local qualification and released the heavy slot. A sole probe
operator now runs the six maintained fuzz mutants and bounded targeted decoder,
call, producer-evidence/resolution and second-collection probes at099df858.
Temporary changes require exact restoration; no permanent library fix or broad
campaign is authorized. Results remain pending. Remediation design approval and
implementation follow recorded outcomes. This issue is not complete or integrated.

Ordered-audit checkpoint

Clean audit checkpoint 099df858523ea318cb8175f02828dfbb66b405b3 changes only
cfg(test) assertions and the mutation manifest over f92e663. The ordered
simplify-rust → rust-optimize → audit-tests source passes are complete. Two
assertion gaps were strengthened and two intended-test mutations added; their
behavioral validation is still pending.

Parent verified the runtime harness and seed bytes are unchanged. Earlier finite
campaigns remain evidence for that code, not for the new assertions. All seven
read-only review roles are dispatched. The bounded input/source identity pass
approves its examined paths statically; the other reviews remain active.
#1662 retains the heavy-check slot. Post-audit tests, six mutations and full gate
await a slot. This issue is not complete or integrated.

Ordered-audit changes and independent-review evidence.

Validated runtime candidate

Clean candidate f92e6636cb12c0477d0b27edac03bd4361443182 passed standalone
tests/clippy, all53 registered seed assertions,4 behavioral mutation guards,
representative feature isolation, sanitized fuzz-check, all13 replay targets,
all13 targets ×1000 smoke runs, and10000 documentation runs (seed3487411906).
The full gate has exactly one passing BCA_GATE verdict:7743 workspace tests,
4skips;413 Python tests,1expected failure. All-files hooks passed.

Parent verified the saved gate/campaign/mutation results,26 evidence checksums
and unchanged seed bytes. Initial bootstrap/smoke tool interruptions and owned
compilation/fixture/mutation-invocation failures remain recorded alongside repairs.
No production crash or sanitizer finding was reported in these bounded campaigns.

The validation handoff released the heavy-check slot to #1662. Its results remain
revision-qualified while #1663's post-audit assertions and independent reviews
are pending, as described above.

Candidate results, exact commands and campaign evidence.

Earlier source checkpoint and validation plan

Clean signed checkpoint bd1d9ac5064c53702151dd2f60f4aa7de56adc12 contains
parse-once documentation fanout, explicit25-language dispatch and53 byte-exact
seeds:17 positive,6 deferred,2 helper and28 edge/control cases. Formatting,
generator/manifest checks, Markdown lint, uncached rumdl, diff checks and
independent seed-byte checks passed.

No Cargo build/test, bootstrap, full gate or fuzz campaign ran at that
checkpoint.
Semantic assertions and property code still need execution.

#1662 has released the heavy-check slot; #1663 now owns it. The one fuzz writer
will apply the independent documentation review's corrections, bootstrap, compile,
run focused tests and mutation proofs, then execute the fixed fuzz-check/replay/
1000-run smoke/10000-run documentation sequence and final pre-commit gate.
The approved V2 design
and resource limits remain unchanged. Ordered audits, independent code reviews
and acceptance follow. This issue is not complete or integrated.

Checkpoint, documentation review and scheduling record
records the exact revision and distinguishes planned checks from completed work.

Current planning base

The bounded infrastructure proposal
is now under Astra/Fable/Argon council review. It adds parse-once direct-ASTfuzz
fanout, stable25-language tags, independentseed/outcomechecks,32KiB/two-index/
eight-owner/eight-maplimits and finiteASancampaigns. #1663 owns fuzz files and
uses existing public APIs; #1662 alone owns anyASTrender support seam. Writers
start only after unanimousapproval, with sequentialheavyvalidation/campaigns.

JointD05/D06islocallycompleteandintegratedatexact
9abf9720cd5d1506455cb94fed5b0009f4fc1a15.
Collector completion
andtext completion.
The directborrowedASTcollector,canonicalowner/qualificationqueries,andtrusted
text/originviewsarenowrealproductionseamsforparse-oncefuzzintegration.

Read-onlyplanningisactive. Anisolatedbranch
feat/1654/1663-documentation-fuzz wasallocatedfrom9abf9720. Proposeddesign
willreceiveunanimouscouncilreviewbeforeimplementation; no completionclaim.
InitialinfrastructureusesrepresentativeimplementedpathsandallLANGdispatch;
sixdeferredadaptersmuststayexplicit,andtheirissuesowntheirpositiveseeds.

Objective

Exercise direct AST documentation operations in the existing parse-once fuzz architecture before adapters close.

Umbrella: #1654 · Planning ID: D26
Completion prerequisites: D05: #1661, D06: #1660

Shared architecture and constraints

Follow the umbrella's shared contracts. AST recognition serves two consumers: exact legacy convention/coverage streaming for root LOC, and richer source documentation for owner lookup and local text. Source attachment, profile eligibility and physical metric ownership are separate. Preserve the current legacy candidate view before run selection, coverage ordering and metrics-only early exits, including existing logical-line precomputation where required.

Documentation fragments, logical documents and convention-qualified owner edges have separate identities. Source offsets refer to the actual parsed buffer and included ranges. The index is caller-owned, immutable and source-bound; lookup validates tree/index identity. Complete text means local decoded/cleaned content with forward source mapping, not inherited or generator-expanded documentation.

Implementation touchpoints

  • big-code-analysis-ast/src/cancel.rs and node/parser_cache.rs: current ParseCancel behavior and complete-parse input contract.
  • big-code-analysis-ast/src/node/ancestors/{chain,siblings,folds}.rs: current derived-chain, sibling-record and memo implementations.
  • fuzz/Cargo.toml
  • fuzz/src/lib.rs
  • fuzz/fuzz_targets/
  • fuzz/corpus/

Implementation steps

  • Extend recovery/fuzz inputs with current deep iterative, zero-width and cancellation-completeness cases while preserving source-bound identity and local-error outcomes.
  • Integrate current recovery-driver seeds and role documentation fixtures with the new extraction workload, retaining independent mapping/owner invariants.
  • Add the AST path dependency and call its operation using the existing parsed tree/source. Preserve one-parse fanout; no stable facade dependency until D23 adds facade coverage.
  • Exercise collection, lookup, raw access, local text availability and forward mapping, including segmented/unknown content without unconditional flattening.
  • Add language-tagged coverage or targets/seeds for every LANG variant, since current per-language targets cover only a subset. Helper outcomes are explicit; source languages require exercised positive seed cases.
  • Close infrastructure on an actual D05+D06 comment path, dispatch coverage and initial seeds; adapter issues own their additional cases.
  • Check local range/identity/order/mapping properties and unrelated valid docs surviving local errors. Preserve included-range behavior in synthetic adopted-tree tests where relevant.

Tests and edge cases

  • Small-stack or isolated deep assignment/list/declarator cases; root-based MISSING-node navigation; controlled cancellation; raw CRLF/EOF/extra ERROR cases with exact expected shapes.
  • Included-range gaps versus lexical continuation gaps, equal-shaped nodes with different context, partial comment/string delimiters, and cache-preserving recovery traversal in all language dispatches.
  • Source ranges in bounds and inside included segments; output mapping origins correct by category and index identity enforced.
  • Repeated query determinism, enumeration/lookup agreement and no cross-index owner leakage.
  • Seeds for EOF docs, concatenation/parentheses, data POD, conditional/gathered docs, attributes, invalid bytes and unknown text.
  • Verify language-tagged dispatcher reaches every declared variant; capabilities alone are not positive support.
  • Run make fuzz-check and seed replay; bound exploratory runs with -runs=N. Promote minimized failures into normal regression tests.

Use independently specified expected owners, fragment counts/order, byte ranges, text and availability. Pair them with separate legacy metric assertions where relevant. Do not sort/trim observed results, rely only on facade/delegate equality, or accept generated snapshots without an expected-value anchor. Use verbatim source for EOF/CRLF cases. Perturb the decision-bearing expression and confirm the intended assertion fails; use the maintained utils/perturb.py only on tracked, clean targets, recording or stashing real work first. Multi-target cargo runs require --no-fail-fast; include the mutated crate and dependent crates before claiming a unique guard. Keep irreproducible fixtures/manifests in tests, maintained utils or an issue attachment, following the “Temporary files” and “Evidence for a claim” rules in AGENTS.md.

Acceptance criteria

  • The workspace-excluded fuzz crate builds and replays its committed corpus.
  • One parse exercises the real AST collector/text code and all-language seed coverage is explicit.
  • Adapter-owned seeds and D23 facade additions have clear completion ownership.

Verification and completion evidence

  • Follow current docs/development/testing.md and docs/development/grammar_dispatch.md. Assert deterministic work counters exactly and measure both cached-state computations and slot searches where relevant.
  • Use the current pre-implementation base and grammar pins; completed fixes and documented retained limitations have different expected outcomes. Do not restore an obsolete baseline to make a migration pass.
  • Follow current role-census/role-coverage/role-bypass requirements and applicable role-parity-corpus checks. Preserve independent semantic fixtures; refresh .role-coverage-observed.txt when any sampled corpus gitlink changes.
  • Put revisions, exact commands, tool versions and durable input links beside parity/coverage claims; host-local evidence paths are not citations.
  • Recheck current source and the prerequisite contracts/baseline applicable to this issue; record intentional changes to the premises.
  • Run focused production-path tests and affected language siblings. Use package-isolated -p big-code-analysis-ast / -p big-code-analysis feature builds; workspace feature unification is not isolation.
  • Run the repository's required checks for the touched surfaces. For implementation changes: make worktree-setup, make pre-commit read from its BCA_GATE: verdict, and relevant test-language membership comparison. Add scaling and chain-audit checks for traversal changes; run make fuzz-check and seed replay for fuzz changes.
  • Record exact test/perturbation/probe evidence in a completion comment and update this body. Review unexpected metric drift before snapshot acceptance; follow baseline and integration-submodule discipline if behavior deliberately changes.
  • Land public API documentation, re-export/stability review and changelog entries with the originating API change. Keep unrelated CLI/web/Python surfaces outside this issue unless explicitly listed.

Current implementation notes (2026-11-17)

Revalidated against 91087f52f5d4a58e31ae320851351990f1436411. These notes replace the November 4 implementation notes; the earlier review is retained in this issue’s comment/edit history. Relevant work: PR #1845, PR #1884, PR #1895, PR #1935.

  • Replay current tracked corpus inputs and mutation-derived DLOC/role cases. Recovery tests must assert the intended tree shape, not accidentally certify a fixture the grammar now parses differently.
  • Exercise iterative owner/member/name extraction on deep assignments, nested literal lists and declarators. Existing Python/Elixir NPA fixes do not automatically make the future extraction helper iterative.
  • Use the owning root/chain for deep zero-width navigation (fix(ast): Node::parent on a deep zero-width node overflows the stack in tree-sitter #1941), not a Node::parent oracle with the same limitation. Include zero-width-at-boundary, cloned-tree and shifted-node identity cases.
  • Qualify cancellation behavior according to D01: partial/cancelled construction is not a successful empty record. Keep deterministic cancellation tests separate from unbounded random timing, and preserve no-cancel normal-path coverage.
  • The open Tcl/iRules grammar issue fix(tcl): a \-continued comment parses its next row as code #1802 and Python scanner gaps need explicit limitation cases; do not interpret parser-invented command nodes as proven source declarations.

D01 accepted architecture coordination (2026-11-18)

Initial infrastructure completion requires all-LANG dispatch and representative positive implemented paths, not positive extraction from future adapters. Each adapter supplies its own positive seed and final #1681 verifies the full independent inventory. Ordinary raw-seam fuzz paths do not install ParseCancel; explicit cancellation probes use typed parser provenance. Preserve parse-once fanout through existing Ast accessors.

Accepted V2/V3 decision record; D01 artifact checkpoint. Architecture approval does not complete this issue. The durable contract and exact form inventory are still under artifact review; implementation checkboxes remain open. Local completion, publication and merge are distinct.

Activity

  1. added
    enhancement
    on Oct 21, 2026
  2. 6 remaining items

  3. dekobon commented on Nov 18, 2026

    @dekobon
    OwnerAuthor

    Updated this issue body against 91087f52f5d4a58e31ae320851351990f1436411 after the November 4 review. Extend recovery/fuzz inputs with current deep iterative, zero-width and cancellation-completeness cases while preserving source-bound identity and local-error outcomes.

    Added tests: Small-stack or isolated deep assignment/list/declarator cases; root-based MISSING-node navigation; controlled cancellation; raw CRLF/EOF/extra ERROR cases with exact expected shapes.

    Evidence: PR #1845, PR #1884, PR #1895, PR #1935. The dated body section replaces stale implementation notes and records current source paths and prerequisite outcomes. Original extraction acceptance criteria and issue status remain open; this was source/history review, not an implementation or gate run.

  4. dekobon commented on Nov 18, 2026

    @dekobon
    OwnerAuthor

    docs(ast): align implementation requirements with accepted D01 V3

    Initial infrastructure completion requires all-LANG dispatch and representative positive implemented paths, not positive extraction from future adapters. Each adapter supplies its own positive seed and final #1681 verifies the full independent inventory. Ordinary raw-seam fuzz paths do not install ParseCancel; explicit cancellation probes use typed parser provenance. Preserve parse-once fanout through existing Ast accessors.

    Updated the issue body. Decision record; D01 checkpoint. No implementation completion is claimed; this issue remains open.

  5. dekobon commented on Nov 20, 2026

    @dekobon
    OwnerAuthor

    test(ast): prepare documentation fuzz infrastructure from integrated collector

    D05/D06completeandintegratedat9abf9720;evidence.
    Read-onlyplanactive,isolatedfuzzbranchallocated. Realparse-oncecollector/text/
    qualificationseamsnowavailable; initialdispatchandrepresentativepositivescope
    remainsdistinctfromlateradapterseeds. Councilreviewbeforewrites; bodyupdated.

  6. dekobon commented on Nov 20, 2026

    @dekobon
    OwnerAuthor

    test(ast): submit bounded all-language documentation fuzz design

    Proposal
    iswithAstra/Fable/Argon: parse-oncefanout,25stabletags,registeredpositive/deferred/
    helperseeds,boundedpropertiesandfinitecampaigns. Disjointwritersafterapproval;
    heavycampaignsserialized. Base9abf9720,sourceunchanged. Bodyupdated.

  7. dekobon commented on Nov 20, 2026

    @dekobon
    OwnerAuthor

    test(ast): begin approved documentation fuzz implementation

    Astra/Fable/ArgonacceptexactV2.
    Fuzzwriterstartedcode/seedsinisolatedbranchfrom9abf9720; #1662holdsinitial
    bootstrap/buildslot. No competingheavyjobs; checks/campaignsfollowassignedslot.
    Bodyupdated; no completionyet.

  8. dekobon commented on Nov 20, 2026

    @dekobon
    OwnerAuthor

    test(ast): begin validation of the documentation fuzz checkpoint

    Checkpoint bd1d9ac5064c53702151dd2f60f4aa7de56adc12 has53 seeds and passed
    lightweight checks. It had no Cargo or campaign execution. The independent
    documentation review is complete and its corrections are assigned to the writer.

    #1662 released the heavy-check slot; #1663 now begins bootstrap and semantic
    validation, followed by the fixed finite campaigns. Updated the issue body;
    no completion or integration claim.

    Checkpoint and review evidence.

  9. dekobon commented on Nov 20, 2026

    @dekobon
    OwnerAuthor

    test(ast): validate documentation fuzz candidate and begin ordered audits

    Cleanf92e6636 passed53 executed seeds,4 behavioral mutations, sanitized fuzz-check,
    all13 replay targets,13×1000 smoke runs and10000 documentation runs. Parent checked
    the actual logs,26 evidence checksums and passing BCA_GATE verdict. Initial tool
    interruptions and repaired failures remain in evidence; seed bytes are unchanged.

    The heavy slot moves to #1662. One #1663 audit writer begins the required ordered
    passes; independent code reviews and acceptance remain. Updated the issue body.

    Revision-qualified validation evidence.

  10. dekobon commented on Nov 20, 2026

    @dekobon
    OwnerAuthor

    test(ast): freeze fuzz audit checkpoint for independent review

    Clean099df858 changes only cfg(test) assertions and the mutation manifest. Parent
    verified the runtime harness/seeds match validatedf92e6636. Ordered source passes
    are complete; new qualification/Kotlin assertion guards and six mutations remain
    unexecuted. Earlier campaigns do not qualify these new assertions.

    All seven read-only review roles are dispatched. The input/source boundary pass
    approves its examined paths statically. #1662 keeps the heavy slot; post-audit
    execution and any finding probes wait. Updated the body; no completion claim.

    Revision and review limits.

  11. dekobon commented on Nov 20, 2026

    @dekobon
    OwnerAuthor

    test(ast): verify post-audit assertions and inherited-depth input

    All11 fuzz tests passed at099df858. The exact512-construct inherited Rust input
    returned Checked and completed the ASan target in2468ms under60s timeout.
    Evidence.
    The budget-unit addendum is unanimously approved. Four source-derived oracle
    findings await parent mutation probes; Fable's full review remains active.
    Source stays frozen; no production defect or completion claim is made.

  12. dekobon commented on Nov 20, 2026

    @dekobon
    OwnerAuthor

    test(ast): complete fuzz reviews and queue oracle discrimination probes

    Fable's retried review returned and corroborates the four source-derived oracle
    gaps. All seven passes are complete. Parent prepared bounded corrections using
    indexed reference membership, full canonical evidence and actual mode-execution
    witnesses; no implementation authority or mutant-survival claim yet.

    The six maintained mutations and decisive new probes wait for #1662 to finish
    its heavy validation. Existing11-test and512-construct ASan checks remain passed.
    Review record.
    No production-library defect or completion claim is made.

  13. dekobon commented on Nov 20, 2026

    @dekobon
    OwnerAuthor

    test(ast): begin bounded fuzz-oracle discrimination probes

    #1662 released all heavy jobs after successful local qualification. A sole
    temporary-mutation operator now tests the six maintained guards and targeted
    mode/provenance/resolution/repeat cases at099df858. Direct runtime checking and
    the stronger registry callback are evaluated separately, with exact restoration.
    No result or production-library defect is claimed yet. The issue body is updated;
    remediation authority follows the recorded probe outcomes.

  14. dekobon commented on Nov 20, 2026

    @dekobon
    OwnerAuthor

    fix(fuzz): resume unanimously approved oracle remediation after restart

    All three council reviewers accept exactV2. The writer resumes from099df858 with
    the idle local heavy-check slot, preserving53 seeds and all ratified budgets.
    Approved proposal and recovery record.
    Pre-fix probes are complete; their deleted temporary logs are not fabricated or
    reexecuted for recovery. Fresh post-change tests, mutations and sanitized campaigns
    will have new persistent evidence. Final acceptance and integration remain pending.

  15. dekobon commented on Nov 20, 2026

    @dekobon
    OwnerAuthor

    test(fuzz): verify remediation candidate and retain narrow review gaps

    Parent verified persistent evidence for7c139410, including final gate and byte-
    identical runtime from campaign2c98909c.14mutants,7producer controls and fresh
    campaigns are recorded; actual smoke initialization count1483 is explicit.
    Evidence.
    Identity review approves; Astra's negative-control setup and one observation-cost
    finding await correction after Fable finishes. No production failure or final
    completion is claimed.

  16. dekobon commented on Nov 20, 2026

    @dekobon
    OwnerAuthor

    test(fuzz): correct final acceptance-test and observation gaps

    All readers finished. The writer is pinning valid resolution outside catch_unwind
    and the actual first identity-panic site, test-gating the allocating IncludedParse
    witness, and documenting the producer driver and its test-only environment mode.
    Focused validation/replay and final gate use the local heavy slot.
    Review record.
    No production semantic defect or final completion is claimed.

  17. dekobon commented on Nov 20, 2026

    @dekobon
    OwnerAuthor

    test(fuzz): complete and integrate reviewed documentation infrastructure

    Integrated exact approved 04dc9219 locally. Final 19 tests, 15 intended mutation
    catches, seven producer controls, replay, gate and hooks passed; all 53 seeds are
    unchanged. Completion and exact evidence.
    Campaigns remain attributed to 2c98909c; fresh replay qualifies the final unused-
    allocation removal. This issue stays open pending publication and main merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions