Skip to content

agent: remove the unused finding traffic guidance constant - #455

Merged
BaaRai merged 1 commit into
BaaRai:mainfrom
NikolayGusev-astra:fix/remove-dead-traffic-guidance
Nov 22, 2026
Merged

BaaRai merged 1 commit into
BaaRai:mainfrom
NikolayGusev-astra:fix/remove-dead-traffic-guidance

Conversation

@NikolayGusev-astra

Copy link
Copy Markdown

Problem

findingTrafficGuidance in agent/finding_recorder.go is an unreferenced constant: grep -rn findingTrafficGuidance --include='*.go' . returns only its own declaration. Its comment says the text is appended to the prompt, but the text an agent actually receives is assembled in findingWorkflowTools — a different, longer contract that has since moved on (capture-off notes, per-tool notes). Two texts describing the same thing, one of them dead, is exactly the place where the next reader edits the wrong one.

Found while running ARTEX against a live target: the guidance area is where the agent looks for the binding contract, and this constant no longer takes part in it.

Changes

Remove the unused constant and its comment. No prompt assembly and no runtime behaviour change.

Add a source-level regression test: restoring an unused declaration cannot change prompt output, so the test parses finding_recorder.go and fails when the name comes back. Without it the constant can silently reappear (a merge of the old file, a revert) and nobody notices.

Verification

  • red: temporarily restored the declaration → TestFindingRecorderHasNoLegacyTrafficGuidance fails naming the constant; green after restoring the fix.
  • go test ./agent/ -count=1 with ARTEX_PG_DSN pointed at a local PostgreSQL.
  • gofmt -l agent/ server/ and git diff --check clean.

Alternative considered

Keeping the constant and wiring it into the prompt instead. It overlaps with the per-tool notes added in #448 and with the binding-off notes in #453 (same file family, no conflict), so removal keeps one text per contract. Happy to wire it in instead if you prefer that direction.


Noticed while running the platform on a live target; both PRs come from the same run.

@BaaRai
BaaRai merged commit 09eb73c into BaaRai:main Nov 22, 2026
6 checks passed
@BaaRai

BaaRai commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Thanks @NikolayGusev-astra, merged. The dead constant is gone and the AST regression test keeps it from coming back.

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.

2 participants