Skip to content

feat(context): named-flow view — collect a flow's scattered functions (closes #309)#310

Merged
Wolfvin merged 1 commit into
mainfrom
feat/issue-309-named-flow
Jul 17, 2026
Merged

feat(context): named-flow view — collect a flow's scattered functions (closes #309)#310
Wolfvin merged 1 commit into
mainfrom
feat/issue-309-named-flow

Conversation

@Wolfvin

@Wolfvin Wolfvin commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Closes #309.

Yang dibangun

context --check flow --name X mengumpulkan semua fungsi ber-@FLOW: X jadi satu tampilan — rantai yang tersebar terbaca sebagai satu daftar. Tanpa --name → daftar semua flow. Persis framing Wolfvin: "1 flow, 1 command, semua function muncul dari yang tersebar."

## Flow: `PAYMENT` (3 functions)
- `validate_cart` — cart.py:3
- `charge` — gateway.js:1
- `checkout_route` — routes.py:3

Arsitektur (arahan Wolfvin: agent tulis, CodeLens simpan + sajikan)

Bukan auto-detect. Agent menulis @FLOW: NAME (sumber kebenaran); CodeLens menyimpan graph & menyajikan query. PR ini = paruh serve read-only di atas tag_audit_engine (#305), tak menyentuh scan/parser. Persist tag ke node graph (query SQL + join call-edge) = fase 2 backend → delegate worker. Dua tafsir "simpan" + alasan pilih MVP-compose ada di design doc.

Resolusi enclosing-symbol (3 idiom)

Anggota tampil sebagai nama fungsi, bukan lokasi telanjang:

  • docstring (def f(): lalu @FLOW di body) → def terdekat di atas
  • comment-above-def (// @FLOW lalu export function charge) → def dalam 3 baris bawah; baris kosong mengakhiri (memisahkan dari header file)
  • file-header (blok .d.ts di atas) → fallback ke file

Regex deklarasi lintas bahasa; miss → fallback file (tak perlu exhaustive).

Verifikasi (dijalankan)

Found, not fixed (Tier 2)

tests/test_docs_registry_sync.py mencocokkan nama sub-check sebagai substring, jadi nama seperti flow (sudah ada di "dataflow"/"workflow") lolos tanpa entri docs nyata. Word-boundary match akan menutupnya. flow tetap didokumentasikan benar di PR ini.

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

…closes #309)

`context --check flow --name X` collects every function carrying @flow: X into
one view, from the tags an agent already wrote — the scattered chain reads as a
single list. Bare `--check flow` lists all flows. Read-only, deterministic
(regex, no LLM); command count stays 12.

Architecture (per Wolfvin): not auto-detection — the agent authors the tag
(source of truth), CodeLens stores the graph and serves the query. This ships
the read-only compose over tag_audit_engine (MVP); persisting tags into graph
nodes at scan time is the phase-2 backend piece to delegate.

Members carry the enclosing symbol, resolved for three idioms: docstring tag
(nearest def above), comment-above-def (def within 3 lines below, blank line
ends the run), and file-header tag (falls back to the file). Language-agnostic
declaration regex; a miss falls back to the file so it need not be exhaustive.
tag_audit_engine flows[] gains `members`; `locations` retained for #305/#306
compat. ai gains `members`/`flows` as item sources.

Verified: PAYMENT flow collected across .py + .js; docstring/comment-above/
file-header idioms each resolve correctly (tests); markdown + ai render via the
#306 envelope; full suite 19 failures = 19 on main.

Found, not fixed (Tier 2): tests/test_docs_registry_sync.py matches sub-check
names as substrings, so a name like `flow` (already in "dataflow"/"workflow")
passes without a real doc entry. Word-boundary matching would close it. `flow`
is documented properly here regardless.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Wolfvin
Wolfvin merged commit ff23e45 into main Jul 17, 2026
1 of 7 checks passed
@Wolfvin
Wolfvin deleted the feat/issue-309-named-flow branch July 17, 2026 18:04
@sonarqubecloud

Copy link
Copy Markdown

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.

feat(context): named-flow view — collect a flow's scattered functions (context --check flow)

1 participant