Skip to content

fix(ci): CodeLens CI/Quality Gate broken on main since #195 consolidation #235

Description

@Wolfvin

Mengapa

Ditemukan saat navigasi PR #234 (agent-tooling audit session), bukan scope task itu. Verified CI is red on main itself — checked gh run list --branch main: the merge commit for PR #233 (the last merge before this) already shows CodeLens CI and CodeLens Quality Gate as failure. Not caused by any specific recent PR; pre-existing workflow rot.

Two distinct root causes found (both need separate fixes):

1. quality-gate job calls a dropped top-level command:

Run python3 scripts/codelens.py init .
codelens.py: error: argument {api-map,audit,context,deps,doctor,graph,history,impact,scan,search,security,summary}: invalid choice: 'init'

init was absorbed into the scan umbrella command in the #195 consolidation (scan absorbs: scan/init/rescan — see CONTEXT.md) and no longer exists as a standalone CLI command. The quality-gate workflow YAML (.github/workflows/*.yml, whichever job runs "Initialize CodeLens") still invokes the old standalone form. This fails on every push to main, every PR — the CI has been broken since #195/#196 landed.

2. Test Suite job segfaults in test_large_file_parsing.py:

Fatal Python error: Segmentation fault
  File ".../scripts/parsers/python_parser.py", line 301 in _extract_references_impl
  File ".../scripts/parsers/python_parser.py", line 126 in extract_references
  File ".../tests/test_large_file_parsing.py", line 119 in test_file_above_old_threshold_is_parsed

Crashes the whole pytest process (exit 139), aborting every test after it alphabetically (everything from test_large_file_parsing.py onward never runs in CI, including test_query_graph.py, test_codelens.py variants that sort after it). This matches why the previous session's documented test baseline methodology explicitly used --ignore=tests/test_large_file_parsing.py — it's already known-unstable locally, just never fixed at the source.

Konteks

Both failures reproduce on a clean main checkout, independent of any feature branch. This blocks CI green-checks on literally every future PR until fixed — not something any single feature PR should be expected to fix as a side effect.

Tujuan

CI passes (or at minimum, doesn't segfault/hard-fail) on a clean main checkout.

Constraint

  • Per this repo's CLAUDE.md: CI/workflow YAML changes are always done directly by BOS (Claude), not delegated to z.ai workers — historically unreliable for workflow syntax/env-var context.
  • Fix feat: add codelens-watch.py — file watcher with auto outline.json generation #1 (quality-gate) is likely a 1-line change (swap init for whatever scan's equivalent init-only invocation is, or drop the step if scan auto-inits).
  • Fix refactor: refocus CodeLens — archive frontend, remove garbage, keep core only #2 (segfault) needs actual root-cause investigation in python_parser.py::_extract_references_impl under large-file input — do not just skip/ignore the test without understanding why a C-extension-backed tree-sitter call segfaults (could indicate a real memory-safety bug reachable from real large Python files, not just a test artifact).

Definition of Done

  • quality-gate job's "Initialize CodeLens" step succeeds on a clean checkout
  • Test Suite job no longer segfaults; either the root cause in _extract_references_impl is fixed, or (if genuinely a test-only artifact unrelated to real usage) documented why with a narrow, justified skip — not a blanket ignore
  • A full CI run on main (or a trivial PR) goes green

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions