Skip to content

refactor(loader): remove dead module cache-buster#350

Merged
rhuanbarreto merged 5 commits into
mainfrom
refactor/remove-dead-cache-buster
May 25, 2026
Merged

refactor(loader): remove dead module cache-buster#350
rhuanbarreto merged 5 commits into
mainfrom
refactor/remove-dead-cache-buster

Conversation

@rhuanbarreto

Copy link
Copy Markdown
Contributor

Summary

  • Remove the ?t=${Date.now()} cache-buster from rule file imports in src/engine/loader.ts — it was introduced for the MCP server (long-lived process) but became dead code after PR refactor: remove MCP server, port to CLI commands #50 removed the MCP server and ported to CLI commands
  • Each archgate check is a fresh Bun process with no module cache to bust
  • Keep pathToFileURL() which is still needed for Windows backslash path handling
  • Add baseBranch to .archgate/config.json

Closes #345 — the broader caching optimization is not warranted (~850ms total, ~188ms rule execution).

Test plan

  • bun run validate passes (1202 tests, 27/27 ADR rules, lint, typecheck, knip, build)
  • archgate check --verbose confirms rules still load and execute correctly

The `?t=${Date.now()}` query string was introduced when archgate ran as
a long-lived MCP server process where `loadRuleAdrs()` could be called
multiple times. PR #50 removed the MCP server and ported everything to
CLI commands, but left the cache-buster in place with an updated
comment. Each `archgate check` is now a fresh Bun process — there is no
module cache to bust.

Closes #345 — the broader caching optimization proposed there is not
warranted given current performance (~850ms total, ~188ms rule
execution).

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 25, 2026

Copy link
Copy Markdown

Deploying archgate-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7f8f707
Status: ✅  Deploy successful!
Preview URL: https://0ea76ec8.archgate-cli.pages.dev
Branch Preview URL: https://refactor-remove-dead-cache-b.archgate-cli.pages.dev

View logs

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
@github-actions

github-actions Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

Code Coverage

Metric Value
Lines 90.0% (6524 / 7246)
Threshold 90% minimum — met
Platforms Linux + Windows

Full HTML report available in workflow artifacts.

Per-directory breakdown
Directory Coverage Lines
src/commands/ 88.1% 2069 / 2348
src/engine/ 93.1% 1207 / 1297
src/formats/ 100.0% 141 / 141
src/helpers/ 89.8% 3107 / 3460

- Update ARCH-007 context and consequences to remove outdated
  "MCP server" framing — the decision (Bun.spawn over Bun.$) is still
  valid but the rationale cited a deployment mode removed in PR #50
- Remove MCP regression tests from init-project, copilot-settings, and
  cursor-settings — testing what a function should NOT produce is
  unnecessary noise eight months after the removal

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Remove test assertions that only existed to guard against re-introduction
of features that were removed long ago:

- `--prefix` option on `adr import` (replaced by domain-aware remapping)
- `defineRules` reference in rules template (removed when satisfies
  RuleSet replaced it)
- `.cursor/rules/archgate-governance.mdc` (removed when Cursor plugin
  moved to VSIX)
- `.cursor/mcp.json` in init-project (MCP server removed in PR #50)

These add noise without value — the removed code paths don't exist,
TypeScript wouldn't compile references to them, and broader assertions
already cover the expected behavior.

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
@rhuanbarreto rhuanbarreto merged commit 09d608d into main May 25, 2026
11 checks passed
@rhuanbarreto rhuanbarreto deleted the refactor/remove-dead-cache-buster branch May 25, 2026 19:54
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.

perf: pre-transpile .rules.ts files to avoid per-run dynamic import overhead

1 participant