Skip to content

fix(export): include renamed PoC base contract in output export allowlist - #17

Merged
jungjipdo merged 2 commits into
mainfrom
fix/export-poc-base-artifact
Jul 10, 2026
Merged

jungjipdo merged 2 commits into
mainfrom
fix/export-poc-base-artifact

Conversation

@jungjipdo

Copy link
Copy Markdown
Member

What

The read-only output export allowlist was missing the PoC base contract file, so exported PoC bundles were not self-contained and failed forge build when rebuilt standalone.

Why

The engine renamed the PoC base contract file LumosPoCBase.sol → Base.sol. The generated PoC.t.sol now does:

import "./Base.sol";
contract AttackTest is Base { ... }

and the engine writes Base.sol on disk (deleting the legacy LumosPoCBase.sol).

The output export artifact allowlist (internal/artifacts/reader.go) was never updated for that rename — it still enumerated only LumosPoCBase.sol. Effect on every exported bundle:

  • allowlisted LumosPoCBase.sol → reported as missing (engine no longer writes it)
  • on-disk Base.sol → never exported (not allowlisted)

So the base contract the PoC imports is silently dropped, and rebuilding the exported project fails:

Error (6275): Source "test/Base.sol" not found
  --> test/PoC.t.sol:5:1:  import "./Base.sol";

Change

internal/artifacts/reader.go — add Base.sol next to each LumosPoCBase.sol entry, in both the default and export profiles, at both PoC locations:

  • report_bundle/poc/Base.sol
  • artifacts/agent_poc/foundry/test/Base.sol

Legacy LumosPoCBase.sol entries are kept → the change is purely additive and non-regressive: old cases that still carry the legacy file keep exporting it, new cases now export Base.sol, and absent files are still reported as missing (never an error).

Safety / blast radius

  • No core logic touched. This is the read-only output-artifact allowlist only — the state machine, worker, bin/lumoskit dispatch, DB, and concurrency control are untouched.
  • The export read path holds no locks shared with the worker and issues a single indexed single-row DB read, so it cannot preempt engine processing.
  • Regression test added (TestECWReaderServesRenamedPoCBaseContract) asserting the export profile exposes Base.sol at both locations with the expected content.

Verification

  • gofmt -l / go vet clean
  • go build ./... OK
  • go test ./internal/artifacts/... ./internal/api/... pass (incl. new test)
  • Full suite: all relevant packages pass. The single unrelated failure (internal/lumoskit repo-root test) is a pre-existing macOS /var→/private/var symlink path artifact, identical to origin/main and not touched here.

🤖 Generated with Claude Code

jungjipdo and others added 2 commits July 10, 2026 01:29
…list

The engine renamed the PoC base contract file from LumosPoCBase.sol to
Base.sol: the generated PoC.t.sol now does `import "./Base.sol"` /
`contract AttackTest is Base`, and the engine writes Base.sol on disk
(deleting the legacy LumosPoCBase.sol). The output export artifact
allowlist was never updated for that rename and still enumerated only
LumosPoCBase.sol.

Effect on every exported bundle: the allowlisted LumosPoCBase.sol is
reported as missing (engine no longer writes it) while the on-disk
Base.sol is never exported (not allowlisted). The base contract the PoC
imports is silently dropped, so an exported PoC project fails to compile
standalone: Source "test/Base.sol" not found.

Add Base.sol next to each LumosPoCBase.sol entry in both the default and
export artifact profiles, at both PoC locations (report_bundle/poc/ and the
agent_poc foundry test dir). Purely additive: legacy LumosPoCBase.sol
entries are kept for backward compatibility, absent files are still
reported as missing rather than erroring, and no orchestration/state/DB
logic changes — this only widens the read-only export allowlist.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jungjipdo
jungjipdo merged commit 753edde into main Jul 10, 2026
1 check passed
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