Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .dependency-cruiser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const path = require("node:path");

/**
* Dependency-cruiser configuration for the Phase 0 SDK-boundary measurement.
* Keep TypeScript path aliases aligned with browser-extension/tsconfig.json.
*/
module.exports = {
forbidden: [],
options: {
doNotFollow: { path: "node_modules" },
baseDir: path.join(__dirname, "browser-extension"),
tsConfig: { fileName: path.join(__dirname, "browser-extension/tsconfig.json") },
webpackConfig: {
fileName: path.join(__dirname, "browser-extension/webpack/webpack.common.js"),
env: { TARGET_BROWSER: "chrome" },
},
},
};
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ browser-extension/public/wasm/
AGENTS.md
# The rest of /docs/ stays ignored (scratch research/audit notes).
/docs/*
# SDK separation artifacts must travel with the repository; other /docs/ files
# remain local scratch material.
!docs/security-invariants.md
!docs/sdk-migration/
!docs/sdk-migration/**

# integration-tests is a LOCAL-ONLY crate (v3 decode harness + onboarding docs +
# golden corpus + per-protocol e2e). No production logic — kept out of git by the
Expand Down
8 changes: 3 additions & 5 deletions browser-extension/default-bundles/day1-safety/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
{
"package": "day1-safety",
"title": "지갑 처음 켤 때 6",
"title": "지갑 처음 켤 때 5",
"title_en": "Day-1 Safety",
"version": "1.1.0",
"audience": "트레이딩/Web3 입문자 — 지갑을 처음 설치하고 첫 승인·송금·스왑을 하는 사람",
"description": "모든 지갑 사용자가 반드시 마주치는 3가지 순간(승인/서명, 송금, 스왑)에서 가장 흔하고 가장 치명적인 사고만 막는 최소 필수 6종. 6개 모두 외부 의존 없이 순수 Cedar로 즉시 동작한다.",
"description": "모든 지갑 사용자가 반드시 마주치는 3가지 순간(승인/서명, 송금, 스왑)에서 가장 흔하고 가장 치명적인 사고만 막는 최소 필수 5종. 5개 모두 외부 의존 없이 순수 Cedar로 즉시 동작한다.",
"source": {
"repo": "errkat4up/DAMBI",
"branch": "feat/cedar_manifest",
"commit": "a052a76b",
"origin_fixtures": "crates/policy-engine/tests/fixtures/default_policies_v2/phase1"
"path": "browser-extension/default-bundles/day1-safety"
},
"policies": [
{
Expand Down
58 changes: 58 additions & 0 deletions docs/sdk-migration/FINDINGS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Phase 0 findings

## F-001 — alias resolution needs the extension webpack aliases

`browser-extension/tsconfig.json` declares `@lib/*` and `@background/*`, but
the dependency graph is complete only when dependency-cruiser also consumes
`browser-extension/webpack/webpack.common.js`. With that configuration there
are no unresolved alias imports. The remaining unresolved edge is
`backend/wasm/policy_engine_wasm`, a generated build output imported by
`wasm-bridge.ts`; it is an expected generated-artifact boundary, not an alias
failure.

## F-002 — production build has an intentional registry gate

`yarn build:chrome` requires `REGISTRY_BASE_URL` and production signing
configuration. The baseline used the explicitly non-distributable local smoke
mode `DAMBI_ALLOW_INSECURE_REGISTRY=1`; no placeholder production value was
introduced. The normal baseline build also generated the WASM artifact.

## F-003 — current WASM exceeds the stated 1.5 MB gzip budget

The generated `policy_engine_wasm_bg.wasm` is 8,057,968 bytes raw and 2,495,488
bytes gzip. That is 995,488 bytes (about 66.4%) above a 1,500,000-byte gzip
budget. This is a measurement and an approval decision for Phase 3, not a
request to optimize or alter the engine in Phase 0.

## F-004 — two different security invariants use the label N2

The signature verifier's N2 pins the verification algorithm and public key.
The declarative engine's N2 warn-closes an empty multicall. They have distinct
scope and were documented separately in `docs/security-invariants.md` so a
mechanical move cannot accidentally conflate them.

## F-005 — pre-existing user worktree change preserved

`browser-extension/default-bundles/day1-safety/package.json` was already
modified before Phase 0. It was not changed, staged, or used as a migration
edit.

## F-006 — private policy-ir dependency includes executable code

The existing graph shows that `policy-store/render.ts:4-5` imports the runtime
functions `blocksToEst` and `fillParams`, in addition to its IR/store types.
`policy-store/resolve.ts:10` also imports executable `isEffectiveOn` and
`missingRequiredHoles` through the types barrel; their definitions are at
`sdk/policy-store-types.ts:169` and `:176`.

Moving only shared types into core does not remove core's runtime edge to the
planned private policy-ir package. The current IR graph has no reverse edge
to core/backend. Reversing type ownership without addressing these functions
would leave dependencies in both directions. Publishing policy-ir, inlining
it at build time (including declaration files), or changing the rendering
boundary requires an explicit decision. No such change has been implemented.

There is also an existing authoring-WASM dependency:
`policy-store/render.ts:6` calls `wasm-bridge.estToPolicyText`. The planned
runtime/authoring WASM split must account for this path; moving TypeScript
types alone does not isolate the runtime WASM artifact.
Loading
Loading