GitNexus/gitnexus/test/integration
marxo126 4bc4815bd2
feat: PHP response shape extraction for json_encode patterns (#502)
* feat: add PHP response shape extraction for json_encode patterns

Adds extractPHPResponseShapes() to detect response keys from PHP
json_encode() calls with associative array literals. Supports:
- Short array syntax: json_encode(['key' => value])
- Long array syntax: json_encode(array('key' => value))
- Error classification via http_response_code() and header() status
- exit;/die; boundary detection to prevent cross-block status leaking
- Nested array filtering (only top-level keys extracted)

Pipeline integration dispatches PHP files to the new extractor.
Verified on collector project: 10 PHP routes now show responseKeys.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address review — exit boundary, die; offset, CGI Status header

- Replace lastIndexOf('exit;')/lastIndexOf('die;') with regex that
  matches exit(N), exit(0), die('msg'), die($var) as boundaries
- Fixes die; off-by-one (was slicing at +5 for a 4-char keyword)
- Add header('Status: NNN') CGI/FastCGI format detection
- Add 3 regression tests for the fixed bugs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: extract shared helpers, remove duplicate test block

- Extract lastMatchGroup() and buildShapeResult() to eliminate repeated
  patterns in both JS/TS and PHP extractors
- Simplify detectPHPStatusCode to use ?? chaining with lastMatchGroup
- Remove duplicate 9-test PHP describe block (kept the 12-test version)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test: add PHP response shape integration tests

Adds a PHP fixture (api/items.php, api/submit.php) with multiple
json_encode patterns and a pipeline integration test verifying:
- Route nodes created for PHP endpoints
- responseKeys/errorKeys correctly extracted and separated
- exit(N)/die() boundaries respected
- HANDLES_ROUTE edges point to correct PHP handler files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 08:27:53 +00:00
..
resolvers feat: PHP response shape extraction for json_encode patterns (#502) 2026-03-25 08:27:53 +00:00
api-impact-e2e.test.ts feat: deep flow detection — consumer access tracking, middleware chains, error shapes, api_impact tool (#482) 2026-03-23 22:13:48 +00:00
augmentation.test.ts refactor: migrate from KuzuDB to LadybugDB v0.15 (#275) 2026-03-15 15:53:01 +00:00
class-impact-all-languages.test.ts fix(#480): resolve impact/context returning empty results for Java cl… (#489) 2026-03-24 21:46:46 +00:00
cli-e2e.test.ts fix(test): add --repo to CLI e2e tool tests for multi-repo environment 2026-03-18 08:12:25 +00:00
cross-file-binding.test.ts feat(type-resolution): Phase 14 enhancements — single-pass seeding, Tarjan's SCC, cross-file return types 2026-03-20 12:00:36 +00:00
csv-pipeline.test.ts refactor: migrate from KuzuDB to LadybugDB v0.15 (#275) 2026-03-15 15:53:01 +00:00
enrichment.test.ts test: add integration test coverage and fix KuzuDB fork crashes (#209) 2026-03-08 18:00:45 +00:00
filesystem-walker.test.ts feat(ingestion): respect .gitignore and .gitnexusignore during file discovery (#231) 2026-03-16 13:26:20 +00:00
has-method.test.ts refactor: SICP-informed LanguageProvider architecture (#488) 2026-03-24 13:42:39 +00:00
hooks-e2e.test.ts test: add integration test coverage and fix KuzuDB fork crashes (#209) 2026-03-08 18:00:45 +00:00
ignore-and-skip-e2e.test.ts feat(ingestion): respect .gitignore and .gitnexusignore during file discovery (#231) 2026-03-16 13:26:20 +00:00
java-class-impact.test.ts fix(#480): resolve impact/context returning empty results for Java cl… (#489) 2026-03-24 21:46:46 +00:00
lbug-core-adapter.test.ts feat: upgrade @ladybugdb/core to 0.15.2 and remove segfault workarounds (#374) 2026-03-19 08:25:43 +00:00
lbug-lock-retry.test.ts fix(lbug): retry on DB lock with session-safe cleanup (#325) 2026-03-22 18:21:21 +09:00
lbug-pool-stability.test.ts fix: MCP server crashes under parallel tool calls (#326) (#349) 2026-03-18 13:02:01 +00:00
lbug-pool.test.ts refactor: migrate from KuzuDB to LadybugDB v0.15 (#275) 2026-03-15 15:53:01 +00:00
local-backend-calltool.test.ts fix(impact): return structured error + partial results instead of crashing (#321) (#345) 2026-03-18 06:45:43 +00:00
local-backend.test.ts feat: upgrade @ladybugdb/core to 0.15.2 and remove segfault workarounds (#374) 2026-03-19 08:25:43 +00:00
parsing.test.ts refactor: SICP-informed LanguageProvider architecture (#488) 2026-03-24 13:42:39 +00:00
pipeline.test.ts test: add integration test coverage and fix KuzuDB fork crashes (#209) 2026-03-08 18:00:45 +00:00
query-compilation.test.ts refactor: SICP-informed LanguageProvider architecture (#488) 2026-03-24 13:42:39 +00:00
search-core.test.ts refactor: migrate from KuzuDB to LadybugDB v0.15 (#275) 2026-03-15 15:53:01 +00:00
search-pool.test.ts refactor: migrate from KuzuDB to LadybugDB v0.15 (#275) 2026-03-15 15:53:01 +00:00
setup-skills.test.ts test(cli): cover full Codex setup flow 2026-03-20 15:28:42 +01:00
skills-e2e.test.ts fix: register Section in NODE_TABLES and NODE_SCHEMA_QUERIES (#401) 2026-03-21 04:00:16 +05:30
staleness-and-stability.test.ts fix(test): unify staleness-and-stability into single withTestLbugDB block 2026-03-20 21:06:30 +09:00
tree-sitter-languages.test.ts refactor: SICP-informed LanguageProvider architecture (#488) 2026-03-24 13:42:39 +00:00
worker-pool.test.ts test: add integration test coverage and fix KuzuDB fork crashes (#209) 2026-03-08 18:00:45 +00:00