Skip to content

feat: add keep-gates, graph E2E, watch bounds, and span joins - #32

Merged
AdityaVG13 merged 17 commits into
mainfrom
test/pattern-diff-keep-gate
Aug 15, 2026
Merged

feat: add keep-gates, graph E2E, watch bounds, and span joins#32
AdityaVG13 merged 17 commits into
mainfrom
test/pattern-diff-keep-gate

Conversation

@AdityaVG13

@AdityaVG13 AdityaVG13 commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • run the Pattern-1 differential automatically when configured and require ast-grep 0.45.1
  • compare literal:return file presence across the checked-in 13-language fixture with ripgrep 15.1.0
  • preserve honest Not-run reporting when either external oracle is absent
  • bound watch freshness at three debounce windows during sustained same-path writes
  • ignore .asgrep and custom index artifacts before they enter the watch queue
  • publish the indexed-source freshness policy through capabilities, robot guidance, and docs
  • join pattern: and callers: conjunctions by overlapping span while preserving left-result identity
  • keep other conjunction pairs file-scoped and apply AND NOT at the corresponding scope
  • schedule a real pinned-Senpi graph E2E, fail hard on an absent or incomplete corpus, and retain its log as a CI artifact
  • keep full ast-grep and ripgrep identity explicitly outside the bounded contracts

This PR is intentionally stacked on #31 because that PR owns the Pattern-1 harness and native nested-pattern implementation. Related gate, freshness, query-composition, and graph-scale work is consolidated here to avoid PR bloat.

Verification

  • ASGREP_DIFF_AST_GREP=/opt/homebrew/bin/ast-grep cargo test -p ast-sgrep-core --test pattern_diff -- (5 passed, 0 ignored)
  • ASGREP_DIFF_RG="$(command -v rg)" cargo test -p ast-sgrep-core --test literal_diff -- (1 passed, 0 ignored)
  • python3 -m unittest scripts.tests.test_generate_compliance_report
  • cargo fmt --all -- --check
  • RCH cargo clippy -p ast-sgrep-cli --all-targets -- -D warnings
  • RCH cargo clippy -p ast-sgrep-core --all-targets -- -D warnings
  • RCH cargo test -p ast-sgrep-cli --lib watch::tests -- --nocapture (8 passed)
  • RCH targeted machine-contract golden tests for capabilities and robot docs
  • RCH cargo test -p ast-sgrep-cli --test watch_daemon_e2e -- --nocapture (2 passed)
  • RCH cargo test -p ast-sgrep-core --lib search::conjunction::tests -- --nocapture (13 passed)
  • RCH cargo test -p ast-sgrep-core --test conjunction_queries -- --nocapture (6 passed)
  • RCH real pinned-corpus archived_pi_fixture_graph_modes_match_indexed_keys in release mode (1 passed)
  • node --test tests/pi/launcher/*.test.mjs (23 passed after the Pattern-1 commit)
  • yq eval '.' .github/workflows/graph-scale.yml
  • real CLI E2E on tests/fixtures/pattern_diff: indexed one file and returned two structural process_request hits
  • real CLI E2E on tests/lang/fixtures/extract: indexed all 13 files; literal:return and ripgrep returned the same file-presence set
  • real watch baseline reproduced freshness starvation during sustained same-file overwrites; the regression now observes the token through a real CLI keyword search while writes are still arriving
  • real CLI pattern/caller fixture returned only the target function with pattern, caller, and graph contributors
  • real CLI pinned-Senpi index and searches returned definition, caller, graph, and import evidence with no indexing failures

Beads: ast-sgrep-o8ng, ast-sgrep-zxd9, ast-sgrep-o6i3, ast-sgrep-k1ns, ast-sgrep-mock-free-e2e-gaps-lbx1.5

Adversarial review remediation

  • Prevented duplicate-name call-path edge splicing and downgraded SCIP occurrence evidence from exact resolution.
  • Made pattern/caller joins require positional containment, including same-line and multiline-boundary cases.
  • Made codemod source apply capability-relative and resistant to parent-symlink swaps; source apply and index refresh are documented as separate transactions with explicit recovery.
  • Restored one-quiet-period watch debounce while preserving sustained-traffic maximum latency.
  • Clarified that external ast-grep/ripgrep gates are opt-in, repository vocabulary widens semantic work, and unsupported performance comparisons are not product claims.
  • Focused RCH evidence: conjunction unit suite 15 passed; watch unit suite 6 passed; real codemod CLI fixture and symlink regression 2 passed. Formatting and diff checks pass.
  • Review fix and stacked sync head: f525fd22. CI was not awaited.

AdityaVG13 and others added 2 commits August 15, 2026 01:53
Run the differential automatically when ASGREP_DIFF_AST_GREP is set, require ast-grep 0.45.1, and preserve honest Not-run reporting when the external oracle is absent.

Amp-Thread-ID: https://ampcode.com/threads/T-01a003f3-e62e-75ca-950f-0de88d7fe0fe
Co-authored-by: Amp <amp@ampcode.com>
Compare literal:return file presence across the checked-in 13-language fixture with pinned ripgrep 15.1.0, while keeping full ripgrep identity explicitly out of contract.

Amp-Thread-ID: https://ampcode.com/threads/T-01a003f3-e62e-75ca-950f-0de88d7fe0fe
Co-authored-by: Amp <amp@ampcode.com>
@AdityaVG13 AdityaVG13 changed the title test: gate Pattern-1 against pinned ast-grep test: add pinned external keep-gates Aug 15, 2026
@AdityaVG13 AdityaVG13 changed the title test: add pinned external keep-gates test: add keep-gates and bounded watch freshness Aug 15, 2026
@AdityaVG13 AdityaVG13 changed the title test: add keep-gates and bounded watch freshness feat: add keep-gates, watch bounds, and span joins Aug 15, 2026
@AdityaVG13 AdityaVG13 changed the title feat: add keep-gates, watch bounds, and span joins feat: add keep-gates, graph E2E, watch bounds, and span joins Aug 15, 2026
AdityaVG13 and others added 12 commits August 15, 2026 03:29
Amp-Thread-ID: https://ampcode.com/threads/T-01a003f3-e62e-75ca-950f-0de88d7fe0fe
Co-authored-by: Amp <amp@ampcode.com>

# Conflicts:
#	crates/ast-sgrep-cli/src/eval.rs
#	crates/ast-sgrep-core/src/search/mod.rs
#	crates/ast-sgrep-core/src/search/types.rs
#	crates/ast-sgrep-lang/src/pattern.rs
@AdityaVG13
AdityaVG13 changed the base branch from feat/engine-critic-planner to main August 15, 2026 20:13
@AdityaVG13
AdityaVG13 merged commit 9a3b4cd into main Aug 15, 2026
10 of 12 checks passed
@AdityaVG13
AdityaVG13 deleted the test/pattern-diff-keep-gate branch August 15, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant