Skip to content

Archie architecture snapshot + per-folder CLAUDE.md testbed#4228

Open
gbrbks wants to merge 15 commits into
openmeterio:mainfrom
gbrbks:feature/archie_test
Open

Archie architecture snapshot + per-folder CLAUDE.md testbed#4228
gbrbks wants to merge 15 commits into
openmeterio:mainfrom
gbrbks:feature/archie_test

Conversation

@gbrbks
Copy link
Copy Markdown

@gbrbks gbrbks commented Apr 24, 2026

Summary

  • Commits a full Archie architecture baseline for the repo under .archie/ (blueprint, scan, skeletons, dependency graph, drift history, health data) plus CLAUDE.md / AGENTS.md / .claude/rules/* synthesized from it
  • Generates an Intent Layer: a per-folder CLAUDE.md (~505 files across openmeter/, api/, pkg/, cmd/, etc.) so agents editing deep in the tree get folder-local architectural guidance instead of only the root doc
  • Intended as a testbed — not expected to merge. Feel free to cherry-pick, poke at the generated docs, or close

How it was produced

  • /archie-deep-scan.archie/blueprint.json + rule files in .claude/rules/
  • /archie-intent-layer → bottom-up DAG traversal of 504 folders, spawned Sonnet subagents per folder, merged results into per-folder CLAUDE.md

Test plan

  • Browse a few per-folder docs (e.g. openmeter/billing/CLAUDE.md, openmeter/billing/charges/CLAUDE.md, api/v3/handlers/customers/CLAUDE.md) and judge whether the guidance would help an agent making edits in that folder
  • Diff CLAUDE.md / AGENTS.md at repo root against pre-Archie versions to see what the scan added
  • Check .archie/drift_report.json / .archie/findings.json for any surfaced architecture issues

Caveats

  • Large diff (~220k insertions). Most of it is generated content — only .archie/*.py tooling is gitignored; all outputs (JSON blueprints, enrichment files) are intentionally committed so the baseline travels with the branch
  • No behavior changes, no Go code touched, no CI-affecting files modified

🤖 Generated with Claude Code

@gbrbks gbrbks requested a review from a team as a code owner April 24, 2026 15:54
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 24, 2026

Important

Review skipped

Too many files!

This PR contains 289 files, which is 139 over the limit of 150.

To get a review, narrow the scope:
• coderabbit review --type committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 40d570ac-f157-4e3a-a2d7-4a386ef3c9e0

📥 Commits

Reviewing files that changed from the base of the PR and between 268c2bf and b29e0df.

⛔ Files ignored due to path filters (11)
  • .archie/viewer/dist/.archie-version is excluded by !**/dist/**
  • .archie/viewer/dist/archie-logo.svg is excluded by !**/dist/**, !**/*.svg
  • .archie/viewer/dist/assets/FolderClaudeMdsBrowser-By9bjg1I.js is excluded by !**/dist/**
  • .archie/viewer/dist/assets/GeneratedFilesBrowser-DE60sTmF.js is excluded by !**/dist/**
  • .archie/viewer/dist/assets/RuleControls-DtqkwMX1.js is excluded by !**/dist/**
  • .archie/viewer/dist/assets/TreeNav-DVv51mbZ.js is excluded by !**/dist/**
  • .archie/viewer/dist/assets/_baseUniq-DckcCb90.js is excluded by !**/dist/**
  • .archie/viewer/dist/assets/arc-BxzluYIb.js is excluded by !**/dist/**
  • .archie/viewer/dist/assets/architectureDiagram-Q4EWVU46-Bq5JHfxO.js is excluded by !**/dist/**
  • .archie/viewer/dist/assets/blockDiagram-DXYQGD6D-D51_UQZY.js is excluded by !**/dist/**
  • .archie/viewer/dist/assets/c4Diagram-AHTNJAMY-Bgyhm4za.js is excluded by !**/dist/**
📒 Files selected for processing (289)
  • .agents/skills/archie-deep-scan/SKILL.md
  • .agents/skills/archie-deep-scan/fragments/compact-resume-contract.md
  • .agents/skills/archie-deep-scan/fragments/resume-prelude.md
  • .agents/skills/archie-deep-scan/fragments/telemetry-conventions.md
  • .agents/skills/archie-deep-scan/steps/step-1-scanner.md
  • .agents/skills/archie-deep-scan/steps/step-10-telemetry.md
  • .agents/skills/archie-deep-scan/steps/step-2-read-scan.md
  • .agents/skills/archie-deep-scan/steps/step-3-wave1/grounding-rules.md
  • .agents/skills/archie-deep-scan/steps/step-3-wave1/orchestration.md
  • .agents/skills/archie-deep-scan/steps/step-3-wave1/patterns-agent.md
  • .agents/skills/archie-deep-scan/steps/step-3-wave1/structure-agent.md
  • .agents/skills/archie-deep-scan/steps/step-3-wave1/technology-agent.md
  • .agents/skills/archie-deep-scan/steps/step-3-wave1/ui-layer-agent.md
  • .agents/skills/archie-deep-scan/steps/step-4-merge.md
  • .agents/skills/archie-deep-scan/steps/step-5-wave2-reasoning.md
  • .agents/skills/archie-deep-scan/steps/step-6-rule-synthesis.md
  • .agents/skills/archie-deep-scan/steps/step-7-intent-layer.md
  • .agents/skills/archie-deep-scan/steps/step-8-cleanup.md
  • .agents/skills/archie-deep-scan/steps/step-9-drift.md
  • .agents/skills/archie-deep-scan/templates/scan-report.md
  • .archie/archie_config.json
  • .archie/blueprint.json
  • .archie/blueprint_raw.json
  • .archie/deep_scan_state.json
  • .archie/dependency_graph.json
  • .archie/drift_diff.json
  • .archie/drift_history/drift_20260424_101415.json
  • .archie/drift_history/drift_20260428_184214.json
  • .archie/drift_history/drift_20260504_100936.json
  • .archie/drift_history/drift_20260514_200041.json
  • .archie/drift_history/latest.json
  • .archie/drift_report.json
  • .archie/enrich_batches.json
  • .archie/enrich_state.json
  • .archie/enrichments/s0.json
  • .archie/enrichments/t0.json
  • .archie/enrichments/t1.json
  • .archie/enrichments/t2.json
  • .archie/enrichments/u0.json
  • .archie/enrichments/u1.json
  • .archie/enrichments/u2.json
  • .archie/enrichments/u3.json
  • .archie/enrichments/u4.json
  • .archie/enrichments/v0.json
  • .archie/enrichments/v1.json
  • .archie/enrichments/v2.json
  • .archie/enrichments/v3.json
  • .archie/enrichments/v4.json
  • .archie/enrichments/v5.json
  • .archie/enrichments/v6.json
  • .archie/enrichments/v7.json
  • .archie/enrichments/w0.json
  • .archie/enrichments/w1.json
  • .archie/enrichments/w10.json
  • .archie/enrichments/w100.json
  • .archie/enrichments/w101.json
  • .archie/enrichments/w102.json
  • .archie/enrichments/w103.json
  • .archie/enrichments/w104.json
  • .archie/enrichments/w105.json
  • .archie/enrichments/w106.json
  • .archie/enrichments/w107.json
  • .archie/enrichments/w108.json
  • .archie/enrichments/w109.json
  • .archie/enrichments/w11.json
  • .archie/enrichments/w110.json
  • .archie/enrichments/w111.json
  • .archie/enrichments/w112.json
  • .archie/enrichments/w113.json
  • .archie/enrichments/w114.json
  • .archie/enrichments/w115.json
  • .archie/enrichments/w116.json
  • .archie/enrichments/w117.json
  • .archie/enrichments/w118.json
  • .archie/enrichments/w119.json
  • .archie/enrichments/w12.json
  • .archie/enrichments/w120.json
  • .archie/enrichments/w121.json
  • .archie/enrichments/w122.json
  • .archie/enrichments/w123.json
  • .archie/enrichments/w124.json
  • .archie/enrichments/w125.json
  • .archie/enrichments/w126.json
  • .archie/enrichments/w127.json
  • .archie/enrichments/w128.json
  • .archie/enrichments/w129.json
  • .archie/enrichments/w13.json
  • .archie/enrichments/w130.json
  • .archie/enrichments/w131.json
  • .archie/enrichments/w132.json
  • .archie/enrichments/w133.json
  • .archie/enrichments/w134.json
  • .archie/enrichments/w135.json
  • .archie/enrichments/w136.json
  • .archie/enrichments/w137.json
  • .archie/enrichments/w138.json
  • .archie/enrichments/w139.json
  • .archie/enrichments/w14.json
  • .archie/enrichments/w140.json
  • .archie/enrichments/w141.json
  • .archie/enrichments/w142.json
  • .archie/enrichments/w143.json
  • .archie/enrichments/w144.json
  • .archie/enrichments/w145.json
  • .archie/enrichments/w146.json
  • .archie/enrichments/w147.json
  • .archie/enrichments/w148.json
  • .archie/enrichments/w149.json
  • .archie/enrichments/w15.json
  • .archie/enrichments/w150.json
  • .archie/enrichments/w151.json
  • .archie/enrichments/w152.json
  • .archie/enrichments/w153.json
  • .archie/enrichments/w154.json
  • .archie/enrichments/w155.json
  • .archie/enrichments/w16.json
  • .archie/enrichments/w17.json
  • .archie/enrichments/w18.json
  • .archie/enrichments/w19.json
  • .archie/enrichments/w2.json
  • .archie/enrichments/w20.json
  • .archie/enrichments/w21.json
  • .archie/enrichments/w22.json
  • .archie/enrichments/w23.json
  • .archie/enrichments/w24.json
  • .archie/enrichments/w25.json
  • .archie/enrichments/w26.json
  • .archie/enrichments/w27.json
  • .archie/enrichments/w28.json
  • .archie/enrichments/w29.json
  • .archie/enrichments/w3.json
  • .archie/enrichments/w30.json
  • .archie/enrichments/w31.json
  • .archie/enrichments/w32.json
  • .archie/enrichments/w33.json
  • .archie/enrichments/w34.json
  • .archie/enrichments/w35.json
  • .archie/enrichments/w36.json
  • .archie/enrichments/w37.json
  • .archie/enrichments/w38.json
  • .archie/enrichments/w39.json
  • .archie/enrichments/w4.json
  • .archie/enrichments/w40.json
  • .archie/enrichments/w41.json
  • .archie/enrichments/w42.json
  • .archie/enrichments/w43.json
  • .archie/enrichments/w44.json
  • .archie/enrichments/w45.json
  • .archie/enrichments/w46.json
  • .archie/enrichments/w47.json
  • .archie/enrichments/w48.json
  • .archie/enrichments/w49.json
  • .archie/enrichments/w5.json
  • .archie/enrichments/w50.json
  • .archie/enrichments/w51.json
  • .archie/enrichments/w52.json
  • .archie/enrichments/w53.json
  • .archie/enrichments/w54.json
  • .archie/enrichments/w55.json
  • .archie/enrichments/w56.json
  • .archie/enrichments/w57.json
  • .archie/enrichments/w58.json
  • .archie/enrichments/w59.json
  • .archie/enrichments/w6.json
  • .archie/enrichments/w60.json
  • .archie/enrichments/w61.json
  • .archie/enrichments/w62.json
  • .archie/enrichments/w63.json
  • .archie/enrichments/w64.json
  • .archie/enrichments/w65.json
  • .archie/enrichments/w66.json
  • .archie/enrichments/w67.json
  • .archie/enrichments/w68.json
  • .archie/enrichments/w69.json
  • .archie/enrichments/w7.json
  • .archie/enrichments/w70.json
  • .archie/enrichments/w71.json
  • .archie/enrichments/w72.json
  • .archie/enrichments/w73.json
  • .archie/enrichments/w74.json
  • .archie/enrichments/w75.json
  • .archie/enrichments/w76.json
  • .archie/enrichments/w77.json
  • .archie/enrichments/w78.json
  • .archie/enrichments/w79.json
  • .archie/enrichments/w8.json
  • .archie/enrichments/w80.json
  • .archie/enrichments/w81.json
  • .archie/enrichments/w82.json
  • .archie/enrichments/w83.json
  • .archie/enrichments/w84.json
  • .archie/enrichments/w85.json
  • .archie/enrichments/w86.json
  • .archie/enrichments/w87.json
  • .archie/enrichments/w88.json
  • .archie/enrichments/w89.json
  • .archie/enrichments/w9.json
  • .archie/enrichments/w90.json
  • .archie/enrichments/w91.json
  • .archie/enrichments/w92.json
  • .archie/enrichments/w93.json
  • .archie/enrichments/w94.json
  • .archie/enrichments/w95.json
  • .archie/enrichments/w96.json
  • .archie/enrichments/w97.json
  • .archie/enrichments/w98.json
  • .archie/enrichments/w99.json
  • .archie/enrichments/x0.json
  • .archie/enrichments/x1.json
  • .archie/enrichments/x10.json
  • .archie/enrichments/x11.json
  • .archie/enrichments/x12.json
  • .archie/enrichments/x13.json
  • .archie/enrichments/x14.json
  • .archie/enrichments/x15.json
  • .archie/enrichments/x2.json
  • .archie/enrichments/x3.json
  • .archie/enrichments/x4.json
  • .archie/enrichments/x5.json
  • .archie/enrichments/x6.json
  • .archie/enrichments/x7.json
  • .archie/enrichments/x8.json
  • .archie/enrichments/x9.json
  • .archie/enrichments/y16.json
  • .archie/enrichments/y17.json
  • .archie/enrichments/y18.json
  • .archie/enrichments/y19.json
  • .archie/enrichments/y20.json
  • .archie/enrichments/y21.json
  • .archie/enrichments/y22.json
  • .archie/enrichments/y23.json
  • .archie/enrichments/y24.json
  • .archie/enrichments/y25.json
  • .archie/enrichments/y26.json
  • .archie/enrichments/y27.json
  • .archie/enrichments/y28.json
  • .archie/enrichments/y29.json
  • .archie/enrichments/y30.json
  • .archie/enrichments/y31.json
  • .archie/enrichments/y32.json
  • .archie/enrichments/y33.json
  • .archie/enrichments/y34.json
  • .archie/enrichments/y35.json
  • .archie/enrichments/y36.json
  • .archie/enrichments/y37.json
  • .archie/enrichments/y38.json
  • .archie/enrichments/y39.json
  • .archie/enrichments/y40.json
  • .archie/enrichments/y41.json
  • .archie/enrichments/y42.json
  • .archie/enrichments/y43.json
  • .archie/enrichments/z0.json
  • .archie/enrichments/z1.json
  • .archie/enrichments/z10.json
  • .archie/enrichments/z11.json
  • .archie/enrichments/z12.json
  • .archie/enrichments/z13.json
  • .archie/enrichments/z14.json
  • .archie/enrichments/z15.json
  • .archie/enrichments/z16.json
  • .archie/enrichments/z17.json
  • .archie/enrichments/z18.json
  • .archie/enrichments/z19.json
  • .archie/enrichments/z2.json
  • .archie/enrichments/z20.json
  • .archie/enrichments/z21.json
  • .archie/enrichments/z22.json
  • .archie/enrichments/z3.json
  • .archie/enrichments/z4.json
  • .archie/enrichments/z5.json
  • .archie/enrichments/z6.json
  • .archie/enrichments/z7.json
  • .archie/enrichments/z8.json
  • .archie/enrichments/z9.json
  • .archie/findings.json
  • .archie/health.json
  • .archie/health_history.json
  • .archie/last_deep_scan.json
  • .archie/maintainer_guardrails.json
  • .archie/rule_index.json
  • .archie/rules.json
  • .archie/scan.json
  • .archie/scan_report.md
  • .archie/skeletons.json
  • .archie/telemetry/deep-scan_2026-04-24T102519Z.json
  • .archie/telemetry/deep-scan_2026-04-28T185322Z.json
  • .archie/telemetry/deep-scan_2026-05-04T102221Z.json
  • .archie/telemetry/deep-scan_2026-05-14T201543Z.json
  • .archie/verdicts.json

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

gbrbks and others added 12 commits April 24, 2026 21:00
…e.json

Older Archie (pre-2.4.4) was persisting the absolute project path into
.archie/deep_scan_state.json under run_context.project_root, which leaked
"/Users/hamutarto/DEV/gbr/openmeter" into the committed state file.

Archie 2.4.4 stopped writing this field (BitRaptors/Archie#55). The
existing leaked value is removed here so the committable state stays
machine-agnostic and portable across dev laptops / CI runners.

No other paths leaked — verified with grep for /Users/, /home/, /root/,
/var/folders/, and "gbr" across .archie/, CLAUDE.md, AGENTS.md, .claude/.
Every remaining "/" string comes from actual gitignore content or doc
examples, not from environment-specific paths.
… rename

- Replace time.Now() with clock.Now() in adapter/manage.go DeleteMeter
- Make OrderBy switch in adapter/meter.go return a typed validation error
  for unknown values instead of silently falling back to createdAt
- Rename package declaration in all httphandler/*.go files from
  httpdriver to httphandler so directory name matches package name

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ngRepo

ListMeters and GetMeterByIDOrSlug now rebind to any ctx-carried Ent
transaction, matching the pattern used by all mutating adapter methods.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…Meter]

Replace the ad-hoc []PreUpdateMeterHook slice in ManageService with the
canonical models.ServiceHookRegistry[Meter] pattern used by customer,
subscription, and entitlement. The new RegisterHooks method aligns
ManageService with the ServiceHooks interface.

Pre-update hook now receives *Meter (the current entity) rather than
UpdateMeterInput, matching the ServiceHook[T].PreUpdate signature.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…+1s hack

Use clock.Now() in both ListEventsParams.Validate() and the default From
floor in the v1 ListEvents handler so tests can freeze time. Remove the
+1s workaround that compensated for the two separate time.Now() calls
drifting apart — clock.Now() is the same instant across both call sites.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment on lines +77 to +79
if (token === ENTERPRISE_TOKEN) {
return fetchEnterpriseReport()
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A timing attack might allow hackers to bruteforce passwords - high severity
An insecure way to compare passwords to user input might allow hackers to bruteforce passwords.

Show fix

Remediation: Use crypto.timingSafeEqual, a timing-safe string comparison function built into NodeJS

Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9 Open source vulnerabilities detected - high severity
Aikido detected 9 vulnerabilities across 3 packages, it includes 1 high and 8 medium vulnerabilities.

Details

Remediation Aikido suggests bumping the vulnerable packages to a safe version.

Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

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