Packages architecture stabilization (P1–P6)
Context: the early code in packages/ was written by AI coding agents on purpose without instructions, rules or architecture guidance, as an experiment in how agents behave on their own. This program fixes the resulting mistakes, such as the oversized application barrel with unrelated responsibilities and the import cycles. It is also the second half of that experiment: the same kind of work, done by agents under the current rules, Design First, and file and function budgets. See the project stage section in the README.
Status: P1A audit merged (PR #557, ded6e0a7031d31f3181e22d0495418552aa60745). P1B extracts the six conformance summary operations into packages/application/src/project-conformance-summaries.ts and is merged (PR #558, 5dac7f0556498949eb2ab33fae6e89e3cbdcfb68). P1C extracts the host filesystem port and adapters into packages/application/src/host-file-system.ts and is merged (PR #559, 762f979890f90a8064de756cd038195bb49646ef). P1D extracts secretLikePath, inside, and projectRelativePaths into packages/application/src/project-path.ts and is merged (PR #560, 7713318aa0390cad0ecb2e0313422ba0f66ae6bb). P1 is not complete. P1E.1 retargets Engineering Quality filesystem-port imports onto host-file-system.ts and is merged (PR #561, d64eebadf099019c26cb806a3f814de8ace1d7c5). P1E.2 measured the Foundation family and found no filesystem-port imports through the application root. That result is merged as PR #574 (7596ebd156661d245eb3c7d84375ba828de10bab). P1E.3 measured the inception family and found no filesystem-port imports through the application root, so no inception PR was opened. P1E.4 retargets existing-project Adoption filesystem-port imports onto host-file-system.ts and is merged (PR #575, 55f1ea362a359424e603764d9ec969535747851a). P1E.5 measured the extension family and found no filesystem-port imports through the application root, so no extension PR was opened. P1E.6 retargets the one Harness filesystem-port import onto host-file-system.ts and is merged (PR #576, 0d4159b9623e65a5236ce8a9c7c225331765df83). P1E.7 retargets Feature Intent filesystem-port imports onto host-file-system.ts and is merged (PR #577, 5db19ba962882ca2bd1bd0b36195564d9d3d13c0). P1E.8 retargets Bounded Execution filesystem-port imports onto host-file-system.ts and is merged (PR #578, 3700abeadca7dc3274a4529058a7dc6c560b0cc2). P1E.9 retargets Continuous Loop filesystem-port imports onto host-file-system.ts and is merged (PR #579, 6742cd3be1c61d79301b8a13cb3dec13ef044064). P1E is complete. P1F.1 moves the Feature Intent family into packages/application/src/feature-intent/ and is merged (PR #580, 2451dc01faac9c12ece874c13bf3fe1918e86f9f). P1F.2 moves the Harness family into packages/application/src/harness/ and is merged (PR #581, e44f24fe282a186d662ee8b71cfa16cecd37bc05). P1F.3 moves Extension Inspection modules into packages/application/src/extension-inspection/ and is merged (PR #582, 14e86cd85292ba7e0fa4854824cdade14835d2e4). P1F.4 found the Engineering Assessment directory already in place, so no PR was opened. P1F.5 moves the Bounded Execution read side into packages/application/src/bounded-execution/ and is merged (PR #583, e14a5b67bf342e06ae83a55010acf76327e8a0f3). P1F.6 moves the Continuous Loop read side into packages/application/src/continuous-loop/ and is merged (PR #584, 6d94862b58046a5126048fc8dea1ffd60e882fb9). P1F.7 moves Foundation modules that sit outside the two Foundation cycles into packages/application/src/foundation/ and is merged (PR #585, aff1dd52cd66f437e5a20b5b08a658af83b0e9a2). P1F.8 moves Inception modules that sit outside the viewmodel cycle into packages/application/src/inception/ and is merged (PR #586, d647c6ec25b21e758fa83ae04d6a31b75bc94ecb). P1G.1 moves InceptionSummary into packages/application/src/inception/inception-summary-types.ts so inception-viewmodel.ts no longer imports inception.ts. That slice is merged as PR #587 (a6234a4d20c208a34be301b468f2d3774640b1a9). P1G.2 moves FoundationScaffoldFileRow into packages/application/src/foundation/foundation-scaffold-file-row-types.ts so the workspace viewmodel no longer imports the client viewmodel. That slice is merged as PR #588 (6bbfb988ee6f4f4b686d60e7ffd3a26ecc2b3103). P1G.3 design is merged as PR #591 (454cd7736abe37fe1f2e39c472f8e6a7e0d3d0e3). The implementation moves FoundationUnderstanding and getFoundationWorkshop onto leaf modules and is merged as PR #596 (488067af1d39a614e718660944c7f3ae030b1be7). P1H.1 design is merged as PR #597 (eeda24d7bfba504d5ea6c7a781a6a054117a8a15). The approved contract is docs/designs/p1h1-persistent-memory/SYSTEM_DESIGN.md. Implementation is merged as PR #598 (5f7917c1cef0997f6947932aa2f8f4186ac2decc). P1H.2 design is merged as PR #599 (ff7cb79329f403220aa4b369eede4cb8f06e591b). The approved contract is docs/designs/p1h2-agent-session/SYSTEM_DESIGN.md. Implementation is merged as PR #600 (efce5db2b40d1f350df43d38b4b97d1ccd5c2736). P1H.3 design is merged as PR #601 (6b387a34c221f967a15ef670d53bea9b76e40828). The approved contract is docs/designs/p1h3-skill-catalog-proposals/SYSTEM_DESIGN.md. P1H.3a catalog read is merged as PR #602 (460b81efd1e81f5b24a22e11d3af4680c8f28aad). P1H.3b proposal store and evaluation is merged as PR #603 (f116d199a0783870806e8c8660d90385c106f8e1). P1H.3c skill mutation and procedural memory is merged as PR #604 (911b229af00fcde54d8861af83a56e7e61df0902). P1H.3 is fully implemented. P1H.4 design is merged as PR #605 (6a9d0d26015caa857c19d0d22415904d832ad818). P1H.4a finding store and coverage is merged as PR #606 (ec951f32246ad0c94a145f520dc1862d9592c72e). P1H.4b SARIF import is merged as PR #607 (7a77db52753360f0029cd266d8c95eb78c34995c). P1H.4 is fully implemented. P1H.5 design is merged as PR #608 (1d0611070b02c5e9f0f0e2816a0f560fbf18c18e). P1H.5a policy, baseline, and comparison is merged as PR #609 (7589c6ccff5d79d1f8c6e5de34d2f521ea3caa6e). P1H.5b sandbox policy and evaluation is merged as PR #610 (2c0749dce9a31976195277971d6fb35fe663cd31). P1H.5 is fully implemented. P1H.6 design is merged as PR #611 (https://github.com/vitala89/Intentloom/pull/611, 52b34c8b202cb07ab30c4f3e991dbce3815510a4). P1H.6 implementation is merged as PR #612 (https://github.com/vitala89/Intentloom/pull/612, b80614d5d65fbdbd9cbc4831a6593ead6b155280). P1H.6 is fully implemented. P1H.7 design is merged as PR #613 (017cb370cf4329a96d723cd83721acbb175f1827). P1H.7 implementation is merged as PR #614 (https://github.com/vitala89/Intentloom/pull/614, e07fddccbc771e415bc1d9056051edb9e00b4d58). P1H is complete. P1I.1 design is merged as PR #615 (8bc9e07c74beb701adaae9e30dacb6aec252b58f). Implementation is merged as PR #616 (https://github.com/vitala89/Intentloom/pull/616, b9201e9d480b34e453d08e1803f94e734d1e3f1f). P1I.1 is complete. P1I.2 design is merged as PR #617 (e3585e8eb5f4b58bb42482e249430654375dee5b). Implementation is merged as PR #618 (https://github.com/vitala89/Intentloom/pull/618, 1d8d55cbfd89792272d4d4c00512aa09465ed23d). P1I.2 is complete. P1I.3 design is merged as PR #620 (e93f6b9efdba11d1dd1cd98ed7072a801595320b). Implementation A, the adoption extraction, is merged as PR #621 (https://github.com/vitala89/Intentloom/pull/621, 527ab7f14fc199bc77d21c7e823b4cc2d5c3d926). Implementation B, the Approved Apply type-import retarget, is merged as PR #622 (https://github.com/vitala89/Intentloom/pull/622, d6b7d4955f2e58780c1ea2afe134f3217ad3fe86). P1I.3 is complete. Measured import-only cycles are the Neutron mutation trio only. Measured re-export cycles are sizes 4, 27, and 3. P1J design PR #623 is merged (https://github.com/vitala89/Intentloom/pull/623, 8a44e342f4001bbdc7d7196f66200269af0689b7). The design document keeps its design-stage proposal wording. The approved implementation decision is Option C. index.ts measures 1,804 effective lines and 1,953 physical lines, down from 1,878 and 2,034. The leaf workspace/legacy-subagent-task-record.ts measures 92 effective lines and 100 physical lines and is outside every SCC. No runtime behavior changed. The implementation is merged as PR #626 (https://github.com/vitala89/Intentloom/pull/626, 5efc30a0ae21525312425e69ef82ccd30e138c8a). Symlink following and caller-supplied task-id traversal inside the project root remain unresolved. P1 is not complete. The remaining-barrel completion design is docs/designs/p1k-remaining-application-barrel/SYSTEM_DESIGN.md, merged as PR #627 (https://github.com/vitala89/Intentloom/pull/627, 1abb80e1e5c7fdcb3a16c14b2897a6a6549446c9). P1K.1 moves createProfile, getProfile, and listProfiles to packages/application/src/memory/profile-store.ts. That implementation is open as PR #628 (https://github.com/vitala89/Intentloom/pull/628), pending review and not merged. Measured with measureProductionSource, index.ts is 1,751 effective lines and 1,896 physical lines, down from 1,804 and 1,953. The leaf is 66 effective lines and 72 physical lines and is outside every SCC. The moved functions stay at 17, 14, and 27 effective lines. Measured import-only SCC membership is [3]. Measured re-export SCC membership is [4, 27, 3], with the same members. P1K.1 is merged (PR #628, e808234d2f51d3664871f9ab294e6e7ec6c05fc8). P1K.2 is merged (PR #629, b4d0ed69690408764988ca57cf4845f373410c4c). P1K.3 is merged (PR #630, 952555df6daa2affaf17e61151e8a0fe21c3cc60). P1K.4 is merged (PR #634, 65bba16250c3c98b851254c007c2b238394a6b7f). After P1K.4, index.ts measures 1,388 effective and 1,483 physical lines; the checkpoint leaf is 188 effective and 212 physical lines. P1K.5 is merged (PR #635, eacf825947545d0ebadc60b1f8fb09e5ba82413e). After P1K.5, index.ts measures 1,279 effective and 1,365 physical lines; the semantic-ranking leaf is 153 effective and 163 physical lines. P1K.6 bounded project context extraction is merged (PR #636, dbea5baf79af002a203e62ba9609c8a67c87662c). P1K.7 Design First is merged (PR #637, 4a4c5046e238119d60bf905f3db5c79b146c6a99). P1K.7 security adapter execution is merged (PR #638, 4a949b0fdecf57e785ed437ace6576918a38eee6). After P1K.7, index.ts measures 965 effective and 1,023 physical lines; six security-adapter leaves measure 29–122 effective lines. P1K.8 workspace conversation extraction is merged (PR #639, d8c5f2c5c4c06e86bf6f04d4014bcf6e68f066db). After P1K.8, index.ts measures 857 effective and 903 physical lines; the conversation leaf measures 129 effective and 142 physical lines. Import-only SCC membership remains [3]. Re-export SCC membership remains [4, 27, 3] with the same members. P1K.9 workspace proposal lifecycle extraction is merged (PR #643, 800716340e22a92240ab5d769f5e347f0363c1e4). Design First is merged as PR #640; section 24.10 owner matrix sign-off was not recorded at merge (process exception). After P1K.9, measured index.ts is 793 effective and 831 physical lines; workspace-proposal-lifecycle.ts is 122 effective and 134 physical lines. Import-only SCC membership remains [3]; re-export SCC membership remains [4, 27, 3]. P1K.10 Design First (section 25) is merged (PR #644, 26dfe51e56f8b37972dd167e71c6fa55e4920f85). Section 25.17 was accepted on 2026-11-28 13:20 Europe/Berlin after that merge. P1K.10 implementation is merged (PR #646, fecace86f4baf4a532d4cdd358f2cfc1e4c74cf3). It extracts project root and timeline. Measured index.ts is 742 effective and 777 physical lines; project-root.ts is 64 effective and 69 physical lines. At 2026-11-28 15:14 Europe/Berlin the Project Owner authorized that implementation under section 25.17. The statement is later than the merge and is not backdated. P1K.10 test-quality closure is merged (PR #648, 39ee6e847c3c0053710f9726519b1769b458bd80). P1K.11 design is merged (PR #649, c72168aacb806acca05270d4720d45d7586a1b4e). Section 26.17 was accepted at 2026-11-29 13:31:01 Europe/Berlin. Main verification of that SHA succeeded. Implementation was authorized separately at 2026-11-29 13:46 Europe/Berlin. It extracts planFeature into feature-intent/plan-feature.ts. Measured index.ts is 675 effective and 710 physical lines; the leaf is 68 effective and 69 physical lines. SCC membership remains [3] import-only and [4, 27, 3] re-export inclusive. P1K.11 implementation is merged (PR #650, 23f5176f31586518cb4d0825bdb7b3dbae682729). Main verification succeeded: Documentation 46288457468, CodeQL 46288457443, Compatibility 46288457515. P1K.12 Pack Update Planning design is merged (PR #651, a787faf0524414b63a4e65ad0335bb07bd65aa3d, 2026-12-02 23:20:06 Europe/Berlin). The Project Owner accepted section 27.17 after that merge. The Compatibility workflow changes in PR #651 are an accepted scope deviation. Main verification of a787faf succeeded and made the conditional implementation authorization effective. The extraction merged as PR #655 (89fbcd7c7656be0d6a37b06f1b70b575f19b2749, 2026-12-03 22:02 Europe/Berlin). Stage A is a677ac769776a379cd003ef5e08a2cc51c194ba8. The production move is da8e74927a53ce1f4bf388d3e34ee4030aa10c78. Measured index.ts is 629 effective and 659 physical lines; plan-pack-update.ts is 52 effective and 57 physical lines. planPackUpdate is 38 effective and 41 physical lines. SCC membership remains [3] import-only and [4, 27, 3] re-export inclusive, with the same members as section 8.1. The leaf stays outside both. Compatibility on 89fbcd7 did not fully pass: five jobs passed, including pnpm test, and macos-latest / Node 24 was cancelled with runner id 0 and no steps. That job is not counted as a pass. PR #657 (3d641e4) is documentation only, and main at that time passed Documentation, CodeQL, and all six Compatibility jobs. The P1K.13 design merged as PR #658 (7911573), and Compatibility, CodeQL, and Documentation passed on it. The Project Owner accepted rows 1 through 10 of section 28.18 at 2026-12-04 22:11 Europe/Berlin. Row 11 is still pending, and the design is not implementation authorization. P1K.14 through P1K.17 have not started. Section 14 is unchanged. Undo U4 and Desktop Undo U5 have not started. Neutron's R4A topology stays frozen. The measurements below remain the P1A baseline and are not restated as the post-extraction size.
This is the canonical plan for the packages stabilization program. It records evidence from main at f0b19c885d2aa95b041a4582e5218d2f3539f525. It does not add governance rules. P1B is merged. P1C is merged (PR #559, 762f979890f90a8064de756cd038195bb49646ef). P1D is merged (PR #560, 7713318aa0390cad0ecb2e0313422ba0f66ae6bb). P1E.1 is merged (PR #561, d64eebadf099019c26cb806a3f814de8ace1d7c5). P1E.2 records a measured zero baseline for Foundation filesystem-port imports and does not move source. That baseline is merged as PR #574 (7596ebd156661d245eb3c7d84375ba828de10bab). P1E.3 records a measured zero baseline for inception filesystem-port imports and does not move source. P1E.4 retargets existing-project Adoption filesystem-port imports and is merged (PR #575, 55f1ea362a359424e603764d9ec969535747851a). P1E.5 records a measured zero baseline for extension filesystem-port imports and does not move source. P1E.6 retargets the Harness filesystem-port import and is merged (PR #576, 0d4159b9623e65a5236ce8a9c7c225331765df83). P1E.7 retargets Feature Intent filesystem-port imports and is merged (PR #577, 5db19ba962882ca2bd1bd0b36195564d9d3d13c0). P1E.8 retargets Bounded Execution filesystem-port imports and is merged (PR #578, 3700abeadca7dc3274a4529058a7dc6c560b0cc2). P1E.9 retargets Continuous Loop filesystem-port imports and is merged (PR #579, 6742cd3be1c61d79301b8a13cb3dec13ef044064). P1E is complete. P1F.1 moves Feature Intent modules into a directory and is merged (PR #580, 2451dc01faac9c12ece874c13bf3fe1918e86f9f). P1F.2 moves Harness modules into a directory and is merged (PR #581, e44f24fe282a186d662ee8b71cfa16cecd37bc05). P1F.3 moves Extension Inspection modules into a directory and is merged (PR #582, 14e86cd85292ba7e0fa4854824cdade14835d2e4). P1F.4 found the Engineering Assessment directory already in place and did not open a PR. P1F.5 moves Bounded Execution read-side modules into a directory and is merged (PR #583, e14a5b67bf342e06ae83a55010acf76327e8a0f3). P1F.6 moves Continuous Loop read-side modules into a directory and is merged (PR #584, 6d94862b58046a5126048fc8dea1ffd60e882fb9). P1F.7 moves Foundation modules outside the two Foundation cycles and is merged (PR #585, aff1dd52cd66f437e5a20b5b08a658af83b0e9a2). P1F.8 is merged (PR #586, d647c6ec25b21e758fa83ae04d6a31b75bc94ecb). P1G.1 is merged (PR #587, a6234a4d20c208a34be301b468f2d3774640b1a9). P1G.2 is merged (PR #588). P1G.3 design is merged (PR #591). The implementation is merged as PR #596 (488067af1d39a614e718660944c7f3ae030b1be7). P1H.1 design is merged as PR #597 (eeda24d7bfba504d5ea6c7a781a6a054117a8a15). Implementation is merged as PR #598 (5f7917c1cef0997f6947932aa2f8f4186ac2decc). P1H.2 design is merged as PR #599 (ff7cb79329f403220aa4b369eede4cb8f06e591b). Implementation is merged as PR #600 (efce5db2b40d1f350df43d38b4b97d1ccd5c2736). P1H.3 design is merged as PR #601 (6b387a34c221f967a15ef670d53bea9b76e40828). P1H.3a catalog read is merged as PR #602 (460b81efd1e81f5b24a22e11d3af4680c8f28aad). P1H.3b proposal store and evaluation is merged as PR #603 (f116d199a0783870806e8c8660d90385c106f8e1). P1H.3c skill mutation and procedural memory is merged as PR #604 (911b229af00fcde54d8861af83a56e7e61df0902). P1H.3 is fully implemented. P1H.4 design is merged as PR #605 (6a9d0d26015caa857c19d0d22415904d832ad818). P1H.4a finding store and coverage is merged as PR #606 (ec951f32246ad0c94a145f520dc1862d9592c72e). P1H.4b SARIF import is merged as PR #607 (7a77db52753360f0029cd266d8c95eb78c34995c). P1H.4 is fully implemented.
1. Baseline
| Item | Value |
|---|---|
Starting main | f0b19c885d2aa95b041a4582e5218d2f3539f525 |
| Commit subject | refactor(repo): finalize architecture and documentation boundaries (#556) |
| Prior program | Desktop R1–R3 and Backend R4A–R4D are merged. PR #556 is that commit. |
| This increment | P1A documentation. No production source edits. |
| Application sources | 363 TypeScript files under packages/application/src/ |
Files directly under src/ | 153 |
| Application effective / physical SLOC | 47,292 / 50,555 |
DUTY_WATCH.md and PROJECT_STATE.md previously described R4D as unmerged and named Undo U4 as the next increment. Git is the source of truth: R4D is merged. This plan is the next maintainer-authorized architecture program. U4 and U5 stay unauthorized.
How the numbers were measured
- Effective and physical lines use
measureProductionSourceinscripts/production-file-metrics.mjs, the same counter as the production file budget. - Static imports and
export … fromclauses were read with the TypeScript 7 scanner. Relative.jsspecifiers were resolved to existing.tsfiles. - File cycles are strongly connected components of that resolved graph (Tarjan). A component is reported when it has more than one file, or a self-import.
index.tsdeclarations are the column-0 functions, classes, types, interfaces, and consts. That scan matches the 145functionkeywords in the file.- Consumer counts are static
from "…"imports inpackages/,apps/,tests/, andscripts/. - This is not a type-checker call graph. Template strings inside
inception-workspace-scaffold-files.tscontain exampleimporttext (vitest, scaffold package names). Those five tokens are scaffold text, not package dependencies, and are excluded from the dependency totals.
2. Canonical constraints
These documents govern the program. This plan links them. It does not restate them as a second handbook.
| Concern | Document |
|---|---|
| Structure and dependency direction | ARCHITECTURE.md |
| Domain language and context candidates | DOMAIN_MODELING.md |
| Boundaries and safety | ENGINEERING_PRINCIPLES.md |
| File and function budgets | CODE_QUALITY_STANDARDS.md |
| Agent planning and handoff | AI_AGENT_WORKFLOW.md |
| Documentation index | docs/README.md |
| Private application boundary | ADR-0007 |
| Versioned local protocol | ADR-0008 |
| Daemon lifecycle | ADR-0009 |
| Non-destructive adoption | ADR-0003 |
| Approved Apply | ADR-0053 |
| Publishing model (no public programmatic API) | ADR-0006 |
| Neutron application layout and cycle rules | ARCHITECTURE.md and tests/application-neutron-topology.test.ts |
Dependency direction
From ARCHITECTURE.md:
Presentation and process adapters (CLI, TUI, MCP, daemon)
↓
application use cases
↓
core / validator / protocol / adapters / evidence packages
Desktop → protocol → authenticated daemon → application use cases@intentloom/application depends on @intentloom/core, @intentloom/validator, @intentloom/protocol, @intentloom/adapters, @intentloom/evidence-analysis, @intentloom/evidence-checker, @intentloom/evidence-git, and yaml. Protocol and core do not depend on application. Desktop does not depend on application. Application does not depend on CLI, daemon, MCP, or Desktop.
ADR-0007 names core, validator, and adapters as the original application dependencies and forbids a dependency on CLI or process globals. The later protocol and evidence dependencies are the current architecture in ARCHITECTURE.md. They are existing structure, not a new violation. ADR-0007 still owns the rule that application stays a private use-case package and does not take over argument parsing, process exit mapping, or a broad new I/O framework.
Budgets that apply to later slices
From CODE_QUALITY_STANDARDS.md:
- Prefer production files at or below 250 effective lines.
- Review above 300 effective lines.
- New files stay at or below 400 effective lines and 700 physical lines.
- Prefer functions at or below 40 lines. Hard review threshold is 80 lines.
- Do not grow an oversized file.
index.tsis grandfathered. Its recorded ceiling indocs/governance/quality-exceptions.jsonis 6,764 effective and 7,151 physical lines. Current size is under that ceiling (section 4). - A structural slice must not mix in a behavior change.
Bounded contexts already named
DOMAIN_MODELING.md lists context candidates: Project Adoption, Engineering Intent and Catalog, Synchronization, Project Inspection and Evidence, Engineering Conformance and Assessment, Agent Workspace, Agent Memory, Neutron Execution, Mutation Governance, and Managed Extensions. A context is a vocabulary and invariant boundary, not a folder. Promoting one, or changing transaction ownership or dependency direction, needs an ADR. Moving files behind the existing barrel does not by itself need an ADR.
Mutation invariants already fixed by that document and by ARCHITECTURE.md stay in force: a proposal is not authorization; approval is not Apply; status is not authority to Apply or Undo; verification is not Apply; user Undo is not internal rollback of a failed Apply and does not rewrite Apply history.
Decisions this plan does not make
These stay open until a maintainer confirms them. P1A does not guess.
- Whether
*-cli.tsmodules, text renderers, and exit-code helpers that live in application move to the CLI. ADR-0007 assigns human rendering and exit codes to the CLI. The code currently keeps shared viewmodels in application so daemon, MCP, and CLI can share them. Moving them changes ownership. It is not part of the first slices. - Whether relative imports of
packages/protocol/src/**andpackages/validator/src/**become package subpath imports. That is P2 and P3. Doing it inside an application file move can create new barrels and cycles. - Whether the legacy Neutron subagent helpers at the bottom of
index.tsremain public. They are a different module fromsrc/neutron/. P1A does not delete or merge them. - Whether grandfathered size ceilings should be lowered to today's measured sizes. That is a gate change, not part of this documentation PR.
- The folder names in section 10 are a proposed topology. They are not a required template.
3. Application inventory
363 TypeScript files. 153 sit directly in packages/application/src/. The rest already live in neutron/, engineering-quality/, or engineering-assessment/.
The rows below partition the 363 files. The two one-line barrels engineering-quality.ts and engineering-assessment.ts are counted with their directories. The other 151 direct children of src/ are the root row. 153 files are direct children of src/ in total.
| Area | Files | Effective | Physical |
|---|---|---|---|
Other direct children of src/, including index.ts | 151 | 22,099 | 23,641 |
engineering-quality/ plus engineering-quality.ts | 55 | 7,093 | 7,586 |
engineering-assessment/ plus engineering-assessment.ts | 10 | 659 | 721 |
neutron/ | 147 | 17,441 | 18,607 |
| Total | 363 | 47,292 | 50,555 |
Neutron breakdown (R4A layout, unchanged by this plan):
| Neutron area | Files | Effective | Physical |
|---|---|---|---|
| root entrypoints | 5 | 545 | 559 |
session/ | 17 | 2,005 | 2,134 |
context/ | 8 | 996 | 1,071 |
graph/ | 5 | 599 | 629 |
scheduler/ | 21 | 2,566 | 2,742 |
scheduler/node/ | 6 | 712 | 758 |
tools/ | 8 | 1,140 | 1,204 |
mutation/proposal/ | 2 | 203 | 219 |
mutation/review/ | 9 | 643 | 680 |
mutation/approval/ | 6 | 617 | 671 |
mutation/apply/ | 26 | 2,853 | 3,024 |
mutation/status/ | 4 | 479 | 519 |
mutation/verification/ | 10 | 783 | 840 |
mutation/undo/ | 20 | 3,300 | 3,557 |
Filename prefixes are a hypothesis. They are wrong often enough that slices must follow imports, not the prefix. Corrections already visible:
apply-extension-update.tsanddiscover-and-apply-extension-update.tsbelong with extension lifecycle, not with project init/sync.approved-apply-*.tsandproject-root-mutation-lock.tsare the shared mutation transaction and in-process lock. Adoption and Neutron both use them.inception.ts(279 effective) andharness.ts(11 effective) are barrels for those families, not leftovers.cli-quality-entry.ts,curated-catalog-entry.ts,graph-provider-entry.ts,engineering-quality-entry.ts,quality-viewmodel-entry.ts, andnx-graph-entry.tsare one-line engineering-quality barrels.existing-project-w9.tsandfoundation-flow.tsare small re-export barrels with high fan-out. The fan-out is the barrel, not a large module.generated-file-sync-declared.tsis transaction/sync code. It participates in the Approved Apply cycle. It is not an isolated adoption helper.project-profile-detection.tsandproject-scan-exclusions.tsare shared by inspection, adoption, andnodeFileSystem.
Files above the preferred 250 effective-line target
Only index.ts exceeds the 400 effective / 700 physical hard ceiling.
| Effective | Physical | File |
|---|---|---|
| 6,746 | 7,131 | index.ts |
| 302 | 317 | generated-file-sync-declared.ts |
| 292 | 314 | foundation-blueprint.ts |
| 279 | 309 | inception.ts |
| 278 | 297 | neutron/session/neutron-session-runtime.ts |
| 270 | 302 | neutron/mutation/undo/neutron-mutation-undo-snapshot-manifest.ts |
| 269 | 289 | neutron/mutation/undo/neutron-mutation-undo-preflight.ts |
| 269 | 276 | inception-workspace-scaffold-files.ts |
| 258 | 265 | existing-project-adoption-apply.ts |
| 257 | 268 | neutron/tools/neutron-tool-authorization.ts |
| 255 | 265 | neutron/scheduler/neutron-scheduler-recovery.ts |
| 254 | 264 | neutron/mutation/apply/neutron-mutation-apply-validate.ts |
| 251 | 266 | neutron/scheduler/neutron-scheduler-lease-store.ts |
| 251 | 261 | neutron/neutron-n2-loop.ts |
Neutron files in that list stay put while R4A is frozen. The non-Neutron files are later extraction candidates inside their own slices. Do not grow them in passing.
The full per-file table is Appendix A.
4. packages/application/src/index.ts
| Metric | Measured at this baseline | Grandfathered ceiling |
|---|---|---|
| Physical lines | 7,131 | 7,151 |
| Effective lines | 6,746 | 6,764 |
| Blank lines | 384 | |
| Comment-only lines | 1 |
wc -l is 7,131, the same as the governance counter. An earlier observation of 7,132 physical lines does not match this tree. The file is 20 physical lines and 18 effective lines under the grandfathered ceiling. Later slices must not raise either number. The ceiling itself stays as recorded until a maintainer tightens the gate.
The file is the public compatibility barrel and the remaining use-case implementation. Both jobs are in one module. That is the primary decomposition target.
Declarations
Column-0 scan:
| Kind | Exported | Internal |
|---|---|---|
| function | 106 | 39 |
| class | 2 (ProjectRootError, ArtifactValidationFailure) | 1 (PostWriteValidationFailure) |
| interface | 29 | 4 |
| type alias | 10 | 2 |
| const | 1 (nodeFileSystem) | 9 |
There are also 29 export … from clauses. They re-export task routing, external skill import, harness adoption gate, Approved Apply gate and engine, YAML parse/stringify, project scan exclusions, destination collisions, declared-path sync, the inception family, harness, extension inspection and adoption, knowledge provider, Graphify, engineering assessment, and engineering quality. Those re-exports are the stable surface. The bodies behind them already live in other files.
packages/cli/src/index.ts is export * from "@intentloom/application". Every root export is therefore part of the internal CLI facade used by tests. The published intentloom package exports only ./package.json and the intentloom bin (ADR-0006). There is no supported external programmatic import.
Cohesive groups inside the file
Line ranges are column-0 declaration spans on this baseline. Public names stay exported from index.ts after any move.
| Lines | Group | Public operations | Implementation still in this file | I/O and sensitivity |
|---|---|---|---|---|
| 192–229 | Conformance summaries | evaluateProjectEngineeringConformance, summarizeProjectWorkflowVariants, summarizeProjectWorkflowDurations, summarizeProjectConformanceTrend, summarizeProjectWorkflowRepetitions, summarizeProjectWorkflowTransitionIntervals | Thin wrappers over @intentloom/evidence-analysis | No filesystem. Leaf. First slice. |
| 230–331 | Protocol memory, skill, security, and workspace types | Re-exported protocol types and a block of validate* functions | No local logic | Types only. |
| 333–707 | Project operation contracts | Change, Plan, DoctorPlan, TransactionResult, FileSystem, InitOptions, AdoptionProposal, SyncOptions, and neighboring types; doctorExitCode | Contract types plus module constants (.aif paths, adapter id) | doctorExitCode is exit-code mapping that ADR-0007 assigns to the CLI. Leave it until a maintainer accepts an ownership move. |
| 511–557 | Root canonicalization and timeline | ProjectRootError, assertCanonicalProjectRoot, timelineProject | Symlink rejection, then @intentloom/evidence-git | Host filesystem through the FileSystem port. Security-sensitive. |
| 708–865 | Inspection and path containment | inspectProject; re-exports of destination collisions and declared-path sync | secretLikePath, inside, projectRelativePaths | inside is the path-traversal check. secretLikePath drops secret-like paths from inspection. Do not change the checks. |
| 866–1938 | Generated-file transaction | synchronizeGeneratedFiles, ArtifactValidationFailure | collisionPlan, noncanonicalPathPlan, validateCommittedOwnershipState, plan, apply, metadata and post-write validation | Filesystem writes, ownership, rollback inputs. Highest sensitivity. |
| 1939–2992 | Project lifecycle orchestration | initProject, syncProject, diffProject, doctorProject, adoptProject, planFeature | doctorProject is 589 lines (2020–2608). adoptProject is 304 lines (2622–2925). | Orchestration over the transaction group. |
| 2993–3109 | Host filesystem port | createMemoryFileSystem, nodeFileSystem | In-memory map and Node implementation: symlink skip, binary skip, depth 32, 10,000 file cap, scan exclusions | Direct node:fs/promises. Legitimate port. Second slice. |
| 3111–3440 | Governance adoption apply | planProjectAdoption, applyProjectAdoption | Options types | Filesystem plus catalog adoption. Sensitive. |
| 3448–5101 | Skills, checkpoints, delegation, bounded context | Skill proposal, evaluation, procedural memory, profiles, delegateTaskRole, getBoundedProjectContext, task pause/resume | Large parsers, including parseSkillProgressive (136 lines) | Durable project files through FileSystem. |
| 5102–5452 | Persistent memory | propose, accept, supersede, forget, import, export, search, render | Path helpers and redaction | Durable memory files. |
| 5453–5625 | Agent session | start, get, list, close, delete, export | Session file layout | Durable session files. |
| 5626–6663 | Security operations | SARIF import, coverage, local adapters, policy, baseline, sandbox evaluation, runContinuousSecurityAudit | runLocalSecurityAdapters is 200 lines. runContinuousSecurityAudit is 215 lines. | Security invariants. Strong tests before any move. |
| 6664–6987 | Interactive workspace | getInteractiveWorkspaceState, conversation and proposal review, applyWorkspaceProposal | Read model plus a mutating apply | applyWorkspaceProposal is a mutation path. Split the read model from apply only in a dedicated slice. |
| 6988–7131 | Legacy Neutron subagent and local sync | spawnNeutronSubagentTask, getNeutronSubagentTask, listNeutronSubagentTasks, syncLocalWorkspaceState | Task records stored through FileSystem | Not the src/neutron/ runtime. Do not merge the two. |
Functions whose span exceeds 80 lines
These spans are declaration-to-next-declaration, so they include the body. They are the functions that most need a later cohesive split. P1A does not split them.
| Span | Lines | Name |
|---|---|---|
| 589 | 2020–2608 | doctorProject |
| 304 | 2622–2925 | adoptProject |
| 258 | 1135–1392 | validateCommittedOwnershipState |
| 215 | 6449–6663 | runContinuousSecurityAudit |
| 200 | 5922–6121 | runLocalSecurityAdapters |
| 186 | 1393–1578 | synchronizeGeneratedFiles |
| 166 | 3120–3285 | planProjectAdoption |
| 163 | 3796–3958 | discoverSkills |
| 139 | 3302–3440 | applyProjectAdoption |
| 136 | 3660–3795 | parseSkillProgressive |
| 134 | 1646–1779 | desired |
| 120 | 719–838 | inspectProject |
| 118 | 5738–5855 | importSarifSecurityReport |
| 117 | 4985–5101 | getBoundedProjectContext |
| 109 | 225–333 | summarizeProjectWorkflowTransitionIntervals (body is 225–229; the span includes the following export-type block until the next column-0 declaration) |
| 88 | 4757–4844 | rankProceduralMemory |
| 86 | 6345–6430 | evaluateProposalAgainstSandbox |
| 84 | 1828–1911 | plan |
| 84 | 6212–6295 | checkSecurityPolicyAndBaseline |
Public API versus implementation ownership
- Public API ownership is the root barrel
src/index.tsplus theexportsmap inpackages/application/package.json. Callers must be able to keep importing those names. - Implementation ownership is the module that holds the body. Today the body of the groups above is the barrel itself. That is the debt.
- Internal helpers (
inside,plan,apply,desired,validateCommittedOwnershipState, and the other 39 functions) have no callers outside this file. They move with the group that calls them. - Shared utilities with real cross-feature callers are not those private helpers. They are
FileSystem,nodeFileSystem,createMemoryFileSystem,project-root-mutation-lock.ts,project-scan-exclusions.ts,canonical-json.ts,skill-markdown.ts, andneutron/neutron-session-fingerprint.ts.
5. Dependency graph
Package dependencies
Incoming workspace dependencies, from package manifests:
| Package | Depends on @intentloom/application |
|---|---|
intentloom (CLI) | yes |
@intentloom/daemon | yes |
@intentloom/mcp-server | yes |
@intentloom/desktop | no |
@intentloom/protocol, @intentloom/core, @intentloom/validator | no |
Outgoing application dependencies are the manifest in section 2. Static package-specifier imports inside application, excluding the five scaffold template tokens:
| Specifier | Import sites |
|---|---|
@intentloom/protocol | 181 |
@intentloom/validator | 84 |
@intentloom/core | 40 |
yaml | 8 |
@intentloom/adapters | 2 |
@intentloom/evidence-git | 2 |
@intentloom/evidence-checker | 1 |
@intentloom/evidence-analysis | 1 |
Evidence-analysis is also reached through the conformance wrappers, which call the package's functions. The single from "@intentloom/evidence-analysis" count is the import clause in index.ts.
Relative imports that leave the package
126 application files import implementation files by relative path instead of a package specifier:
| Target | Import sites | Distinct files |
|---|---|---|
packages/protocol/src/** | 259 | 48 targets across protocol and validator |
packages/validator/src/** | 73 | included in the 48 |
catalog/packs/specialized-engineering/index.js | 1 | engineering-quality/first-party-specialized-pack-runtime.ts |
The hottest relative targets are Neutron protocol and validator modules, led by packages/protocol/src/neutron/runtime/neutron-runtime.ts (69 sites). Protocol's public subpaths (neutron-runtime, neutron-mutation, neutron-session, neutron-graph) do not cover every file those imports reach. This is existing R4 coupling, not a new cycle inside application. P1 file moves must keep these relative paths valid or update them in the same slice. P2/P3 decide whether a subpath can replace them. Do not add a new neutron/index.ts barrel. Architecture already forbids that barrel.
No application file imports @intentloom/cli, @intentloom/daemon, @intentloom/mcp-server, apps/desktop, React, or Tauri. Matches on react and @tauri-apps/ in this package are profile detection and inception scaffold text, not dependencies.
Area edges
With Neutron mutation stages kept as one area, and scheduler node kept inside scheduler:
application-rootimportsengineering-qualityandengineering-assessment(the root barrels).engineering-qualityimportsapplication-root(index.tsforFileSystem/nodeFileSystem). That pair is a cycle.engineering-assessmentdoes not import the root. The edge is one-way.- Neutron areas import
application-rootfor the filesystem port and a few shared helpers. The root does not importneutron/. Neutron's dependency on the god barrel is one-way. - Among the six Neutron subfeatures (session, context, graph, scheduler, tools, mutation), session is a source, context and tools do not import other subfeatures, and the cross edges match the allowlist in
tests/application-neutron-topology.test.ts. Collapsing mutation stages does not create a new subfeature cycle. - Treating each mutation stage as its own area produces one large component because stages are allowed to import each other (ARCHITECTURE.md). That component is the existing mutation subfeature, not a new violation.
Measured file cycles
Five components. These are measured. The Neutron one is the cycle the topology test already allowlists. The other four are existing debt outside that test.
- Approved Apply / sync / barrel.
approved-apply-baseline.ts→index.ts←approved-apply-engine.ts→generated-file-sync-declared.ts→approved-apply-baseline.ts, andindex.tsre-exports the engine and imports declared-path sync. Any slice that touches this set must keep the component from growing and must not change Apply behavior. - Foundation workshop.
foundation-discovery.ts,foundation-viewmodel.ts, andfoundation-workshop.tsimport each other. - Foundation scaffold viewmodels.
foundation-scaffold-client-viewmodel.tsandfoundation-scaffold-workspace-viewmodel.tsimport each other. - Inception barrel.
inception.tsandinception-viewmodel.tsimport each other. - Recorded Neutron mutation cycle.
neutron/mutation/apply/neutron-mutation-apply-durable-record.ts,neutron/mutation/apply/neutron-mutation-apply-store.ts, andneutron/mutation/verification/neutron-mutation-verification-retry-eligibility.ts.tests/application-neutron-topology.test.tsexpects exactly this component. Leave it frozen.
No self-imports were found. Do not describe the graph as acyclic.
Fan-in and fan-out
Internal importers (fan-in), top of the graph:
| Importers | Module |
|---|---|
| 70 | index.ts |
| 19 | neutron/mutation/apply/neutron-mutation-apply-store.ts |
| 15 | neutron/scheduler/neutron-scheduler-stale.ts |
| 12 | neutron/mutation/review/neutron-graph-mutation-store.ts |
| 12 | neutron/scheduler/neutron-scheduler-errors.ts |
| 12 | neutron/scheduler/neutron-scheduler-sort.ts |
| 12 | neutron/session/neutron-session-turn.ts |
| 11 | engineering-quality/cli-quality-standards.ts |
| 11 | neutron/mutation/apply/neutron-mutation-containment.ts |
| 10 | propose-and-apply-extension-adoption.ts |
Internal imports (fan-out):
| Imports | Module |
|---|---|
| 39 | engineering-quality/index.ts (barrel) |
| 22 | neutron/neutron-scheduler.ts (composition barrel) |
| 17 | existing-project-w9.ts (barrel) |
| 14 | index.ts |
| 14 | neutron/session/neutron-session-runtime.ts |
| 12 | neutron/neutron-graph-mutation.ts (composition barrel) |
| 12 | neutron/session/neutron-session-graph.ts |
index.ts is the module with unrelated reasons to change: conformance, filesystem, transactions, doctor, adoption, skills, memory, sessions, security, workspace, and legacy Neutron tasks. Secondary hotspots:
engineering-quality/index.tsre-exports every quality engine, CLI helper, and viewmodel. It changes when any quality slice changes.foundation-workshop.tscombines workshop flow, discovery, and viewmodels (cycle 2).inception.tscombines flow and viewmodels (cycle 4).generated-file-sync-declared.tscombines declared-path sync with the Apply cycle.
High fan-out on existing-project-w9.ts, foundation-flow.ts, and harness.ts is barrel re-export, not a second god module.
6. Candidate ownership
These are ownership proposals grounded in the files that exist. They are not a folder checklist. Shared contracts (FileSystem, Plan, protocol types) stay shared. No new repository interfaces are required for the moves below.
Project lifecycle and project operations
- Responsibility: explicit-root init, diff, sync, doctor, inspect, and the generated-file transaction those operations share.
- Public operations:
initProject,diffProject,syncProject,doctorProject,inspectProject,timelineProject,synchronizeGeneratedFiles,assertCanonicalProjectRoot. - Internal implementation: the transaction helpers in
index.tslines 866–1938, plusresolve-project-doctor-init.ts. - Shared contracts:
Plan,DoctorPlan,TransactionResult,FileSystem,ProjectRootError. - Dependencies: core, adapters, validator, yaml, scan exclusions, destination collisions, declared-path sync, profile detection.
- I/O:
FileSystemport, withnodeFileSystemas the host adapter. - Transaction and security: path containment (
inside), symlink rejection, collision and noncanonical-path plans, post-write validation,validateCommittedOwnershipState. - Tests:
tests/doctor*.test.ts,tests/project-inspection.test.ts, CLI sync/init/doctor tests, daemon doctor paths. - Migration risk: high. This is the last application-index slice, after leaves exist, so the new module does not import
index.ts.
Foundation
- Responsibility: foundation workshop, blueprint, discovery, readiness, and scaffold planning.
- Public operations: the
foundation*exports already re-exported through the root barrel (CLI and daemon import them from@intentloom/application). - Internal implementation: 33
foundation*.tsfiles.foundation-flow.tsand thefoundation-w*.tsfiles are small barrels. - Shared contracts: protocol foundation types. The family does not import
FileSystem. - Dependencies: protocol and validator. P1E.2 measured zero imports of
FileSystem,nodeFileSystem, andcreateMemoryFileSystemin the 33foundation*.tsfiles. - I/O:
foundation-fixtures.tsreads JSON withnode:fs. Scaffold apply calls the inception scaffold applier. No host filesystem port import. - Transaction and security: scaffold apply revalidation (
foundation-scaffold-apply-revalidation.ts). Not Neutron Apply. - Tests: 14
tests/foundation*files plus daemon foundation tests. - Migration risk: medium. Two file cycles (workshop trio, scaffold viewmodel pair) must be broken by import direction, not by a new interface.
foundation-cli.tsand viewmodel renderers stay until the rendering ownership decision.
Inception
- Responsibility: blueprint, approval, scaffold plan/apply, templates, and workspace scaffold generation.
- Public operations: inception exports re-exported from
index.tsviainception*.ts. - Internal implementation:
inception.ts(279 effective) plus 17 sibling files. - Shared contracts: protocol inception types.
- Dependencies: protocol, validator, filesystem port.
- I/O: scaffold writers through
FileSystem;inception-fixtures.tsreads fixture files. - Transaction and security: scaffold apply is a reviewed write path. Preserve it.
- Tests: 14
tests/inception*files. - Migration risk: medium.
inception.tscycles withinception-viewmodel.ts.inception-workspace-scaffold-files.tsembeds example source in templates; do not treat those strings as imports.
Existing-project adoption
- Responsibility: preview, approval, prepared-plan digest and revalidation, and apply for an existing tree.
- Public operations:
adoptProjectstill inindex.ts; theexisting-project-adoption-*modules;planProjectAdoptionandapplyProjectAdoption. - Internal implementation: 25 files plus the adopt/apply functions in
index.ts.existing-project-w9.tsis the barrel. - Shared contracts:
AdoptionProposal, core adoption types,FileSystem, the project-root lock. - Dependencies: generated-file sync, Approved Apply modules, profile detection, instruction taxonomy.
- I/O: filesystem port. Apply writes only through the existing transaction.
- Transaction and security: approval gates, fingerprint, stale-plan rejection, health checks. ADR-0003 and ADR-0053 apply.
- Tests:
tests/existing-project*and adoption tests (filename search shows 16 existing-project tests and additional adoption tests). - Migration risk: high where it touches
synchronizeGeneratedFilesor Approved Apply. Moving the already-splitexisting-project-*files into a directory is lower risk than movingadoptProject.
Feature intent
- Responsibility: feature scope, impact, plan, and workspace around an intent.
planFeatureinindex.tsis the older entry. - Public operations:
planFeature, plusfeature-intent-*exports. - Internal implementation: 11
feature-intent*/task-routing.ts/skill-markdown.tsfiles.skill-markdown.tsis shared withparseSkillProgressive. - Shared contracts: protocol feature-intent types,
FileSystem. - Dependencies: task routing, skill markdown, filesystem.
- I/O: filesystem port; fixtures use
node:fs. - Transaction and security: planning is read-only until a separate apply path is invoked. Do not fold it into Apply.
- Tests:
tests/feature-intent*(3) plus daemon feature-intent tests. - Migration risk: low for the existing directory-ready files.
planFeaturestays in the index until the lifecycle slice.
Bounded execution
- Responsibility: capability-bounded workspace preparation, task, verify, and apply gate.
mutationAllowedstays an explicit result, not an implied grant. - Public operations:
bounded-execution-*exports consumed by daemon and CLI from the root barrel. - Internal implementation: 9 files.
bounded-execution-w11.tsis a barrel. - Shared contracts: protocol bounded-execution types,
FileSystem, Approved Apply types where apply is requested. - Dependencies: Approved Apply gate, filesystem.
- I/O: filesystem port; fixtures use
node:fs. - Transaction and security: capability checks and approval tokens. Preserve fail-closed behavior.
- Tests:
tests/bounded*andtests/daemon-bounded-execution.test.ts. - Migration risk: medium because apply sits next to Approved Apply. A directory move of the nine files is safer than editing the gate.
Continuous loop
- Responsibility: compare and apply a continuous-loop workspace.
- Public operations:
continuous-loop-*exports. - Internal implementation: 7 files.
continuous-loop-w12.tsis a barrel. - Shared contracts: protocol types,
FileSystem. - Dependencies: filesystem, shared plan types.
- I/O: filesystem port; fixtures use
node:fs. - Transaction and security:
continuous-loop-apply.tsis a write path. - Tests:
tests/continuous*and daemon continuous-loop tests. - Migration risk: medium on the apply file, low on the read/compare files.
Harness
- Responsibility: scenario run, comparison, sandbox negotiation, state, benchmark, and adoption gate. Real provider adapters stay deferred.
- Public operations: harness exports re-exported from
index.tsandharness.ts. - Internal implementation: 15
harness*.tsfiles plusexternal-skill-import.ts. - Shared contracts: protocol harness types,
FileSystem. - Dependencies: protocol, validator, adoption gate.
- I/O: sandbox adapters are in-process fakes and local read-only descriptions. No
node:child_processimport was found in application. - Transaction and security:
harness-adoption-gate.tsis fail-closed adoption enforcement. - Tests: 13
tests/harness*files plus MCP harness tests. - Migration risk: low for a directory grouping. Do not enable effectful mutation while moving files.
Extension lifecycle
- Responsibility: manifest inspection, adoption proposal/apply, update, removal preview, health, sandbox, and lock path.
- Public operations:
inspectExtensionManifest,propose-and-apply-extension-adoption, removal and update exports. - Internal implementation: 11 extension files plus
apply-extension-update.tsanddiscover-and-apply-extension-update.ts. - Shared contracts: protocol extension types,
FileSystem. - Dependencies: validator extension inspection, filesystem, project lock.
- I/O: filesystem port. Update apply writes files.
- Transaction and security: removal preview versus apply, lock path, sandbox limits.
- Tests: 9
tests/extension*files. - Migration risk: medium on apply/update/remove. Inspection-only modules can move earlier.
Engineering assessment
- Responsibility: evidence-backed assessment operations already isolated under
engineering-assessment/. - Public operations:
assessProjectand the assessment barrel. Package subpath./engineering-assessmentpoints atsrc/engineering-assessment.ts, which re-exports the directory. - Internal implementation: 9 files in the directory plus the one-line root barrel.
- Shared contracts: protocol assessment types.
- Dependencies: protocol, validator. It does not import
index.ts. - I/O: caller-supplied evidence. The application operation is not a second filesystem walker.
- Transaction and security: read-only assessment. No Apply.
- Tests: 12
tests/engineering-assessment*files. - Migration risk: low. The boundary already exists. Later work should only stop the root
index.tsfrom being the only re-export path if a consumer needs the subpath. No consumer currently imports the subpath specifier (section 9).
Engineering quality
- Responsibility: quality packs, baselines, ratchets, checker ingestion, graph providers, remediation plans, and specialized packs.
- Public operations: the quality barrel, already re-exported from
index.tsthroughengineering-quality-entry.ts. Package subpath./engineering-quality. - Internal implementation: 54 files in
engineering-quality/plus four one-line root barrels. - Shared contracts: protocol quality types,
FileSystemfromindex.ts. - Dependencies: protocol, validator, core, and the application root.
- I/O: mostly pure functions over caller-supplied documents.
cli-specialized-packs-external.tsalso callsnode:fs/promisesreadFilefor a manifest path. One runtime file readscatalog/packs/specialized-engineering. - Transaction and security: external pack activation and apply are separate reviewed decisions. Human approval tokens stay required.
- Tests: 32
tests/engineering-quality*files. - Migration risk: medium. The directory is a real boundary. The cycle is the root barrel plus
FileSystemimports. Break it by importing the filesystem leaf after P1C, not by a new quality interface. CLI text renderers and exit helpers inside this directory wait for the rendering ownership decision.
Neutron
- Responsibility: session runtime, context assembly, graph, scheduler and node execution, read-only tools, and mutation stages. Already laid out in ARCHITECTURE.md.
- Public operations: package subpaths
neutron-runtime,neutron-n2,neutron-context-assembly,neutron-n4,neutron-scheduler,neutron-graph-mutation,neutron-session. - Internal implementation: 147 files under
src/neutron/. - Shared contracts: protocol Neutron types, often imported by relative path;
FileSystem; session fingerprint. - Dependencies: protocol, validator, and the application root. No CLI, daemon, Desktop, React, or Tauri imports (enforced by the topology test).
- I/O: durable host files in apply, status, and undo modules via
node:fs/promises(section 7). Session code receives the host directory; it does not invent a second store. - Transaction and security: Approved Apply, durable records, verification, and Undo U1–U3. See section 8.
- Tests: 71
tests/neutron*files plus mutation durable tests. - Migration risk: do not move. R4A is the accepted topology. A defect inside it needs its own maintainer decision and its own PR.
Modules that do not fit one candidate
model-adapter.tsandollama-model-adapter.ts: provider adapter used by Neutron. Daemon imports the Ollama adapter by source path. Leave the paths stable until a daemon import update is the point of the PR.knowledge-provider.tsandgraphify-adapter.ts: extension/knowledge boundary, re-exported from the root.canonical-json.ts: shared deterministic JSON helper.- Legacy Neutron task helpers in
index.ts: Agent Workspace era storage, notsrc/neutron/.
7. Clean Architecture checks
Application does not import CLI, Desktop, Tauri, daemon transport, or MCP transport. Desktop has no import of @intentloom/application. Daemon and MCP call application; they are not dependencies of it.
Presentation-shaped code still lives inside application. That is existing debt against ADR-0007's assignment of rendering and exit codes to the CLI:
foundation-cli.ts,foundation-scaffold-cli.ts,inception-cli.tsbounded-execution-workspace-cli.ts,continuous-loop-workspace-cli.tsexisting-project-workspace-cli.ts,feature-intent-workspace-cli.ts- engineering-quality
cli-*.ts,viewmodel.ts,viewmodel-renderers.ts, and specialized-pack viewmodel/text/exit helpers doctorExitCodeinindex.ts
They exist so CLI, daemon, and MCP can share one structured result. Moving them is the open decision in section 2. P1 structural slices leave them in application.
Node.js imports
No node:child_process, node:net, node:http, or node:https imports were found under packages/application/src.
| Module | Import | Classification |
|---|---|---|
index.ts | node:fs/promises, node:path, node:crypto | Host filesystem port (nodeFileSystem) plus hashing. Legitimate orchestration behind the existing FileSystem type. Direct fs use outside that object should move with the port in P1C and not spread. |
neutron/mutation/apply/neutron-mutation-apply-durable-fs.ts | node:fs/promises | Crash-safe exclusive create, sync, and atomic rename for durable Apply state. Infrastructural host I/O. Already a focused module. Frozen with Neutron. |
neutron/mutation/undo/neutron-mutation-undo-snapshot-store.ts | node:fs/promises | Undo snapshot directory. Same classification. Frozen. |
neutron/mutation/status/neutron-mutation-status-index.ts | node:fs/promises mkdir | Status index directory creation. Frozen. |
engineering-quality/cli-specialized-packs-external.ts | node:fs/promises readFile | Reads a manifest path in addition to the FileSystem port. Tightly coupled I/O. Extract only in a quality slice that preserves the read. |
*-fixtures.ts (bounded execution, continuous loop, existing project, feature intent, foundation, inception) | node:fs or node:fs/promises | Load shipped fixture JSON, then project it onto FileSystem. Acceptable technical detail. |
project-root-mutation-lock.ts | node:async_hooks, node:path | In-process lock (AsyncLocalStorage plus a promise tail). Legitimate host orchestration. ADR-0007 warns against a new I/O abstraction with one implementation. Leave the lock concrete. |
| 32 files | node:crypto | Hashes and ids. Acceptable technical detail. |
| 47 files | node:path | Path joins and containment. Acceptable when the safety rule stays explicit, as in inside and neutron-mutation-containment.ts. |
Pure rules that are coupled to I/O today:
- Conformance summaries are already pure. They are the first extraction.
secretLikePathandinsideare pure functions of strings sitting inside the filesystem module. They can move as pure helpers without takingnode:fswith them.doctorProject,adoptProject, andsynchronizeGeneratedFilesmix policy, planning, and writes. Split only by cohesive behavior, and only after tests cover the current results. Do not invent ports for each call.
8. Safety and behavior preservation
Structural PRs do not change behavior. The tests below are the preservation net. If a move would require editing an assertion, stop and split the change.
| Sensitive area | Where it lives | Preservation rule |
|---|---|---|
| Approved Apply | approved-apply-gate.ts, approved-apply-engine.ts, approved-apply-baseline.ts, ADR-0053 | Do not retarget the engine until it can import leaves instead of index.ts. Keep the 4-file cycle from growing. |
| Host approval and authorization | Neutron mutation/approval/, mutation/proposal/, tool authorization | Frozen with Neutron. Approval is not Apply. |
| Atomic transaction | synchronizeGeneratedFiles, validateCommittedOwnershipState, plan, apply in index.ts | Move as one unit, late. Keep step order visible. |
| Project locks | project-root-mutation-lock.ts, Neutron durable lock | Do not replace AsyncLocalStorage with a new interface in a move PR. |
| Durable state | Neutron apply durable record/store/fs, status index | Frozen. |
| Path containment and symlinks | inside, assertCanonicalProjectRoot, neutron-mutation-containment.ts, inspection symlink finding | Preserve the current checks, including symlink rejection at the root. |
| Snapshots and rollback | Neutron undo snapshot store, verification rollback evidence | User Undo is not Apply-failure rollback. Frozen. |
| Undo U1–U3 | neutron/mutation/undo/ (20 files) | Merged behavior stays. U4 and U5 do not start. |
| Neutron runtime and scheduler | neutron/session, neutron/scheduler, neutron/neutron-n2-loop.ts | Frozen. |
| Security audit and sandbox | index.ts lines 5626–6663 | Own slice, after filesystem leaf exists, with security tests unchanged. |
| Workspace apply | applyWorkspaceProposal | Do not move it with the read-only workspace view. |
mutationAllowed remains a literal result of the bounded and Neutron contracts. A refactor must not turn it into a derived true.
9. Public API compatibility
Package subpaths
From packages/application/package.json. No TypeScript file in this repository imports @intentloom/application/<subpath>. Consumers use the root barrel or a relative source/dist path. The subpath names are still the R4A contract. A move may change the target file path and must keep the subpath key and the symbol the topology test checks.
| Subpath | Current target | Symbol the topology test requires |
|---|---|---|
. | src/index.ts | root barrel |
./model-adapter | src/model-adapter.ts | |
./ollama-model-adapter | src/ollama-model-adapter.ts | |
./neutron-runtime | src/neutron/neutron-runtime-contracts.ts | prepareNeutronRuntimeContractSnapshot |
./neutron-n2 | src/neutron/neutron-n2-loop.ts | runNeutronN2ReadOnlyLoop |
./neutron-context-assembly | src/neutron/context/neutron-context-assembly.ts | assembleNeutronContext |
./neutron-n4 | src/neutron/tools/neutron-tool-router.ts | routeNeutronToolInvocation |
./neutron-scheduler | src/neutron/neutron-scheduler.ts | approveAndApplyNeutronGraphMutation |
./neutron-graph-mutation | src/neutron/neutron-graph-mutation.ts | applyApprovedNeutronGraphMutation |
./neutron-session | src/neutron/session/neutron-session-runtime.ts | createNeutronSessionRuntime |
./engineering-assessment | src/engineering-assessment.ts | |
./engineering-quality | src/engineering-quality.ts |
Who imports the root barrel
Named imports of @intentloom/application (distinct symbols):
| Consumer | Files importing the root | Distinct symbols |
|---|---|---|
| CLI | 39 | 121 |
| Daemon | 20 | 74 |
| MCP server | 6 | 32 |
| Tests | 156 | 356 |
| Desktop | 0 | 0 |
415 distinct symbols appear in those named imports. CLI src/index.ts also star-re-exports the barrel for internal tests. Daemon additionally imports built output and source paths:
packages/daemon/src/bin.tsimports../../application/dist/index.js,../../application/src/neutron/session/neutron-session-runtime.js, and../../application/src/ollama-model-adapter.jspackages/daemon/src/project-health-handlers.tsimports../../application/dist/resolve-project-doctor-init.js- Neutron daemon handlers type-import
NeutronSessionRuntimefromapplication/src/neutron/session/neutron-session-runtime.ts
Tests deep-import application source (307 import sites, 69 specifiers). The most common is packages/application/src/index.js (81 sites), then neutron/neutron-scheduler.js (28) and neutron/neutron-session-fingerprint.js (23).
How moves keep the API
- New modules are imported by
index.tsand re-exported. Existingfrom "@intentloom/application"sites stay valid. - Do not add a second barrel that imports
index.ts. - Do not change package subpath keys.
- Deep source imports and the two
application/dist/*imports are compatibility edges. A slice that changes one of those paths updates the daemon or test import in the same commit and says so. - Neutron paths named above stay stable for the whole P1 program unless a separate maintainer decision unfreezes R4A.
- Star re-exports that already exist stay. New cycles of barrels are not introduced.
engineering-quality/index.tsis already a wide barrel; do not add another one beside it.
10. Proposed target topology
A thin root barrel, feature directories for code that is already a family, and shared leaves that more than one family calls. Create a directory only in the slice that moves files into it.
packages/application/src/
index.ts compatibility barrel, re-exports only
host-file-system.ts FileSystem, nodeFileSystem, createMemoryFileSystem
project-path.ts inside, secretLikePath, and other pure path checks
project-operations/ init, diff, sync, doctor, inspect, transaction
adoption/ existing-project adoption and governance adopt/apply
foundation/
inception/
feature-intent/
bounded-execution/
continuous-loop/
harness/
extension/
engineering-assessment/ already present
engineering-quality/ already present
neutron/ frozen R4A layoutmodel-adapter.ts and ollama-model-adapter.ts stay at the paths the package exports and the daemon imports, until a daemon-focused PR.
This picture is a proposal. A slice may keep a file at the src/ root when that is the smaller move. Empty directories are not part of P1A.
11. Ordered slices
Every slice: expected behavior change is none. Rollback is git revert of that slice. The root barrel must still export the same names. The new module must not import index.ts. Neutron files are not in any slice below.
Merge prerequisite for P1B and every later slice: maintainer acceptance of this plan, or an explicit instruction to start that slice. This PR does not implement them.
P1B — conformance summary leaf (first)
| Source | index.ts lines 192–229: the six conformance and workflow summary functions |
| Target | packages/application/src/project-conformance-summaries.ts |
| Moved responsibility | Pure wrappers over @intentloom/evidence-analysis |
| Edges | New file imports @intentloom/evidence-analysis and the protocol types those signatures use. index.ts re-exports the six names. No edge to index.ts from the new file. |
| Exports | Same six root exports |
| Tests | tests/engineering-conformance.test.ts, tests/conformance-trend-summary.test.ts, tests/workflow-duration-metrics.test.ts, tests/workflow-repetition-summary.test.ts, tests/workflow-variant-summary.test.ts, tests/workflow-transition-intervals.test.ts, and the conformance section of tests/daemon.test.ts |
| Guards | New file under 250 effective lines. index.ts effective and physical lines do not rise. Topology test still passes. |
| SLOC | About 40 effective lines leave index.ts. New file is that body plus imports. |
| Why first | Leaf, no filesystem, no transaction, existing equality tests against evidence-analysis. |
| Implementation | Merged as PR #558 (5dac7f0556498949eb2ab33fae6e89e3cbdcfb68). The six names stay on the application root as explicit re-exports. |
P1C — host filesystem port
| Source | FileSystem and the types that are only the port, plus createMemoryFileSystem, memoryPath, and nodeFileSystem (index.ts 472–482 and 2993–3109) |
| Target | packages/application/src/host-file-system.ts |
| Moved responsibility | The existing port and its two adapters |
| Edges | Imports node:fs/promises, node:path, and project-scan-exclusions.ts (that module has no imports today). Does not import index.ts. |
| Exports | FileSystem, nodeFileSystem, createMemoryFileSystem remain on the root barrel |
| Tests | The large set that calls createMemoryFileSystem and nodeFileSystem. Run the adoption, doctor, and Approved Apply suites, not a new behavior test. |
| Guards | Preserve symlink skip, binary skip, depth 32, and the 10,000 file cap. |
| SLOC | About 120 lines leave index.ts. |
| Why second | Unblocks later modules so they can take a filesystem without importing the barrel. |
| Implementation | Merged as PR #559 (762f979890f90a8064de756cd038195bb49646ef). FileSystem, nodeFileSystem, and createMemoryFileSystem stay on the application root as explicit re-exports. |
P1D — pure path checks
| Source | secretLikePath, inside, and projectRelativePaths |
| Target | packages/application/src/project-path.ts |
| Moved responsibility | Path traversal rejection and secret-like path filtering |
| Edges | node:path and the existing relative-path helper only |
| Exports | Internal. index.ts imports them. Do not add new public names. |
| Tests | tests/project-inspection.test.ts and the adoption/sync tests that already cover traversal and symlink roots |
| Guards | The check text and the thrown error string stay. |
| SLOC | Under 40 lines moved. |
| Risk | Security-sensitive but pure. Do not "improve" the prefix check in the same PR. |
| Implementation | Merged as PR #560 (7713318aa0390cad0ecb2e0313422ba0f66ae6bb). The three functions stay internal. index.ts imports them and does not export them. The lexical containment check and path traversal: error stay. |
P1E — retarget FileSystem imports off the barrel, by family
One family per PR: engineering-quality, foundation, inception, adoption, extension, harness, feature-intent, bounded-execution, continuous-loop. Each PR changes import sites from ./index.js to ./host-file-system.js only where the imported names are the port. This removes the quality ↔ root cycle once quality no longer needs the barrel for FileSystem. It does not move feature files yet.
P1E.1 — engineering quality
Merged as PR #561 (d64eebadf099019c26cb806a3f814de8ace1d7c5). P1E.2 is the following subsection.
FileSystem and nodeFileSystem in surface.ts, cli-specialized-packs.ts, cli-specialized-packs-external.ts, and specialized-pack-external-apply.ts now import ../host-file-system.js. FileSystem stays type-only. assertCanonicalProjectRoot and ProjectRootError stay on ../index.js in specialized-pack-external-apply.ts. No feature files moved. The application root still exports FileSystem, nodeFileSystem, and createMemoryFileSystem.
Recomputed on this baseline, the five import-edge components recorded in section 5 are unchanged, and engineering quality is not a member of them. Counting export … from as an edge, index.ts and engineering quality share one component. That component shrank from 45 files to 42. surface.ts, cli-specialized-packs.ts, and cli-commands.ts left it. It remains because specialized-pack-external-apply.ts still imports the root for assertCanonicalProjectRoot and ProjectRootError, and cli-specialized-packs-external.ts plus specialized-pack-external-viewmodel.ts still reach that module. Removing it would retarget those non-port imports. That is a later slice. host-file-system.ts still imports only project-scan-exclusions.ts.
P1E.2 — foundation
Merged as PR #574 (7596ebd156661d245eb3c7d84375ba828de10bab). The measurement below is the P1E.2 baseline and is not restated as the post-P1E.4 graph.
The 33 foundation*.ts modules do not import FileSystem, nodeFileSystem, or createMemoryFileSystem from ./index.js or from ./host-file-system.js. No Foundation source moved. The application root still exports those three names.
Import edges alone still form the five components in section 5. Foundation is in the workshop trio and the scaffold viewmodel pair. Counting export … from, the 42-file component that contains index.ts also contains foundation-flow.ts. That barrel re-exports the existing-project, feature-intent, bounded-execution, and continuous-loop families, and those families still import the port from the root. The root reaches foundation-flow.ts through inception-flow.ts. Removing foundation-flow.ts from that component would retarget other families. That is a later slice. No component grew.
P1E.3 — inception
Already satisfied on main at 7596ebd156661d245eb3c7d84375ba828de10bab. No PR.
The 19 inception*.ts modules do not import FileSystem, nodeFileSystem, or createMemoryFileSystem. No inception source moved. The application root still exports those three names.
P1E.4 — adoption
Merged as PR #575 (55f1ea362a359424e603764d9ec969535747851a).
Twelve existing-project Adoption modules imported the filesystem port from ./index.js (13 import sites). Those symbols now import ./host-file-system.js. FileSystem stays type-only except where nodeFileSystem or createMemoryFileSystem is a value. adoptProject, syncProject, inspectProject, doctorProject, diffProject, planProjectAdoption, ProjectMapping, InitOptions, and TransactionOptions stay on ./index.js. No Adoption source moved. The application root still exports FileSystem, nodeFileSystem, and createMemoryFileSystem.
harness-adoption-gate.ts is the harness family and does not import the port. propose-and-apply-extension-adoption.ts is the extension family. approved-apply-baseline.ts, approved-apply-engine.ts, and generated-file-sync-declared.ts stay on the Approved Apply cycle. project-root-mutation-lock.ts stays shared transaction infrastructure.
Recomputed on this branch, the five import-edge components are unchanged. Counting export … from, the component that contains index.ts shrank from 42 files to 40. existing-project-adoption-project-fingerprint.ts and existing-project-fixtures.ts left it because the port was their only root import. No file joined a component. host-file-system.ts still imports only project-scan-exclusions.ts.
P1E.5 — extension
Already satisfied on main at 55f1ea362a359424e603764d9ec969535747851a. No PR.
The 13 extension modules under packages/application/src/ do not import FileSystem, nodeFileSystem, or createMemoryFileSystem. That set is apply-extension-update.ts, discover-and-apply-extension-update.ts, extension-health.ts, extension-health-evaluator.ts, extension-health-runtime.ts, extension-lock-path.ts, extension-removal-files.ts, extension-sandbox.ts, extension-update-files.ts, inspect-extension-manifest.ts, preview-extension-removal.ts, propose-and-apply-extension-adoption.ts, and remove-extension.ts. No extension source moved. The application root still exports those three names.
P1E.6 — harness
Merged as PR #576 (0d4159b9623e65a5236ce8a9c7c225331765df83).
harness-benchmark-sample.ts imported createMemoryFileSystem and FileSystem from ./index.js, in the same declaration as synchronizeGeneratedFiles. The port symbols now import ./host-file-system.js. FileSystem stays type-only. createMemoryFileSystem stays a value. synchronizeGeneratedFiles stays on ./index.js. No Harness source moved. The application root still exports FileSystem, nodeFileSystem, and createMemoryFileSystem.
The audited Harness set is the 16 harness*.ts modules plus external-skill-import.ts. Only harness-benchmark-sample.ts imported the port. Harness filesystem-port imports through the application root went from 1 site to 0. Direct host-file-system.ts imports in that family went from 0 to 1. Application-wide root filesystem-port import sites went from 58 to 57.
Recomputed on this branch, import edges alone still form the five components in section 5. Harness is not a member of them. Counting export … from, there are still six components. The component that contains index.ts stays at 40 files. harness.ts, harness-benchmark.ts, and harness-benchmark-sample.ts remain in it because synchronizeGeneratedFiles is still imported from the root. No file joined. host-file-system.ts still imports only project-scan-exclusions.ts.
P1E.7 — feature intent
Merged as PR #577 (5db19ba962882ca2bd1bd0b36195564d9d3d13c0). P1E.8 is the following subsection.
Five Feature Intent import declarations in four modules imported the filesystem port from ./index.js. Those symbols now import ./host-file-system.js. FileSystem stays type-only. nodeFileSystem and createMemoryFileSystem stay values. No declaration mixed the port with a non-port name. No Feature Intent source moved. The application root still exports FileSystem, nodeFileSystem, and createMemoryFileSystem.
The audited set is the nine feature-intent*.ts modules plus task-routing.ts and skill-markdown.ts. Those two companions, plus feature-intent-create.ts, feature-intent-impact.ts, feature-intent-plan.ts, feature-intent-workspace-viewmodel.ts, and feature-intent-w10.ts, do not import the port. planFeature stays in index.ts. bounded-execution-workspace.ts still imports FileSystem from the root. That module is bounded execution.
Feature Intent filesystem-port imports through the application root went from 5 sites to 0. Direct host-file-system.ts imports in that family went from 0 to 5. Application-wide root filesystem-port import sites went from 57 to 52.
Recomputed on this branch, import edges alone still form the five components in section 5. Feature Intent is not a member of them. Counting export … from, there are still six components. The component that contains index.ts shrank from 40 files to 35. feature-intent-fixtures.ts, feature-intent-scope.ts, feature-intent-w10.ts, feature-intent-workspace.ts, and feature-intent-workspace-cli.ts left it. No file joined. host-file-system.ts still imports only project-scan-exclusions.ts. The Approved Apply cycle, the foundation and inception pairs, and the recorded Neutron mutation cycle are unchanged.
P1E.8 — bounded execution
Merged as PR #578 (3700abeadca7dc3274a4529058a7dc6c560b0cc2). P1E.9 is the following subsection.
Five Bounded Execution import declarations in four modules imported the filesystem port from ./index.js. Those symbols now import ./host-file-system.js. FileSystem stays type-only. nodeFileSystem and createMemoryFileSystem stay values. No declaration mixed the port with a non-port name. No Bounded Execution source moved. The application root still exports FileSystem, nodeFileSystem, and createMemoryFileSystem.
The audited set is the nine bounded-execution*.ts modules. bounded-execution-capability.ts, bounded-execution-task.ts, bounded-execution-verify.ts, bounded-execution-workspace-viewmodel.ts, and bounded-execution-w11.ts do not import the port. bounded-execution-apply.ts still imports executeApprovedApplyPlan from approved-apply-engine.ts. That edge is Approved Apply, not the port.
Bounded Execution filesystem-port imports through the application root went from 5 sites to 0. Direct host-file-system.ts imports in that family went from 0 to 5. Application-wide root filesystem-port import sites went from 52 to 47.
Recomputed on this branch, import edges alone still form the five components in section 5. Bounded Execution is not a member of them. Counting export … from, there are still six components. The component that contains index.ts shrank from 35 files to 34. bounded-execution-fixtures.ts left it. bounded-execution-apply.ts, bounded-execution-workspace.ts, bounded-execution-workspace-cli.ts, and bounded-execution-w11.ts remain because apply still imports the Approved Apply engine. No file joined. host-file-system.ts still imports only project-scan-exclusions.ts. The Approved Apply cycle, the foundation and inception pairs, the extension update cycle, and the recorded Neutron mutation cycle are unchanged.
P1E.9 — continuous loop
Merged as PR #579 (6742cd3be1c61d79301b8a13cb3dec13ef044064). P1E is complete.
Five Continuous Loop import declarations in four modules imported the filesystem port from ./index.js. Those symbols now import ./host-file-system.js. FileSystem stays type-only. nodeFileSystem and createMemoryFileSystem stay values. No declaration mixed the port with a non-port name. No Continuous Loop source moved. The application root still exports FileSystem, nodeFileSystem, and createMemoryFileSystem.
The audited set is the seven continuous-loop*.ts modules. continuous-loop-compare.ts and continuous-loop-workspace-viewmodel.ts do not import the port. continuous-loop-w12.ts only re-exports the family. No Continuous Loop module declares a separate FileSystem contract. There is no @intentloom/application path alias. The only root resolution for these symbols was ./index.js.
Continuous Loop filesystem-port imports through the application root went from 5 sites to 0. Direct host-file-system.ts imports in that family went from 0 to 5. Application-wide root filesystem-port import sites went from 47 to 42.
Recomputed on this branch, import edges alone still form the five components in section 5. Continuous Loop is not a member of them. Counting export … from, there are still six components. The component that contains index.ts shrank from 34 files to 29. continuous-loop-apply.ts, continuous-loop-fixtures.ts, continuous-loop-w12.ts, continuous-loop-workspace.ts, and continuous-loop-workspace-cli.ts left it. Compare and the workspace viewmodel were already outside it. No file joined. host-file-system.ts still imports only project-scan-exclusions.ts. The Approved Apply cycle, the foundation and inception pairs, the extension update cycle, and the recorded Neutron mutation cycle are unchanged.
P1F — directory moves of families that are already split
Order, one family per PR, after P1E for that family: feature-intent, harness, extension inspection (not apply), engineering-assessment (only if a consumer change is actually needed; the directory already exists), bounded-execution read side, continuous-loop read side, foundation files that are outside the two cycles, inception files outside the viewmodel cycle.
Each PR lists the exact files in its body. Expected import updates are the family's own relative imports plus barrel re-exports. No behavior edits.
P1F.1 — feature intent
Merged as PR #580 (2451dc01faac9c12ece874c13bf3fe1918e86f9f). P1F.2 is the following subsection.
Nine Feature Intent modules moved from packages/application/src/ into packages/application/src/feature-intent/ with their filenames unchanged: feature-intent-create.ts, feature-intent-fixtures.ts, feature-intent-impact.ts, feature-intent-plan.ts, feature-intent-scope.ts, feature-intent-w10.ts, feature-intent-workspace.ts, feature-intent-workspace-cli.ts, and feature-intent-workspace-viewmodel.ts. planFeature stays in index.ts. Public names still leave the application root through foundation-flow.ts re-exporting feature-intent/feature-intent-w10.ts.
Retained at packages/application/src/: task-routing.ts and skill-markdown.ts. Feature Intent does not import either file. task-routing.ts is re-exported by the application root, and protocol and validator keep their own task-routing modules. skill-markdown.ts is imported by parseSkillProgressive in index.ts.
Import-only cycles stay the five components in section 5. Feature Intent is not a member of them. Counting export … from, there are still six components. The component that contains index.ts stays at 29 files. No file joined or left because of the directory move. host-file-system.ts still imports only project-scan-exclusions.ts. The Approved Apply cycle, the foundation and inception pairs, the extension update cycle, and the recorded Neutron mutation cycle are unchanged. Feature Intent still does not import the filesystem port through index.ts.
P1F.2 — harness
Merged as PR #581 (e44f24fe282a186d662ee8b71cfa16cecd37bc05). P1F.3 is the following subsection.
Sixteen Harness modules moved from packages/application/src/ into packages/application/src/harness/ with their filenames unchanged: harness.ts, harness-adoption-gate.ts, harness-agent.ts, harness-agent-fake.ts, harness-agent-result.ts, harness-benchmark.ts, harness-benchmark-fixtures.ts, harness-benchmark-sample.ts, harness-comparison.ts, harness-runner.ts, harness-sandbox.ts, harness-scenarios.ts, harness-state.ts, harness-surfaces.ts, harness-voting.ts, and harness-voting-metrics.ts. Public names still leave the application root. index.ts re-exports harness/harness-adoption-gate.ts and harness/harness.ts. harness.ts still re-exports the other Harness modules except the adoption gate, which stays a direct root re-export.
Retained at packages/application/src/: external-skill-import.ts. No Harness module imports it. It normalizes external skill import requests and is re-exported by the application root. Protocol and validator keep their own external-skill-import modules. synchronizeGeneratedFiles stays in index.ts. harness-benchmark-sample.ts still imports that function from ../index.js, and still imports createMemoryFileSystem and FileSystem from ../host-file-system.js. FileSystem stays type-only.
Import-only cycles stay the five components in section 5. Harness is not a member of them. Counting export … from, there are still six components. The component that contains index.ts stays at 29 files and still contains harness/harness.ts, harness/harness-benchmark.ts, and harness/harness-benchmark-sample.ts because synchronizeGeneratedFiles is still imported from the root. No file joined or left. Path changes are not cycle elimination. host-file-system.ts still imports only project-scan-exclusions.ts. The Approved Apply cycle, the foundation and inception pairs, the extension update cycle, and the recorded Neutron mutation cycle are unchanged. Harness still does not import the filesystem port through index.ts.
harness-benchmark-sample.ts grew from 189/205 effective/physical lines to 192/208 because the longer ../host-file-system.js import wrapped. No other moved file changed size.
P1F.3 — extension inspection
Merged as PR #582 (14e86cd85292ba7e0fa4854824cdade14835d2e4). P1F.4 is the following subsection.
Five Extension Inspection modules moved from packages/application/src/ into packages/application/src/extension-inspection/ with their filenames unchanged: inspect-extension-manifest.ts, extension-health.ts, extension-health-evaluator.ts, extension-health-runtime.ts, and extension-sandbox.ts. inspectExtensionManifest still validates a manifest through @intentloom/validator and does not install an extension. Health evaluation still reads the lockfile and evidence. It does not update or remove an extension. Public names still leave the application root. index.ts imports extension-inspection/extension-health.ts and re-exports extension-inspection/inspect-extension-manifest.ts. That barrel still re-exports remove-extension.ts at the application root. The removal module did not move.
Retained at packages/application/src/: extension-lock-path.ts, propose-and-apply-extension-adoption.ts, discover-and-apply-extension-update.ts, apply-extension-update.ts, extension-update-files.ts, extension-removal-files.ts, preview-extension-removal.ts, and remove-extension.ts. extension-lock-path.ts is shared lock-path infrastructure. Health imports extensionLockRelativePath from it, and engineering-quality apply and health modules import it too. The other retained files own adoption, update, removal, and transaction file changes. The task does not authorize moving them.
Import-only cycles stay the five components in section 5. Extension Inspection is not a member of them. Counting export … from, there are still six components. The component that contains index.ts stays at 29 files. The extension update component stays these four files: propose-and-apply-extension-adoption.ts, discover-and-apply-extension-update.ts, apply-extension-update.ts, and extension-update-files.ts. No file joined or left. Path changes are not cycle elimination. host-file-system.ts still imports only project-scan-exclusions.ts. The Approved Apply cycle, the foundation and inception pairs, and the recorded Neutron mutation cycle are unchanged.
Moved production files stayed at their previous effective/physical counts: inspect-extension-manifest.ts 27/32, extension-health.ts 155/163, extension-health-evaluator.ts 106/112, extension-health-runtime.ts 199/206, and extension-sandbox.ts 127/139.
P1F.4 — engineering assessment
Already satisfied. No pull request. The Engineering Assessment modules already live under packages/application/src/engineering-assessment/. engineering-assessment.ts at the application root remains the package subpath barrel. No consumer path change was required, so this slice did not move source.
P1F.5 — bounded execution read side
Merged as PR #583 (e14a5b67bf342e06ae83a55010acf76327e8a0f3). P1F.6 is the following subsection.
Two read-side modules moved from packages/application/src/ into packages/application/src/bounded-execution/ with their filenames unchanged: bounded-execution-verify.ts and bounded-execution-workspace-viewmodel.ts. Verification is a pure path and architecture projection. It does not read the filesystem, grant a capability, execute a task, or call Approved Apply. The viewmodel only copies an existing workspace overview into a client surface and renders text. Public names still leave the application root. foundation-flow.ts re-exports bounded-execution-w11.ts, and that barrel re-exports the moved files.
Retained at packages/application/src/: bounded-execution-capability.ts, bounded-execution-task.ts, bounded-execution-apply.ts, bounded-execution-fixtures.ts, bounded-execution-workspace.ts, bounded-execution-workspace-cli.ts, and bounded-execution-w11.ts. Capability granting, task execution, Approved Apply, fixture loading, and workspace orchestration stay there. The workspace CLI can request apply. The W11 barrel re-exports those mutation-side modules, so it stays at the root. Fixtures read the catalog and build a memory filesystem that includes apply payloads, so they are not read-side.
Import-only cycles stay the five components in section 5. Bounded Execution is not a member of them. Counting export … from, there are still six components. The component that contains index.ts stays at 29 files and still contains bounded-execution-apply.ts, bounded-execution-workspace.ts, bounded-execution-workspace-cli.ts, and bounded-execution-w11.ts. The moved files were already outside that component. No file joined or left. Path changes are not cycle elimination. host-file-system.ts still imports only project-scan-exclusions.ts. The Approved Apply cycle, the foundation and inception pairs, the extension update cycle, and the recorded Neutron mutation cycle are unchanged.
Moved production files stayed at their previous effective/physical counts: bounded-execution-verify.ts 56/57 and bounded-execution-workspace-viewmodel.ts 97/101.
P1F.6 — continuous loop read side
Merged as PR #584 (6d94862b58046a5126048fc8dea1ffd60e882fb9). P1F.7 is the following subsection.
Two read-side modules moved from packages/application/src/ into packages/application/src/continuous-loop/ with their filenames unchanged: continuous-loop-compare.ts and continuous-loop-workspace-viewmodel.ts. Comparison is a pure snapshot transformation. It does not read the filesystem, execute a task, approve Apply, or write memory. The viewmodel only copies an existing workspace overview into a client surface and renders text. Public names still leave the application root. foundation-flow.ts re-exports continuous-loop-w12.ts, and that barrel re-exports the moved files.
Retained at packages/application/src/: continuous-loop-apply.ts, continuous-loop-fixtures.ts, continuous-loop-workspace.ts, continuous-loop-workspace-cli.ts, and continuous-loop-w12.ts. Apply writes persistent memory after the memory approval token. Workspace preparation calls that apply path and sets the loop gate. The workspace CLI can request execute. Fixtures read the catalog and build a memory filesystem that includes apply payloads, so they are not read-side. The W12 barrel re-exports both sides, so it stays at the root. draftLoopMemoryProposal is a pure helper inside the apply module and stays there.
Import-only cycles stay the five components in section 5. Continuous Loop is not a member of them. Counting export … from, there are still six components. The component that contains index.ts stays at 29 files. The moved files were already outside that component. No file joined or left. Path changes are not cycle elimination. host-file-system.ts still imports only project-scan-exclusions.ts. The Approved Apply cycle, the foundation and inception pairs, the extension update cycle, and the recorded Neutron mutation cycle are unchanged.
Moved production files stayed at their previous effective/physical counts: continuous-loop-compare.ts 52/55 and continuous-loop-workspace-viewmodel.ts 75/79.
P1F.7 — foundation files outside the cycles
Merged as PR #585 (aff1dd52cd66f437e5a20b5b08a658af83b0e9a2). P1F.8 is the following subsection.
Twenty-six Foundation modules moved from packages/application/src/ into packages/application/src/foundation/ with their filenames unchanged: foundation-blueprint-client-viewmodel.ts, foundation-blueprint-store.ts, foundation-blueprint-viewmodel-renderers.ts, foundation-blueprint.ts, foundation-cli.ts, foundation-client-viewmodel.ts, foundation-discovery-client-viewmodel.ts, foundation-discovery-turn.ts, foundation-discovery-viewmodel-renderers.ts, foundation-fixtures.ts, foundation-readiness.ts, foundation-scaffold-apply-revalidation.ts, foundation-scaffold-apply-store.ts, foundation-scaffold-apply.ts, foundation-scaffold-cli.ts, foundation-scaffold-store.ts, foundation-scaffold-viewmodel-renderers.ts, foundation-scaffold.ts, foundation-viewmodel-renderers.ts, foundation-w2.ts, foundation-w3.ts, foundation-w4.ts, foundation-w6.ts, foundation-w7.ts, foundation-workshop-defaults.ts, and foundation-workshop-store.ts. Public names still leave the application root. index.ts re-exports inception-flow.ts, and that barrel re-exports foundation-flow.ts.
Retained at packages/application/src/: foundation-discovery.ts, foundation-viewmodel.ts, and foundation-workshop.ts (the workshop import cycle); foundation-scaffold-client-viewmodel.ts and foundation-scaffold-workspace-viewmodel.ts (the scaffold viewmodel import cycle); foundation-w8.ts; and foundation-flow.ts. foundation-w8.ts is the one-line re-export of the retained scaffold workspace viewmodel, so it stays beside that cycle member. The flow file re-exports existing-project, feature-intent, bounded-execution, and continuous-loop as well as Foundation, so it stays at the root. foundation-cli.ts and the viewmodel renderers remain application modules inside the Foundation directory. Scaffold apply still calls the inception scaffold applier. Revalidation still checks the approved blueprint, workshop, template version, and scaffold diff. foundation-fixtures.ts still reads its catalog from process.cwd(). No Foundation module imports FileSystem, nodeFileSystem, or createMemoryFileSystem.
Import-only cycles stay the five components in section 5. Counting export … from, there are still six components. The component that contains index.ts stays at 29 files and still contains foundation-flow.ts. The moved files were already outside every component. No file joined or left. Path changes are not cycle elimination. host-file-system.ts still imports only project-scan-exclusions.ts. The Approved Apply cycle, the foundation workshop and scaffold-viewmodel cycles, the inception pair, the extension update cycle, and the recorded Neutron mutation cycle are unchanged.
Moved production files stayed at their previous effective/physical counts. The largest moved file remains foundation-blueprint.ts at 292/314. Retained foundation-workshop.ts stays at 245/266.
P1F.8 — inception files outside the viewmodel cycle
Merged as PR #586 (d647c6ec25b21e758fa83ae04d6a31b75bc94ecb). P1G.1 is the following subsection.
Sixteen Inception modules moved from packages/application/src/ into packages/application/src/inception/ with their filenames unchanged: inception-actions.ts, inception-approval.ts, inception-blueprint.ts, inception-cli.ts, inception-client-viewmodel.ts, inception-discovery.ts, inception-fixtures.ts, inception-package-name.ts, inception-scaffold-apply.ts, inception-scaffold-planner.ts, inception-session-store.ts, inception-templates.ts, inception-viewmodel-renderers.ts, inception-w1.ts, inception-workspace-scaffold-files.ts, and inception-workspace-scaffold-validation.ts. Public names still leave the application root. index.ts re-exports inception.ts and inception-flow.ts from the application root, and re-exports the moved discovery, blueprint, approval, scaffold planner, scaffold apply, actions, and templates modules from inception/. inception-flow.ts re-exports inception/inception-w1.ts.
Retained at packages/application/src/: inception.ts and inception-viewmodel.ts (the viewmodel import cycle), and inception-flow.ts. The flow barrel re-exports foundation-flow.ts, so it stays at the root with the 29-file re-export component that contains index.ts. Scaffold apply still writes through the caller supplied file writer and rolls partial writes back from the same backup records. The planner, workspace file templates, and workspace validation keep their existing functions. No Inception module imports FileSystem, nodeFileSystem, or createMemoryFileSystem. inception-fixtures.ts still reads its catalog from process.cwd().
Import-only cycles stay the five components in section 5. Counting export … from, there are still six components. The component that contains index.ts stays at 29 files and still contains inception-flow.ts. The moved files were already outside every component. No file joined or left. Path changes are not cycle elimination. host-file-system.ts still imports only project-scan-exclusions.ts. The Approved Apply cycle, the foundation workshop and scaffold-viewmodel cycles, the inception pair, the extension update cycle, and the recorded Neutron mutation cycle are unchanged.
Moved production files stayed at their previous effective/physical counts. The largest moved file remains inception-workspace-scaffold-files.ts at 269/276. Retained inception.ts stays at 279/309 and inception-flow.ts stays at 201/227.
P1G — break the small cycles by import direction
- Inception: make the viewmodel import a types/module that
inception.tsdoes not import back. - Foundation scaffold viewmodels: same pattern.
- Foundation workshop / discovery / viewmodel: same pattern.
No new interfaces. Move a type or a pure function to a third file that both sides may import.
P1G.1 — inception viewmodel cycle
Merged as PR #587 (a6234a4d20c208a34be301b468f2d3774640b1a9).
InceptionSummary moved from packages/application/src/inception.ts into packages/application/src/inception/inception-summary-types.ts. The declaration is unchanged. inception.ts imports that type and re-exports it with export type, so @intentloom/application still exposes InceptionSummary through export * from "./inception.js". inception-viewmodel.ts imports the type from the shared module and no longer imports inception.ts. The shared module imports neither cycle member and has no runtime dependency. inception.ts still imports the viewmodel builders. That edge is one-way.
Before this slice, import-only cycles were five components with sizes 3, 3, 3, 2, 2. The size-2 inception component was inception.ts and inception-viewmodel.ts. After this slice, import-only cycles are four components with sizes 3, 3, 3, 2. Counting export … from, cycles were six components with sizes 29, 4, 3, 3, 2, 2. They are now five components with sizes 29, 4, 3, 3, 2. The component that contains index.ts stays at 29 files and still contains inception-flow.ts. The Approved Apply cycle, both Foundation cycles, the extension update component, and the recorded Neutron mutation cycle are unchanged. host-file-system.ts still imports only project-scan-exclusions.ts. No package export-map key was added or removed.
inception.ts and inception-viewmodel.ts stay at the application root. Session creation, answer recording, summaries, and the viewmodel builders keep their existing functions.
P1G.2 — foundation scaffold viewmodel cycle
Merged as PR #588 (6bbfb988ee6f4f4b686d60e7ffd3a26ecc2b3103). P1G.3 is not part of that merge.
FoundationScaffoldFileRow moved from packages/application/src/foundation-scaffold-client-viewmodel.ts into packages/application/src/foundation/foundation-scaffold-file-row-types.ts. The declaration is unchanged: path, action, and ownership: "managed" | "project-owned". The client viewmodel imports that type and re-exports it with export type, so @intentloom/application still exposes it through foundation-w6.ts → foundation-flow.ts → inception-flow.ts → index.ts. The workspace viewmodel imports the type from the shared module and no longer imports the client viewmodel. The shared module imports neither viewmodel and has no runtime dependency. The client viewmodel still imports buildFoundationScaffoldWorkspaceSection and re-exports FoundationScaffoldWorkspaceSection and FoundationScaffoldWorkspaceFileGroup. That edge is one-way.
Before this slice, import-only cycles were four components with sizes 3, 3, 3, 2. The size-2 component was foundation-scaffold-client-viewmodel.ts and foundation-scaffold-workspace-viewmodel.ts. After this slice, import-only cycles are three components with sizes 3, 3, 3: Approved Apply (approved-apply-baseline.ts, generated-file-sync-declared.ts, index.ts), Foundation workshop (foundation-discovery.ts, foundation-viewmodel.ts, foundation-workshop.ts), and the recorded Neutron mutation cycle. Counting export … from, cycles were five components with sizes 29, 4, 3, 3, 2. They are now four components with sizes 29, 4, 3, 3. The component that contains index.ts stays at 29 files and still contains inception-flow.ts. The extension update component stays the four files apply-extension-update.ts, discover-and-apply-extension-update.ts, extension-update-files.ts, and propose-and-apply-extension-adoption.ts. The inception pair does not return. host-file-system.ts still imports only project-scan-exclusions.ts. No package export-map key was added or removed. The shared module is not a new public entry.
Both viewmodels stay at the application root. Prepare, compare, validate, apply, and rollback builders keep their existing functions. Workspace grouping, pnpm-workspace topology, hasNx, template matching, and file ownership mapping are unchanged. P1H, P1I, and P1J are not started.
P1G.3 — foundation workshop, discovery, and viewmodel cycle
Design approved and merged as PR #591 (454cd7736abe37fe1f2e39c472f8e6a7e0d3d0e3). The approved contract is docs/designs/p1g3-foundation-workshop-cycle/SYSTEM_DESIGN.md. Implementation is merged as PR #596 (488067af1d39a614e718660944c7f3ae030b1be7). P1H.1 design is merged as PR #597 (eeda24d7bfba504d5ea6c7a781a6a054117a8a15). Implementation is merged as PR #598 (5f7917c1cef0997f6947932aa2f8f4186ac2decc). P1H.2 design is merged as PR #599 (ff7cb79329f403220aa4b369eede4cb8f06e591b). Implementation is merged as PR #600 (efce5db2b40d1f350df43d38b4b97d1ccd5c2736). P1H.3 design is merged as PR #601 (6b387a34c221f967a15ef670d53bea9b76e40828). P1H.3a catalog read is merged as PR #602 (460b81efd1e81f5b24a22e11d3af4680c8f28aad). P1H.3b proposal store and evaluation is merged as PR #603 (f116d199a0783870806e8c8660d90385c106f8e1). P1H.3c skill mutation and procedural memory is merged as PR #604 (911b229af00fcde54d8861af83a56e7e61df0902). P1I, P1J, Undo U4, and Desktop Undo U5 are not started.
FoundationUnderstanding moved unchanged from packages/application/src/foundation-workshop.ts into packages/application/src/foundation/foundation-understanding-types.ts. That module has no imports. foundation-viewmodel.ts imports the type from there. foundation-workshop.ts imports it and re-exports it with export type, so @intentloom/application still exposes the type and does not gain a runtime value of that name.
getFoundationWorkshop moved unchanged into packages/application/src/foundation/foundation-workshop-lookup.ts. The lookup reads getFoundationWorkshopStoreEntry, throws unknown foundation workshop '<id>' when the entry is missing, and otherwise returns validateFoundationWorkshopState(entry). It imports the store, the validator, and the protocol state type. It does not import foundation-workshop.ts, foundation-discovery.ts, or foundation-viewmodel.ts. Discovery's two session-id functions import the lookup. foundation-workshop.ts imports the same function and re-exports it with export { getFoundationWorkshop }. Neither new file is added to foundation-w2.ts, foundation-w3.ts, or foundation-flow.ts.
Edges removed: foundation-discovery.ts → foundation-workshop.ts, and foundation-viewmodel.ts → foundation-workshop.ts. The workshop module still imports discovery and the viewmodel builders. Direct store reads stay rejected: the store getter does not throw and does not validate.
Before this slice, import-only cycles were three components with sizes 3, 3, 3. The Foundation component was foundation-discovery.ts, foundation-viewmodel.ts, and foundation-workshop.ts. After this slice, import-only cycles are two components, each of size 3: Approved Apply (approved-apply-baseline.ts, generated-file-sync-declared.ts, index.ts) and the recorded Neutron mutation cycle (neutron/mutation/apply/neutron-mutation-apply-durable-record.ts, neutron/mutation/apply/neutron-mutation-apply-store.ts, neutron/mutation/verification/neutron-mutation-verification-retry-eligibility.ts). Counting export … from, cycles were four components with sizes 29, 4, 3, 3. They are now three: the extension-update component (size 4), the existing 29-file component that contains index.ts and inception-flow.ts, and the Neutron component (size 3). The 29-file membership is unchanged. The P1G.1 and P1G.2 cycles do not return. host-file-system.ts is not in a component. No package export-map key was added or removed.
Public names, signatures, schema URNs, and the "." export path are unchanged. Unknown workshop ids still throw. Validator errors still propagate. The lookup does not register, update, delete, seed, or clear the workshop Map. Readiness writes stay in foundation-workshop.ts. No filesystem, network, or mutation entrypoint was added.
Focused Foundation, daemon, Desktop/TUI, and architecture tests: 17 files, 82 tests passed. That set includes the scaffold cycle lock, the inception cycle lock, and the foundation directory inventory. pnpm verify passed on this branch: typecheck, oxlint, Prettier, Vitest 354 files / 3074 passed / 3 skipped, build, and git diff --check. The three original modules stay at the application root.
P1H — index groups that become leaves after P1C
One group per PR, in this order: persistent memory, agent session, skill catalog and proposals, security findings and SARIF import, security policy and sandbox, continuous security audit, interactive workspace read model. Each new file imports host-file-system.ts and protocol/validator. If the extraction would still import index.ts, the slice is not ready; move the callee first.
applyWorkspaceProposal, applyProjectAdoption, adoptProject, doctorProject, and synchronizeGeneratedFiles are not in this list.
P1H.1 — persistent memory
Design approved and merged as PR #597 (eeda24d7bfba504d5ea6c7a781a6a054117a8a15). The approved contract is docs/designs/p1h1-persistent-memory/SYSTEM_DESIGN.md. Implementation is merged as PR #598 (5f7917c1cef0997f6947932aa2f8f4186ac2decc). P1H.2 design is merged as PR #599 (ff7cb79329f403220aa4b369eede4cb8f06e591b). Implementation is merged as PR #600 (efce5db2b40d1f350df43d38b4b97d1ccd5c2736). P1H.3 design is merged as PR #601 (6b387a34c221f967a15ef670d53bea9b76e40828). P1H.3a catalog read is merged as PR #602 (460b81efd1e81f5b24a22e11d3af4680c8f28aad). P1H.3b proposal store and evaluation is merged as PR #603 (f116d199a0783870806e8c8660d90385c106f8e1). P1H.3c skill mutation and procedural memory is merged as PR #604 (911b229af00fcde54d8861af83a56e7e61df0902). P1I, P1J, Undo U4, and Desktop Undo U5 are not started.
The twelve public operations moved unchanged out of packages/application/src/index.ts lines 4908–5257: getPersistentMemoryItem, listPersistentMemoryItems, proposePersistentMemory, acceptPersistentMemory, supersedePersistentMemory, forgetPersistentMemory, exportPersistentMemory, importPersistentMemory, searchPersistentMemory, rebuildPersistentMemoryIndex, clearPersistentMemoryIndex, and renderPersistentMemoryContext. The private helpers redactPersistentMemoryContent, persistentMemoryPath, and writePersistentMemoryItem moved with them. index.ts re-exports only the twelve public names. The helpers are not package-root exports.
memory/persistent-memory-store.ts owns redaction, path validation, item writing, get, and list. It measures 77 effective lines and 82 physical lines. memory/persistent-memory-lifecycle.ts owns propose, accept, supersede, forget, export, and import. It measures 200 effective lines and 206 physical lines. memory/persistent-memory-retrieval.ts owns search, render, rebuild, and clear. It measures 92 effective lines and 96 physical lines. There is no memory/index.ts and no new package export-map key.
Store imports the filesystem port, inside, and the protocol item validator. Lifecycle imports the store. Retrieval imports the store and inside. None of the three modules import index.ts.
index.ts measured 6,562 effective lines and 6,937 physical lines before the move. After the named re-exports it measures 6,244 effective lines and 6,605 physical lines. Both counts are below the grandfathered ceiling. docs/governance/quality-exceptions.json is unchanged.
Neutron N3 neutron-context-state-collectors.ts and N4 neutron-tool-dispatch.ts import searchPersistentMemory from memory/persistent-memory-retrieval.ts. Their other barrel imports stay. Tool names, maxItems limits, project restrictions, context assembly, read-only authorization, mutation governance, and session permissions are unchanged. CLI, daemon, MCP, and Desktop import paths stay on the package root.
Storage paths stay .aif/memory/items/<id>.json and .aif/memory/index.json. Schemas, JSON formatting, trailing newlines, redaction, lifecycle transitions, trust-class rules, approval evidence, import and export semantics, search ordering, and the best-effort supersede and import compensation stay as they were. canonical-intent and verified-evidence remain prohibited in proposals and imports. Search still returns only accepted items for the requested project and still ignores the derived index. applyContinuousLoopMemory is not routed through these operations and still writes with join.
Before and after, import-only components are two, each size 3: Approved Apply (approved-apply-baseline.ts, generated-file-sync-declared.ts, index.ts) and the recorded Neutron mutation cycle. Re-export components stay sizes 4, 29, and 3. The 29-file component that contains index.ts and inception-flow.ts has the same membership. The three new files are outside every component. host-file-system.ts stays outside every component. The locked cycle tests were not edited.
Focused tests: 7 files, 85 tests passed (tests/memory-security-m2.test.ts, tests/memory-security-m3.test.ts, tests/cli-memory.test.ts, tests/neutron-n4-memory-tool.test.ts, tests/neutron-n3-context-state.test.ts, tests/application-foundation-scaffold-cycle.test.ts, tests/application-inception-cycle.test.ts). No assertion was edited. pnpm verify passed: typecheck, oxlint, Prettier, Vitest 354 files / 3074 passed / 3 skipped, build, and git diff --check.
P1H.2 — agent session
Design approved and merged as PR #599 (ff7cb79329f403220aa4b369eede4cb8f06e591b). The approved contract is docs/designs/p1h2-agent-session/SYSTEM_DESIGN.md. Implementation is merged as PR #600 (efce5db2b40d1f350df43d38b4b97d1ccd5c2736). P1I, P1J, Undo U4, and Desktop Undo U5 are not started.
The six public operations moved unchanged out of packages/application/src/index.ts lines 4927–5098: startAgentSession, getAgentSession, listAgentSessions, closeAgentSession, deleteAgentSession, and exportAgentSession. The private helper sessionFilePath moved with them and stays unexported. index.ts imports the six names so getInteractiveWorkspaceState can still call listAgentSessions, and it re-exports those six names. It does not re-export the helper. There is no agent-session/index.ts and no new package export-map key. docs/governance/quality-exceptions.json is unchanged. The locked cycle tests were not edited.
agent-session/agent-session.ts owns the helper and the six operations. It measures 177 effective lines and 185 physical lines. It imports node:path (dirname, relative), host-file-system.ts, inside, secretLikePath, and the protocol session types and validators. It does not import index.ts, the CLI, the daemon, the MCP server, or Desktop.
index.ts measured 6,244 effective lines and 6,605 physical lines before the move. After the named import and re-export it measures 6,093 effective lines and 6,448 physical lines. Effective lines match the design estimate. Physical lines are one above the 6,447 estimate because the import and named re-export is 17 lines rather than the estimated 16. Both counts are below the previous barrel and below the grandfathered ceiling. startAgentSession remains 47 effective lines.
Session storage stays .aif/memory/sessions/<sessionId>.json. Generated ids stay session-${Date.now()}. Missing, invalid JSON, and validator-rejected reads still return null. Close still allows closed, compacted, and archived, appends redacted outcomes and decisions, and writes pretty JSON with a trailing newline. Delete of a missing file stays a no-op. Export still uses the caller projectId and writes only when targetPath is present. Session summaries stay in index.ts and keep the same directory. The move does not add session-id rules, retention changes, metadata redaction, export authorization, or realpath checks.
Before and after, import-only components are two, each size 3: Approved Apply (approved-apply-baseline.ts, generated-file-sync-declared.ts, index.ts) and the recorded Neutron mutation cycle. Re-export components stay sizes 4, 29, and 3. The 29-file component that contains index.ts and inception-flow.ts has the same membership. The new file, host-file-system.ts, project-path.ts, and the three memory/persistent-memory-*.ts files are outside every component.
Focused tests: 7 files, 94 tests passed (tests/memory-security-m4.test.ts, tests/cli-session.test.ts, tests/interactive-ui.test.ts, tests/v1-client-surface-equivalence.test.ts, tests/v1-compatibility-contract.test.ts, tests/application-foundation-scaffold-cycle.test.ts, tests/application-inception-cycle.test.ts). Existing assertions were not rewritten. Nine cases were added to the M4 file for null reads, list order, summary skip, compacted close, export without a target, path traversal, and default trust and retention. pnpm verify passed: typecheck, oxlint, Prettier, Vitest 354 files / 3083 passed / 3 skipped, build, and git diff --check.
P1H.3 — skill catalog and proposals
Design is merged as PR #601 (6b387a34c221f967a15ef670d53bea9b76e40828). The approved contract is docs/designs/p1h3-skill-catalog-proposals/SYSTEM_DESIGN.md. P1H.3a catalog read is merged as PR #602 (460b81efd1e81f5b24a22e11d3af4680c8f28aad). P1H.3b proposal store and evaluation is merged as PR #603 (f116d199a0783870806e8c8660d90385c106f8e1). P1H.3c skill mutation and procedural memory is merged as PR #604 (911b229af00fcde54d8861af83a56e7e61df0902). P1H.3 is fully implemented. P1H.4 design is merged as PR #605 (6a9d0d26015caa857c19d0d22415904d832ad818). P1H.4a finding store and coverage is merged as PR #606 (ec951f32246ad0c94a145f520dc1862d9592c72e). P1H.4b SARIF import is merged as PR #607 (7a77db52753360f0029cd266d8c95eb78c34995c). P1H.4 is fully implemented. P1I, P1J, Undo U4, and Desktop Undo U5 have not started.
On efce5db2b40d1f350df43d38b4b97d1ccd5c2736, index.ts measures 6,093 effective lines and 6,448 physical lines. The family is lines 3464–4317 (777 effective, 854 physical): parseSkillProgressive, discoverSkills, getSkillAtLevel, createSkillProposal, listSkillProposals, getSkillProposal, updateSkillProposalState, rollbackSkill, evaluateSkillProposal, listSkillEvaluations, getSkillEvaluation, validateSkillExtensionLock, listProceduralMemorySummary, inspectProceduralMemory, prepareSkillMutationPlan, and applySkillMutationPlan. None of those functions calls another index.ts function. rankProceduralMemory stays in the barrel because it also calls getSemanticRankingConfig.
The proposed modules, all under packages/application/src/skills/ and all estimated under 250 effective lines, are skill-progressive-parse.ts, skill-discovery.ts, skill-proposal-store.ts, skill-evaluation.ts, skill-mutation.ts, and skill-procedural-memory.ts. There is no skills/index.ts and no new package export-map key. No new module imports index.ts. A simulated splice of the move, before Prettier, measures index.ts at 5,342 effective lines and 5,621 physical lines.
Import-only components stay two of size 3. Re-export components stay sizes 4, 29, and 3, with the membership locked by tests/application-inception-cycle.test.ts. The new files must stay outside every component, together with host-file-system.ts, the P1H.1 memory modules, and agent-session/agent-session.ts.
Skill proposal approval stays the approvalEvidence string on updateSkillProposalState. It is not Approved Apply and it is not sandbox evaluation. The design records the current trust fallback, unused catalogRoot, checksum, and rollback behavior as shortcomings to preserve. The approved implementation order is catalog read, then proposal store and evaluation, then mutation and the procedural-memory read model.
P1H.3a — catalog read
Implemented from the merged design, section 19 step 1, and merged as PR #602 (460b81efd1e81f5b24a22e11d3af4680c8f28aad). parseSkillProgressive moved to packages/application/src/skills/skill-progressive-parse.ts. discoverSkills and getSkillAtLevel moved to packages/application/src/skills/skill-discovery.ts. Discovery imports the parser directly. index.ts re-exports the three names and no longer imports skill-markdown.ts. Neutron neutron-context-collectors.ts imports discoverSkills from the discovery module and still imports getBoundedProjectContext and FileSystem from the barrel. No skills/index.ts was added. The package export map is unchanged. rankProceduralMemory and the other thirteen family operations stay in index.ts.
On this change, index.ts measures 5,795 effective lines and 6,119 physical lines, down 298 effective and 329 physical from 6,093 and 6,448. The design estimate was 5,798 and 6,122. The parser module measures 132 effective and 144 physical lines, matching its estimate. The discovery module measures 187 effective and 208 physical lines, one line above the 186 and 207 estimate. Both new files stay under the 250-line preference and the 400 / 700 hard limits. quality-exceptions.json is unchanged, and the grandfathered index.ts ceiling is not raised.
parseSkillProgressive remains 124 effective lines and discoverSkills remains 145. Both exceed the 80-line function hard limit. scripts/production-file-metrics.mjs checks file size only, so the move passes that check. The merged design, sections 2, 8, and 22, keeps both functions intact and records the debt here instead of adding a quality-exceptions.json entry. Owner: Application maintainers. Review trigger: the next behavior change to either function.
Import-only components stay two, each size 3: Approved Apply and the recorded Neutron mutation component. Re-export components stay sizes 4, 29, and 3, with the same membership. The new modules, host-file-system.ts, project-path.ts, skill-markdown.ts, the P1H.1 memory modules, and agent-session/agent-session.ts stay outside every component. The locked cycle tests were not edited.
Public signatures, defaults, discovery filters, ignored catalogRoot, getSkillAtLevel path precedence, and Neutron read-only assembly stay as they were. Focused coverage is tests/skill-catalog-read-p1h3a.test.ts plus the existing parser, discovery, CLI skill, Neutron context, and cycle suites: 8 files, 61 tests passed. Existing assertions were not rewritten. Local pnpm verify passed: typecheck, oxlint, Prettier, Vitest 355 files / 3088 passed / 3 skipped, build, and git diff --check. The implementation pull request is #602 and is merged as 460b81efd1e81f5b24a22e11d3af4680c8f28aad.
P1H.3b — proposal store and evaluation
Implemented from the merged design, section 19 step 2, on baseline 460b81efd1e81f5b24a22e11d3af4680c8f28aad (PR #602). This slice is merged as f116d199a0783870806e8c8660d90385c106f8e1.
createSkillProposal, listSkillProposals, and getSkillProposal moved to packages/application/src/skills/skill-proposal-store.ts. evaluateSkillProposal, listSkillEvaluations, and getSkillEvaluation moved to packages/application/src/skills/skill-evaluation.ts. Evaluation imports getSkillProposal from the store. The store does not import evaluation or index.ts. index.ts re-exports all six names and imports getSkillProposal, listSkillProposals, and listSkillEvaluations as local values because updateSkillProposalState, rollbackSkill, the procedural-memory reads, mutation planning, and rankProceduralMemory still call them. No skills/index.ts was added. The package export map is unchanged. updateSkillProposalState, rollbackSkill, validateSkillExtensionLock, listProceduralMemorySummary, inspectProceduralMemory, prepareSkillMutationPlan, applySkillMutationPlan, and rankProceduralMemory stay in index.ts at the end of this slice. P1H.3c moves those operations.
On this change, index.ts measures 5,575 effective lines and 5,881 physical lines, down 220 effective and 238 physical from 5,795 and 6,119. The store module measures 115 effective and 123 physical lines. The design estimate was 111 and 119. The evaluation module measures 135 effective and 147 physical lines. The design estimate was 132 and 144. Both new files stay under the 250-line preference and the 400 / 700 hard limits. quality-exceptions.json is unchanged.
Import-only components stay two, each size 3: Approved Apply and the recorded Neutron mutation component. Re-export components stay sizes 4, 29, and 3, with the same membership. The new modules, host-file-system.ts, the P1H.3a parser and discovery modules, the P1H.1 memory modules, and agent-session/agent-session.ts stay outside every component. The locked cycle tests were not edited.
Proposal paths stay .aif/memory/proposals/<id>.json. Evaluation paths stay .aif/memory/evaluations/<id>.json. Creation defaults, caller-supplied initial state, overwrite, corrupt-record skipping, list filters and ordering, the ignored caseId, the existing security-pattern heuristics, provenance, and pretty JSON with a trailing newline are unchanged. Approval still requires non-empty approvalEvidence and an eligible evaluation unless bypassEvaluationGate is set. Rollback behavior is unchanged.
Focused coverage is tests/skill-proposal-evaluation-p1h3b.test.ts plus the existing proposal, evaluation, memory, rank, and cycle suites: 11 files, 139 tests passed. Existing assertions were not rewritten. Local pnpm verify passed: typecheck, oxlint, Prettier, Vitest 356 files / 3096 passed / 3 skipped, build, and git diff --check. The implementation pull request is #603 (https://github.com/vitala89/Intentloom/pull/603) and is merged as f116d199a0783870806e8c8660d90385c106f8e1.
P1H.3c — mutation and procedural memory
Implemented from the merged design, section 19 step 3, on baseline f116d199a0783870806e8c8660d90385c106f8e1 (PR #603). This slice is merged as PR #604 (911b229af00fcde54d8861af83a56e7e61df0902). P1H.4 design is merged as PR #605 (6a9d0d26015caa857c19d0d22415904d832ad818). P1H.4a is merged as PR #606 (ec951f32246ad0c94a145f520dc1862d9592c72e). P1H.4b is merged as PR #607 (7a77db52753360f0029cd266d8c95eb78c34995c). P1H.4 is fully implemented.
updateSkillProposalState, rollbackSkill, prepareSkillMutationPlan, and applySkillMutationPlan moved to packages/application/src/skills/skill-mutation.ts. validateSkillExtensionLock, listProceduralMemorySummary, and inspectProceduralMemory moved to packages/application/src/skills/skill-procedural-memory.ts. Mutation imports the proposal store and the evaluation module. Procedural memory imports those same two modules and does not import mutation. The store does not import evaluation or mutation. Evaluation does not import mutation. No file under skills/ imports index.ts. index.ts re-exports all sixteen skill names. It keeps value imports of listSkillProposals and listSkillEvaluations because rankProceduralMemory still calls them beside getSemanticRankingConfig. No skills/index.ts was added. The package export map is unchanged. quality-exceptions.json is unchanged.
On this change, index.ts measures 5,339 effective lines and 5,620 physical lines, down 236 effective and 261 physical from 5,575 and 5,881. The design's full-move estimate was 5,342 and 5,621. The mutation module measures 181 effective and 197 physical lines. The design estimate was 176 and 192. The procedural-memory module measures 87 effective and 96 physical lines. The design estimate was 84 and 93. Both new files stay under the 250-line preference and the 400 / 700 hard limits.
Import-only components stay two, each size 3: Approved Apply and the recorded Neutron mutation component. Re-export components stay sizes 4, 29, and 3, with the same membership. The six skill modules, host-file-system.ts, the P1H.1 memory modules, and agent-session/agent-session.ts stay outside every component. The locked cycle tests were not edited.
Approval and activation still require non-empty approvalEvidence and an eligible latest evaluation unless bypassEvaluationGate is set. Rollback still sets rolled-back and does not restore a SKILL.md file. prepareSkillMutationPlan stays read-only and still hashes planId:action:proposalId:targetState:evidence. applySkillMutationPlan still validates the plan, then changes proposal state, then writes .aif/memory/mutations/<planId>.json. It still does not recompute the checksum or require the target state to match the action. A mutation-log write failure still leaves the updated proposal in place. The extension lock probe, summary counts, default pass rate of 100, and inspection issue messages are unchanged. rankProceduralMemory is unchanged.
Focused coverage is tests/skill-mutation-p1h3c.test.ts and tests/skill-procedural-memory-p1h3c.test.ts plus the existing proposal, evaluation, memory, rank, and cycle suites: 13 files, 150 tests passed. Existing assertions were not rewritten. Local pnpm verify passed: typecheck, oxlint, Prettier, Vitest 358 files / 3107 passed / 3 skipped, build, and git diff --check. The implementation pull request is #604 (https://github.com/vitala89/Intentloom/pull/604) and is merged as 911b229af00fcde54d8861af83a56e7e61df0902.
P1H.4 — security findings and SARIF import
Design is merged as PR #605 (https://github.com/vitala89/Intentloom/pull/605, 6a9d0d26015caa857c19d0d22415904d832ad818). The approved contract is docs/designs/p1h4-security-findings-sarif/SYSTEM_DESIGN.md. P1H.3 is fully implemented. P1H.4a finding store and coverage is merged as PR #606 (ec951f32246ad0c94a145f520dc1862d9592c72e). P1H.4b SARIF import is merged as PR #607 (7a77db52753360f0029cd266d8c95eb78c34995c). P1H.4 is fully implemented. P1H.5 design is merged as PR #608 (1d0611070b02c5e9f0f0e2816a0f560fbf18c18e). P1H.5a is merged as PR #609 (7589c6ccff5d79d1f8c6e5de34d2f521ea3caa6e). P1H.5b is merged as PR #610 (2c0749dce9a31976195277971d6fb35fe663cd31). P1H.5 is fully implemented. P1H.6 design is merged as PR #611 (https://github.com/vitala89/Intentloom/pull/611, 52b34c8b202cb07ab30c4f3e991dbce3815510a4). P1H.6 implementation is merged as PR #612 (https://github.com/vitala89/Intentloom/pull/612, b80614d5d65fbdbd9cbc4831a6593ead6b155280). P1H.6 is fully implemented. P1H.7 design is merged as PR #613 (017cb370cf4329a96d723cd83721acbb175f1827). P1H.7 implementation is merged as PR #614 (https://github.com/vitala89/Intentloom/pull/614, e07fddccbc771e415bc1d9056051edb9e00b4d58). P1H is complete. P1I.1 design is merged as PR #615 (8bc9e07c74beb701adaae9e30dacb6aec252b58f). Implementation is merged as PR #616 (https://github.com/vitala89/Intentloom/pull/616, b9201e9d480b34e453d08e1803f94e734d1e3f1f). P1I.1 is complete. P1I.2 design is merged as PR #617 (e3585e8eb5f4b58bb42482e249430654375dee5b). Implementation is merged as PR #618 (https://github.com/vitala89/Intentloom/pull/618, 1d8d55cbfd89792272d4d4c00512aa09465ed23d). P1I.2 is complete. P1I.3 design is merged as PR #620 (e93f6b9efdba11d1dd1cd98ed7072a801595320b). Implementation A, the adoption extraction, is merged as PR #621 (https://github.com/vitala89/Intentloom/pull/621, 527ab7f14fc199bc77d21c7e823b4cc2d5c3d926). Implementation B, the Approved Apply type-import retarget, is merged as PR #622 (https://github.com/vitala89/Intentloom/pull/622, d6b7d4955f2e58780c1ea2afe134f3217ad3fe86). P1I.3 is complete. Measured import-only cycles are the Neutron mutation trio only. Measured re-export cycles are sizes 4, 27, and 3. index.ts measured 1,878 effective lines and 2,034 physical lines before the P1J implementation. No runtime behavior changed. P1J design PR #623 is merged (https://github.com/vitala89/Intentloom/pull/623, 8a44e342f4001bbdc7d7196f66200269af0689b7). The design document keeps its design-stage proposal wording. The approved implementation decision is Option C and is open for review, not merged. Current measurements are in the P1J section. P1 is not complete. Undo U4 and Desktop Undo U5 have not started.
On 911b229af00fcde54d8861af83a56e7e61df0902, index.ts measures 5,339 effective lines and 5,620 physical lines. The selected family is lines 4115–4383 (247 effective, 269 physical): securityFindingPath, getSecurityFinding, listSecurityFindings, dismissSecurityFinding, acceptSecurityRisk, isObjectRecord, importSarifSecurityReport, and getSecurityCoverageReport.
The proposed modules, all under packages/application/src/security/ and all estimated under 250 effective lines, are security-finding-store.ts (113/118), sarif-security-import.ts (121/134), and security-coverage.ts (43/48). There is no security/index.ts and no new package export-map key. No new module imports index.ts. A simulated splice of the move, before Prettier, measures index.ts at 5,101 effective lines and 5,363 physical lines.
correlateSecurityFindings and runLocalSecurityAdapters stay in index.ts. Adapters import securityFindingPath from the store. Policy and baseline stay in index.ts and import listSecurityFindings. runContinuousSecurityAudit does not call the adapters. Coverage moves because it only aggregates the finding list.
importSarifSecurityReport remains 106 effective lines. The design keeps that function intact and records the 80-line function debt instead of editing quality-exceptions.json. SARIF ids stay sarif-finding-<counter> for one call. Repeated imports overwrite those files. A failure after the first write leaves the earlier file in place. Stored trust class stays verified-evidence. Those behaviors are preserved. Mitigations need a separate Design First review.
Import-only components stay two of size 3. Re-export components stay sizes 4, 29, and 3, with the membership locked by tests/application-inception-cycle.test.ts. The new files must stay outside every component, together with host-file-system.ts, the P1H.1 memory modules, agent-session/agent-session.ts, and the six skill modules.
The approved implementation order, if split, is the finding store and coverage, then SARIF import. One implementation PR is also allowed by the design. Neither starts P1H.5.
P1H.4a — finding store and coverage
Implemented from the merged design, section 20 stage P1H.4a, on baseline 6a9d0d26015caa857c19d0d22415904d832ad818 (PR #605). This slice is merged as PR #606 (ec951f32246ad0c94a145f520dc1862d9592c72e).
securityFindingPath, getSecurityFinding, listSecurityFindings, dismissSecurityFinding, and acceptSecurityRisk moved to packages/application/src/security/security-finding-store.ts. getSecurityCoverageReport moved to packages/application/src/security/security-coverage.ts. Coverage imports listSecurityFindings from the store. The path helper is a module export and is not a package-root export. index.ts re-exports the five public names. It keeps value imports of listSecurityFindings and securityFindingPath because importSarifSecurityReport, runLocalSecurityAdapters, updateSecurityBaseline, and checkSecurityPolicyAndBaseline still call them. No security/index.ts was added. The package export map is unchanged. quality-exceptions.json is unchanged.
On this change, index.ts measures 5,211 effective lines and 5,484 physical lines, down 128 effective and 136 physical from 5,339 and 5,620. The design's P1H.4a estimate was 5,209 and 5,483. The finding store measures 113 effective and 118 physical lines. The coverage module measures 43 effective and 48 physical lines. Both match the design's mechanical splice. Both new files stay under the 250-line preference and the 400 / 700 hard limits.
Import-only components stay two, each size 3: Approved Apply and the recorded Neutron mutation component. Re-export components stay sizes 4, 29, and 3, with the same membership. The two security modules, host-file-system.ts, project-path.ts, the P1H.1 memory modules, agent-session/agent-session.ts, and the six skill modules stay outside every component. The locked cycle tests were not edited.
Finding files stay at .aif/security/findings/<id>.json through inside. Missing, malformed, and validator-rejected reads still return null. Path traversal still throws before the read. Listing still uses fs.list(root), the findings prefix, localeCompare order, and exact severity and state filters. Dismissal and risk acceptance still write pretty JSON with a trailing newline, do not create parent directories, and leave the other metadata field in place. Coverage remains a derived read model. SARIF import, local adapters, policy, and baseline stay in index.ts and still see the stored findings. Known limitations, including partial SARIF writes, the verified-evidence label, restarting ids, and caller-supplied approvedBy, are unchanged.
Focused coverage is tests/security-finding-store-p1h4a.test.ts plus the existing security, CLI, Neutron read-only, and cycle suites: 8 files, 118 tests passed. Existing assertions were not rewritten. Local pnpm verify passed: typecheck, oxlint, Prettier, Vitest 359 files / 3115 passed / 3 skipped, build, and git diff --check. The implementation pull request is #606 (https://github.com/vitala89/Intentloom/pull/606) and is merged as ec951f32246ad0c94a145f520dc1862d9592c72e.
P1H.4b — SARIF import
Implemented from the merged design, section 20 stage P1H.4b, on baseline ec951f32246ad0c94a145f520dc1862d9592c72e (PR #606). This slice is merged as PR #607 (7a77db52753360f0029cd266d8c95eb78c34995c). P1H.4 is fully implemented. P1H.5 design is proposed as PR #608 and is not approved.
isObjectRecord and importSarifSecurityReport moved to packages/application/src/security/sarif-security-import.ts. The helper stays private to that module and is not a package-root export. The importer imports securityFindingPath from the finding store. It does not import index.ts. The finding store does not import the SARIF module. index.ts re-exports importSarifSecurityReport and does not keep a local value import of it. The value imports of listSecurityFindings and securityFindingPath remain for runLocalSecurityAdapters, updateSecurityBaseline, and checkSecurityPolicyAndBaseline. No security/index.ts was added. The package export map is unchanged. quality-exceptions.json is unchanged.
On this change, index.ts measures 5,102 effective lines and 5,362 physical lines, down 109 effective and 122 physical from 5,211 and 5,484. The design's P1H.4b estimate was 5,101 and 5,363. The SARIF module measures 121 effective and 134 physical lines, matching the design's mechanical splice. It stays under the 250-line preference and the 400 / 700 hard limits.
importSarifSecurityReport remains 106 effective lines and 117 physical lines. That exceeds the 80-line function hard limit in docs/governance/CODE_QUALITY_STANDARDS.md section 4. scripts/production-file-metrics.mjs checks file size only, so the move passes that check. The merged design, section 8, keeps the function intact because splitting the parse-and-write loop would hide the partial-write order. This plan records the debt instead of adding a quality-exceptions.json entry. Owner: Application maintainers. Review trigger: the next behavior change to importSarifSecurityReport.
Import-only components stay two, each size 3: Approved Apply and the recorded Neutron mutation component. Re-export components stay sizes 4, 29, and 3, with the same membership. The three security modules, host-file-system.ts, project-path.ts, the P1H.1 memory modules, agent-session/agent-session.ts, and the six skill modules stay outside every component. The locked cycle tests were not edited.
The move preserves the current SARIF parser. Invalid JSON still throws malformed SARIF JSON document. A missing runs array still throws invalid SARIF structure: missing runs array. Non-object runs and results are skipped. Scanner, rule id, and title fallbacks stay sarif-scanner, SARIF-RULE, and SARIF Finding. Severity mapping is unchanged, including critical stored as info and a missing level stored as medium. secretLikePath still redacts only the evidence URI, the snippet, and the title. Scanner names, rule ids, and plain secret values that are not secret-like paths stay as written. Evidence URIs are not canonicalized to the project root. Finding ids still restart at sarif-finding-1 on every call, so a repeated import overwrites those files, including a dismissed or accepted-risk finding. Stored trust class stays verified-evidence. Pretty JSON with a trailing newline is unchanged. A later validation failure or filesystem write failure leaves earlier finding files in place. That differs from the clean-abort sentence in ADR-0027 and stays documented until a separate design changes it. An empty import still returns a valid result and writes nothing.
Focused coverage is tests/sarif-security-import-p1h4b.test.ts plus the existing security, CLI, Neutron read-only, and cycle suites: 9 files, 129 tests passed. Existing assertions were not rewritten. Local pnpm verify passed: typecheck, oxlint, Prettier, Vitest 360 files / 3126 passed / 3 skipped, build, and git diff --check. The implementation pull request is #607 (https://github.com/vitala89/Intentloom/pull/607) and is merged as 7a77db52753360f0029cd266d8c95eb78c34995c.
P1H.5 — security policy and sandbox
Design is merged as PR #608 (https://github.com/vitala89/Intentloom/pull/608, 1d0611070b02c5e9f0f0e2816a0f560fbf18c18e). The approved contract is docs/designs/p1h5-security-policy-sandbox/SYSTEM_DESIGN.md. P1H.4 is fully implemented. P1H.5a is merged as PR #609 (7589c6ccff5d79d1f8c6e5de34d2f521ea3caa6e). P1H.5b is merged as PR #610 (2c0749dce9a31976195277971d6fb35fe663cd31). P1H.5 is fully implemented. P1H.6 design is merged as PR #611 (https://github.com/vitala89/Intentloom/pull/611, 52b34c8b202cb07ab30c4f3e991dbce3815510a4). P1H.6 implementation is merged as PR #612 (https://github.com/vitala89/Intentloom/pull/612, b80614d5d65fbdbd9cbc4831a6593ead6b155280). P1H.6 is fully implemented. P1H.7 design is merged as PR #613 (017cb370cf4329a96d723cd83721acbb175f1827). P1H.7 implementation is merged as PR #614 (https://github.com/vitala89/Intentloom/pull/614, e07fddccbc771e415bc1d9056051edb9e00b4d58). P1H is complete. P1I.1 design is merged as PR #615 (8bc9e07c74beb701adaae9e30dacb6aec252b58f). Implementation is merged as PR #616 (https://github.com/vitala89/Intentloom/pull/616, b9201e9d480b34e453d08e1803f94e734d1e3f1f). P1I.1 is complete. P1I.2 design is merged as PR #617 (e3585e8eb5f4b58bb42482e249430654375dee5b). Implementation is merged as PR #618 (https://github.com/vitala89/Intentloom/pull/618, 1d8d55cbfd89792272d4d4c00512aa09465ed23d). P1I.2 is complete. P1I.3 design is merged as PR #620 (e93f6b9efdba11d1dd1cd98ed7072a801595320b). Implementation A, the adoption extraction, is merged as PR #621 (https://github.com/vitala89/Intentloom/pull/621, 527ab7f14fc199bc77d21c7e823b4cc2d5c3d926). Implementation B, the Approved Apply type-import retarget, is merged as PR #622 (https://github.com/vitala89/Intentloom/pull/622, d6b7d4955f2e58780c1ea2afe134f3217ad3fe86). P1I.3 is complete. Measured import-only cycles are the Neutron mutation trio only. Measured re-export cycles are sizes 4, 27, and 3. index.ts measured 1,878 effective lines and 2,034 physical lines before the P1J implementation. No runtime behavior changed. P1J design PR #623 is merged (https://github.com/vitala89/Intentloom/pull/623, 8a44e342f4001bbdc7d7196f66200269af0689b7). The design document keeps its design-stage proposal wording. The approved implementation decision is Option C and is open for review, not merged. Current measurements are in the P1J section. P1 is not complete. Undo U4 and Desktop Undo U5 have not started.
On 7a77db52753360f0029cd266d8c95eb78c34995c, index.ts measures 5,102 effective lines and 5,362 physical lines. The selected family is lines 4353–4660 (279 effective, 308 physical): securityPolicyPath, getSecurityPolicy, writeSecurityPolicy, securityBaselinePath, getSecurityBaseline, updateSecurityBaseline, checkSecurityPolicyAndBaseline, sandboxCapabilityPolicyPath, getSandboxCapabilityPolicy, writeSandboxCapabilityPolicy, and evaluateProposalAgainstSandbox.
The proposed modules, all under packages/application/src/security/ and all estimated under 250 effective lines, are security-policy.ts (48/52), security-baseline.ts (49/54), security-policy-evaluation.ts (83/93), sandbox-capability-policy.ts (52/56), and sandbox-proposal-evaluation.ts (84/92). There is no security/index.ts and no new package export-map key. No new module imports index.ts. A simulated splice measures index.ts at 4,833 effective lines and 5,064 physical lines.
getSecurityAuditReport, runContinuousSecurityAudit, and securityAuditReportPath stay in index.ts for P1H.6. Audit calls policy read, baseline read, sandbox policy read, and comparison. reviewWorkspaceProposal stays and calls sandbox evaluation. runContinuousSecurityAudit remains 208 effective lines. The design does not split it and does not edit quality-exceptions.json. checkSecurityPolicyAndBaseline is 74 effective lines and evaluateProposalAgainstSandbox is 78. Both stay whole.
Policy persistence and baseline persistence do not import each other. Comparison imports both and listSecurityFindings. Sandbox evaluation imports sandbox policy only. Known weaknesses, including prefix matches, unused stored fields, and the fact that evaluation does not contain execution, are preserved. Mitigations need a separate Design First review.
Import-only components stay two of size 3. Re-export components stay sizes 4, 29, and 3. The new files must stay outside every component. The approved implementation order, if split, is policy, baseline, and comparison, then sandbox policy and evaluation. Those two slices do not depend on each other. One implementation pull request is also allowed. Neither starts P1H.6.
P1H.5a — policy, baseline, and comparison
Implemented from the merged design, section 21 stage P1H.5a, on baseline 1d0611070b02c5e9f0f0e2816a0f560fbf18c18e (PR #608). This slice is PR #609 (https://github.com/vitala89/Intentloom/pull/609). It is merged as 7589c6ccff5d79d1f8c6e5de34d2f521ea3caa6e. P1H.5b has since merged, so this slice is no longer the end of P1H.5.
securityPolicyPath, getSecurityPolicy, and writeSecurityPolicy moved to packages/application/src/security/security-policy.ts. securityBaselinePath, getSecurityBaseline, and updateSecurityBaseline moved to packages/application/src/security/security-baseline.ts. The baseline module imports listSecurityFindings from the finding store. checkSecurityPolicyAndBaseline moved to packages/application/src/security/security-policy-evaluation.ts and imports getSecurityPolicy, getSecurityBaseline, and listSecurityFindings. Both path helpers stay private to their modules and are not package-root exports. No new module imports index.ts. Policy persistence and baseline persistence do not import each other. No security/index.ts was added. The package export map is unchanged. quality-exceptions.json is unchanged.
index.ts named-re-exports the five public functions. It value-imports getSecurityPolicy, getSecurityBaseline, and checkSecurityPolicyAndBaseline for runContinuousSecurityAudit. It drops the listSecurityFindings value import and keeps securityFindingPath for runLocalSecurityAdapters. Sandbox policy, sandbox evaluation, audit, workspace review, Approved Apply, the finding store, and SARIF import stay where they were.
On this change, index.ts measures 4,952 effective lines and 5,194 physical lines, down 150 effective and 168 physical from 5,102 and 5,362. That matches the design's posture-slice estimate. The new modules measure 48/52, 49/54, and 83/93. All stay under the 250-line preference and the 400 / 700 hard limits. checkSecurityPolicyAndBaseline remains 74 effective lines and 83 physical lines, under the 80-line function hard limit.
Import-only components stay two, each size 3: Approved Apply (approved-apply-baseline.ts, generated-file-sync-declared.ts, index.ts) and the recorded Neutron mutation component. Re-export components stay sizes 4, 29, and 3, with the same membership. The three new modules, the three earlier security modules, host-file-system.ts, project-path.ts, the P1H.1 memory modules, agent-session/agent-session.ts, and the six skill modules stay outside every component. The locked cycle tests were not edited.
The move preserves the current policy and baseline behavior. A missing or invalid policy still falls back to default enforcement warn and the four rules in order: critical fail, high fail, medium warn, low ignore. The fallback projectId is still options.projectId or project-local, and updatedAt is still generated for that fallback. A failed policy write still throws and leaves the stored file in place. A missing or invalid baseline still returns null. Baseline update still hashes JSON.stringify of the id-sorted finding array with lowercase SHA-256, stores every finding state, and replaces createdAt. Comparison is still by finding id. The first matching rule still wins. A warn rule on a critical finding still adds a violation without setting exit code 3. Dismissed, accepted-risk, and remediated findings are still skipped. The stored baseline hash is still not verified on read. Those limitations stay until a separate design changes them.
Focused coverage is tests/security-policy-baseline-p1h5a.test.ts plus the existing security, CLI, workspace, and cycle suites: 13 files, 157 tests passed. Existing assertions were not rewritten. Local pnpm verify passed: typecheck, oxlint, Prettier, Vitest 361 files / 3132 passed / 3 skipped, build, and git diff --check. The implementation pull request is #609 (https://github.com/vitala89/Intentloom/pull/609) and is merged as 7589c6ccff5d79d1f8c6e5de34d2f521ea3caa6e.
P1H.5b — sandbox policy and evaluation
Implemented from the merged design, section 21 stage P1H.5b, on baseline 7589c6ccff5d79d1f8c6e5de34d2f521ea3caa6e (PR #609). P1H.5a is merged. This slice is PR #610 (https://github.com/vitala89/Intentloom/pull/610). It is merged as 2c0749dce9a31976195277971d6fb35fe663cd31. P1H.5 is fully implemented. P1H.6 implementation is merged as PR #612 (https://github.com/vitala89/Intentloom/pull/612, b80614d5d65fbdbd9cbc4831a6593ead6b155280).
sandboxCapabilityPolicyPath, getSandboxCapabilityPolicy, and writeSandboxCapabilityPolicy moved to packages/application/src/security/sandbox-capability-policy.ts. evaluateProposalAgainstSandbox moved to packages/application/src/security/sandbox-proposal-evaluation.ts and imports getSandboxCapabilityPolicy from the policy module. The path helper stays private and is not a package-root export. No new module imports index.ts. The sandbox modules do not import policy, baseline, or the finding store. No security/index.ts was added. The package export map is unchanged. quality-exceptions.json is unchanged.
index.ts named-re-exports the three public functions. It value-imports getSandboxCapabilityPolicy for runContinuousSecurityAudit and evaluateProposalAgainstSandbox for reviewWorkspaceProposal. The P1H.5a value imports stay. securityFindingPath stays for runLocalSecurityAdapters. Audit, workspace review, workspace apply, Approved Apply, Neutron mutation, and the extension sandbox are unchanged.
On this change, index.ts measures 4,833 effective lines and 5,064 physical lines, down 119 effective and 130 physical from 4,952 and 5,194. That matches the design estimate for the sandbox slice after P1H.5a. The new modules measure 52/56 and 84/92. evaluateProposalAgainstSandbox remains 78 effective lines, under the 80-line function hard limit. The violation loop was not rewritten.
Import-only components stay two, each size 3: Approved Apply (approved-apply-baseline.ts, generated-file-sync-declared.ts, index.ts) and the recorded Neutron mutation component. Re-export components stay sizes 4, 29, and 3, with the same membership. The two sandbox modules and the earlier P1H modules stay outside every component. The locked cycle tests were not edited.
The move preserves sandbox behavior. A missing, unreadable, malformed, or validator-rejected policy still falls open to mode proposal-only, path rules src/ then .aif/ (write allowed, delete denied), command prefixes pnpm test, pnpm lint, and git diff, and allowNetwork: false. Writes still validate before creating the parent directory and still store pretty JSON with a trailing newline. Caller timestamps are not replaced. Read-only mode still inserts its exact violation first and still continues. proposal.actions still wins over proposal.changes, including an empty actions array. Path and command checks remain string prefixes, including the inherited src/../secret and pnpm test; rm -rf / matches. allowArgs is still stored and not enforced. Network violations still require networkAccess === true while allowNetwork is false. Evaluation still does not execute a proposal or gate Approved Apply, Neutron mutation, or workspace apply. reviewWorkspaceProposal still copies allowed into readyToApply. Audit still reads the sandbox policy for invariants 1 and 28.
Focused coverage is tests/security-sandbox-policy-p1h5b.test.ts and tests/security-sandbox-evaluation-p1h5b.test.ts plus the existing security, CLI, workspace, and cycle suites: 14 files, 163 tests passed. Existing assertions were not rewritten. Local pnpm verify passed: typecheck, oxlint, Prettier, Vitest 363 files / 3143 passed / 3 skipped, build, and git diff --check. The implementation pull request is #610 (https://github.com/vitala89/Intentloom/pull/610) and is merged as 2c0749dce9a31976195277971d6fb35fe663cd31.
P1H.6 — continuous security audit
Design is merged as PR #611 (https://github.com/vitala89/Intentloom/pull/611, 52b34c8b202cb07ab30c4f3e991dbce3815510a4). The approved contract is docs/designs/p1h6-continuous-security-audit/SYSTEM_DESIGN.md. P1H.5 is fully implemented. Implementation is merged as PR #612 (https://github.com/vitala89/Intentloom/pull/612, b80614d5d65fbdbd9cbc4831a6593ead6b155280). P1H.6 is fully implemented. The measurements in the following paragraphs are the design record from before that merge. P1H.7 design is merged as PR #613 (017cb370cf4329a96d723cd83721acbb175f1827). P1H.7 implementation is merged as PR #614 (https://github.com/vitala89/Intentloom/pull/614, e07fddccbc771e415bc1d9056051edb9e00b4d58). P1H is complete. P1I.1 design is merged as PR #615 (8bc9e07c74beb701adaae9e30dacb6aec252b58f). Implementation is merged as PR #616 (https://github.com/vitala89/Intentloom/pull/616, b9201e9d480b34e453d08e1803f94e734d1e3f1f). P1I.1 is complete. P1I.2 design is merged as PR #617 (e3585e8eb5f4b58bb42482e249430654375dee5b). Implementation is merged as PR #618 (https://github.com/vitala89/Intentloom/pull/618, 1d8d55cbfd89792272d4d4c00512aa09465ed23d). P1I.2 is complete. P1I.3 design is merged as PR #620 (e93f6b9efdba11d1dd1cd98ed7072a801595320b). Implementation A, the adoption extraction, is merged as PR #621 (https://github.com/vitala89/Intentloom/pull/621, 527ab7f14fc199bc77d21c7e823b4cc2d5c3d926). Implementation B, the Approved Apply type-import retarget, is merged as PR #622 (https://github.com/vitala89/Intentloom/pull/622, d6b7d4955f2e58780c1ea2afe134f3217ad3fe86). P1I.3 is complete. Measured import-only cycles are the Neutron mutation trio only. Measured re-export cycles are sizes 4, 27, and 3. index.ts measured 1,878 effective lines and 2,034 physical lines before the P1J implementation. No runtime behavior changed. P1J design PR #623 is merged (https://github.com/vitala89/Intentloom/pull/623, 8a44e342f4001bbdc7d7196f66200269af0689b7). The design document keeps its design-stage proposal wording. The approved implementation decision is Option C and is open for review, not merged. Current measurements are in the P1J section. P1 is not complete. Undo U4 and Desktop Undo U5 have not started.
On 2c0749dce9a31976195277971d6fb35fe663cd31, index.ts measures 4,833 effective lines and 5,064 physical lines. The selected family is lines 4364–4595 (224 effective, 232 physical): securityAuditReportPath, getSecurityAuditReport, and runContinuousSecurityAudit. The runner is 208 effective lines and 214 physical lines. The checks array inside it is 179 lines. That function is above the 80-line hard limit. Moving it unchanged is not accepted.
The proposed modules, all under packages/application/src/security/ and all estimated under 250 effective lines, are security-audit-report-store.ts (34/37), security-audit-invariants.ts (216/221), and continuous-security-audit.ts (47/48). There is no security/index.ts and no new package export-map key. No new module imports index.ts. A simulated splice measures index.ts at 4,607 effective lines and 4,829 physical lines. Those figures are an estimate, not an implementation result.
The store owns the path, the reader, and the existing write tail. The invariants module owns the 25 literal passed checks, ids 2 through 26, and the three dynamic checks for network, policy violations, and sandbox mode. The orchestrator owns the score, the SHA-256 hash, protocol validation, and the calls to the P1H.5 leaves. The static catalog stays a module-level constant so it is not one oversized function. The simulated orchestrator function is 35 effective lines. No quality-exceptions.json change is required.
Invariant 27 still follows the violation count, including a warn-and-critical finding whose comparison exit code is 0. Invariants 2 through 26 stay literal passed checks. The design does not turn them into runtime probes. The health score and hash formulas stay. The reader stays free of the orchestrator so P1H.7 can import it later.
Import-only components stay two of size 3. Re-export components stay sizes 4, 29, and 3. The new files must stay outside every component. The approved implementation shape is one pull request that moves and splits the family together. A persistence-only first pull request is not the default, because it would leave the 208-line function in place. Neither shape starts P1H.7.
P1H.6 implementation
Implemented from the merged design on baseline 52b34c8b202cb07ab30c4f3e991dbce3815510a4 (PR #611). This slice is PR #612 (https://github.com/vitala89/Intentloom/pull/612), on refactor/application-continuous-security-audit-p1h6. The final pull-request head was c86cf64309258deec7c4ba2d916d891943f02ec9. It is merged as b80614d5d65fbdbd9cbc4831a6593ead6b155280. P1H.7 design is merged as PR #613 (017cb370cf4329a96d723cd83721acbb175f1827). P1H.7 implementation is merged as PR #614 (https://github.com/vitala89/Intentloom/pull/614, e07fddccbc771e415bc1d9056051edb9e00b4d58). P1H is complete.
securityAuditReportPath, getSecurityAuditReport, and writeSecurityAuditReport live in packages/application/src/security/security-audit-report-store.ts (34 effective lines, 37 physical lines). The path helper stays private. The static catalog for ids 2 through 26 and the three dynamic checks live in security/security-audit-invariants.ts (221/227). buildSecurityInvariantChecks copies the static objects before returning them. runContinuousSecurityAudit lives in security/continuous-security-audit.ts (47/48) and is 35 effective lines. The 208-line runner is not preserved under another name. No new function exceeds 40 effective lines. No security/index.ts was added. The package export map is unchanged. quality-exceptions.json is unchanged.
index.ts named-re-exports getSecurityAuditReport and runContinuousSecurityAudit. It value-imports the reader for getInteractiveWorkspaceState and syncLocalWorkspaceState. It keeps evaluateProposalAgainstSandbox and securityFindingPath. It drops the value imports of getSecurityPolicy, getSecurityBaseline, getSandboxCapabilityPolicy, and checkSecurityPolicyAndBaseline. Those names remain package-root re-exports. The orchestrator imports the four P1H.5 reads directly and still performs all four calls. validateContinuousSecurityAuditReport is no longer used by the barrel.
On this change, index.ts measures 4,607 effective lines and 4,829 physical lines, down 226 effective and 235 physical from 4,833 and 5,064. That matches the design simulation. The invariants file is 221/227 rather than the simulated 216/221 because of the copy helper. All three files stay under the 250-line preference.
Import-only components stay two, each size 3. Re-export components stay sizes 4, 29, and 3, with the same membership. The three audit modules stay outside every component and do not import index.ts. No P1H.5 module imports them. The locked cycle tests were not edited.
The move preserves the current report. Ids, titles, details, and order stay. Ids 2 through 26 stay literal passed checks. Invariant 1 still follows allowNetwork. Invariant 27 still follows the violation count, including the unpluralized 1 policy violations detected and a warn-and-critical finding whose comparison exit code is 0. Invariant 28 still warns only when the mode is read-only. The score and hash formulas stay. The reader still returns null for a missing or rejected report and does not recompute the score or hash. Those limitations stay until a separate design changes them.
Hosted CI on the final head c86cf64309258deec7c4ba2d916d891943f02ec9 passed. CodeQL, Governance, Desktop SEA Feasibility, Compatibility, and Harness Performance Benchmark passed. The merge push of b80614d5d65fbdbd9cbc4831a6593ead6b155280 passed CodeQL, Documentation, and Compatibility.
P1H.7 — interactive workspace read model
Design is merged as PR #613 (https://github.com/vitala89/Intentloom/pull/613, 017cb370cf4329a96d723cd83721acbb175f1827). The approved contract is docs/designs/p1h7-interactive-workspace-read-model/SYSTEM_DESIGN.md. The feasibility verdict is C. An approved dependency-injection seam is required. P1H.6 is fully implemented at PR #612 (b80614d5d65fbdbd9cbc4831a6593ead6b155280). Implementation is merged as PR #614 (https://github.com/vitala89/Intentloom/pull/614, e07fddccbc771e415bc1d9056051edb9e00b4d58). P1H.7 is complete. P1H is complete. P1I.1 design is merged as PR #615 (8bc9e07c74beb701adaae9e30dacb6aec252b58f). Implementation is merged as PR #616 (https://github.com/vitala89/Intentloom/pull/616, b9201e9d480b34e453d08e1803f94e734d1e3f1f). P1I.1 is complete. P1I.2 design is merged as PR #617 (e3585e8eb5f4b58bb42482e249430654375dee5b). Implementation is merged as PR #618 (https://github.com/vitala89/Intentloom/pull/618, 1d8d55cbfd89792272d4d4c00512aa09465ed23d). P1I.2 is complete. P1I.3 design is merged as PR #620 (e93f6b9efdba11d1dd1cd98ed7072a801595320b). Implementation A, the adoption extraction, is merged as PR #621 (https://github.com/vitala89/Intentloom/pull/621, 527ab7f14fc199bc77d21c7e823b4cc2d5c3d926). Implementation B, the Approved Apply type-import retarget, is merged as PR #622 (https://github.com/vitala89/Intentloom/pull/622, d6b7d4955f2e58780c1ea2afe134f3217ad3fe86). P1I.3 is complete. Measured import-only cycles are the Neutron mutation trio only. Measured re-export cycles are sizes 4, 27, and 3. index.ts measured 1,878 effective lines and 2,034 physical lines before the P1J implementation. No runtime behavior changed. P1J design PR #623 is merged (https://github.com/vitala89/Intentloom/pull/623, 8a44e342f4001bbdc7d7196f66200269af0689b7). The design document keeps its design-stage proposal wording. The approved implementation decision is Option C and is open for review, not merged. Current measurements are in the P1J section. P1 is not complete. Undo U4 and Desktop Undo U5 have not started.
The design inventory below is the pre-implementation measurement.
The selected declarations in packages/application/src/index.ts are InteractiveWorkspaceState (lines 4362–4380, 19 effective lines), getInteractiveWorkspaceState (lines 4382–4435, 53 effective and 54 physical), LocalWorkspaceSyncState (lines 4777–4786, 10 effective lines), and syncLocalWorkspaceState (lines 4787–4813, 27 effective lines). index.ts on this baseline measures 4,607 effective lines and 4,829 physical lines.
Feasibility verdict: C. An approved dependency-injection seam is required. getSecurityAuditReport and listAgentSessions are already leaves and can be imported directly. inspectProject, doctorProject, diffProject, timelineProject, listWorkspaceConversations, and listNeutronSubagentTasks are still implemented in index.ts. Importing index.ts from a new module, including import type, would grow the Approved Apply import component and the 29-file re-export component. Moving those callees is not authorized in P1H: doctorProject is excluded, the project lifecycle operations are P1I, conversation commands are excluded, and the legacy Neutron helpers wait for P1J.
The proposed module is packages/application/src/workspace/interactive-workspace-read-model.ts. There is no workspace/index.ts and no new package export-map key. The module does not import index.ts or continuous-security-audit.ts. The barrel keeps both public signatures and passes the barrel-owned functions in. A sketch of that module is 191 effective lines and 201 physical lines. That figure is an estimate, not an implementation measurement. Estimated remaining index.ts size is about 4,545 effective lines and 4,766 physical lines. InteractiveWorkspaceState stays in the barrel because its fields name types that are declared only there. LocalWorkspaceSyncState moves. quality-exceptions.json stays unchanged.
getInteractiveWorkspaceState keeps Promise.all and the current catch boundaries. doctorProject errors still propagate. syncLocalWorkspaceState stays sequential and still does not write. Neither function is renamed. If this design is rejected, P1H.7 stays blocked and the implementation must not import the barrel.
P1H.7 implementation
The approved seam is implemented in PR #614 (https://github.com/vitala89/Intentloom/pull/614) and is merged as e07fddccbc771e415bc1d9056051edb9e00b4d58. index.ts remains the composition root. getInteractiveWorkspaceState and syncLocalWorkspaceState keep their public signatures and pass the barrel-owned functions into packages/application/src/workspace/interactive-workspace-read-model.ts. That module imports getSecurityAuditReport and listAgentSessions directly. It does not import index.ts or continuous-security-audit.ts. There is no workspace/index.ts and no new package export-map key. InteractiveWorkspaceState stays in the barrel. LocalWorkspaceSyncState is re-exported with export type. The assemblers are not package exports.
Measured with measureProductionSource: the new module is 205 effective lines and 219 physical lines. assembleInteractiveWorkspaceState is 64 effective lines and 65 physical lines. assembleLocalWorkspaceSyncState is 41 effective lines and 41 physical lines. index.ts is 4,547 effective lines and 4,769 physical lines, down from 4,607 and 4,829. quality-exceptions.json is unchanged. Import-only cycles stay two components of size 3. Re-export cycles stay three, sizes 4, 29, and 3. The new module stays outside every component. Interactive reads stay concurrent, with the previous catch boundaries. Doctor errors still propagate. Sync stays sequential, still does not write, and keeps a stored health score of 0 as 0. Public names and the twelve export-map keys stay. P1H is complete. P1I.1 design is merged as PR #615 (8bc9e07c74beb701adaae9e30dacb6aec252b58f). Implementation is merged as PR #616 (https://github.com/vitala89/Intentloom/pull/616, b9201e9d480b34e453d08e1803f94e734d1e3f1f). P1I.1 is complete. P1I.2 design is merged as PR #617 (e3585e8eb5f4b58bb42482e249430654375dee5b). Implementation is merged as PR #618 (https://github.com/vitala89/Intentloom/pull/618, 1d8d55cbfd89792272d4d4c00512aa09465ed23d). P1I.2 is complete.
P1I — transaction and lifecycle
P1I.1 design is merged as PR #615 (8bc9e07c74beb701adaae9e30dacb6aec252b58f). The approved contract is docs/designs/p1i1-generated-file-transaction/SYSTEM_DESIGN.md. The feasibility verdict is C: the package root keeps synchronizeGeneratedFiles as the mode dispatcher, and the generated-files commit lives in leaves that do not import index.ts. Implementation is merged as PR #616 (https://github.com/vitala89/Intentloom/pull/616, b9201e9d480b34e453d08e1803f94e734d1e3f1f). P1I.1 is complete. Plan, Change, and ChangeKind live in packages/application/src/project-change.ts. Measured with measureProductionSource, index.ts is 3,760 effective lines and 3,956 physical lines, down from 4,547 and 4,769. generated-file/generated-file-transaction.ts is 210 effective lines and 219 physical lines. generated-file-sync-declared.ts stays 302 effective lines. Import-only cycles stay two components of size 3. Re-export cycles stay three, sizes 4, 29, and 3. The new modules stay outside every component. quality-exceptions.json and the twelve package export-map keys are unchanged. The lifecycle move is the opened P1I.2 implementation. A following PR moves adoptProject, planProjectAdoption, and applyProjectAdoption, together with the Approved Apply import retarget that removes index.ts from cycle 1. That following slice is P1I.3. Its design is merged as PR #620 (e93f6b9efdba11d1dd1cd98ed7072a801595320b) in docs/designs/p1i3-existing-project-adoption/SYSTEM_DESIGN.md. Implementation A is merged as PR #621 (https://github.com/vitala89/Intentloom/pull/621, 527ab7f14fc199bc77d21c7e823b4cc2d5c3d926). Implementation B, the Approved Apply type-import retarget, is merged as PR #622 (https://github.com/vitala89/Intentloom/pull/622, d6b7d4955f2e58780c1ea2afe134f3217ad3fe86). P1I.3 is complete. P1J design PR #623 is merged (https://github.com/vitala89/Intentloom/pull/623, 8a44e342f4001bbdc7d7196f66200269af0689b7). The design document keeps its design-stage proposal wording. The approved implementation decision is Option C and is open for review, not merged. Current measurements are in the P1J section. P1 is not complete. Undo U4 and Desktop Undo U5 have not started.
P1I.2 — project lifecycle
Design is merged as PR #617 (https://github.com/vitala89/Intentloom/pull/617, e3585e8eb5f4b58bb42482e249430654375dee5b) in docs/designs/p1i2-project-lifecycle/SYSTEM_DESIGN.md. The approved verdict is B+C: leaf-owned lifecycle contracts and operations, with one composition-root binding for synchronizeGeneratedFiles. The public syncProject wrapper stays on index.ts and passes that dispatcher into executeProjectSync. The lifecycle leaves do not import index.ts.
Measured with measureProductionSource, index.ts is 2,561 effective lines and 2,736 physical lines, down from 3,760 and 3,956. The largest new modules are doctor-project.ts at 234 effective lines and desired-generated-state.ts at 227. doctor-ownership.ts was above 250 before the header checks moved to doctor-generated-headers.ts (95 effective lines), which is the contingency named in the approved design. No new function exceeds 80 effective lines. The widest orchestrator, doctorProject, is 62. Import-only cycles stay the same two components of size 3. Re-export cycles stay the same three components of sizes 4, 29, and 3. The new modules are absent from every component. quality-exceptions.json and the twelve package export-map keys are unchanged. Public lifecycle names and syncProject's three-parameter signature stay. adoptProject stays in index.ts and calls the extracted leaves. Ordinary sync does not enter Approved Apply. P1J, Undo U4, and Desktop Undo U5 have not started. The implementation pull request is #618 (https://github.com/vitala89/Intentloom/pull/618) and is merged as 1d8d55cbfd89792272d4d4c00512aa09465ed23d. P1I.2 is complete.
Prerequisites: P1C and P1D merged, Approved Apply tests green on main, and a diff that contains no assertion edits. Those prerequisites were met before this implementation. The three structure tests that pinned the previous index.ts size now pin 2,561 effective lines and 2,736 physical lines. Their SCC membership arrays are unchanged.
P1I.3 — existing project adoption
Design is merged as PR #620 (https://github.com/vitala89/Intentloom/pull/620, e93f6b9efdba11d1dd1cd98ed7072a801595320b) in docs/designs/p1i3-existing-project-adoption/SYSTEM_DESIGN.md. The approved verdict is B: leaf-owned generated-file onboarding and governance adoption, with the public adoptProject wrapper passing syncProject into the generated-file leaf. planProjectAdoption and applyProjectAdoption move. planPackUpdate stays on index.ts. The two workflows do not share a write path.
Implementation A is merged as PR #621 (https://github.com/vitala89/Intentloom/pull/621, 527ab7f14fc199bc77d21c7e823b4cc2d5c3d926). Measured with measureProductionSource, index.ts is 1,878 effective lines and 2,034 physical lines, down from 2,561 and 2,736. The new modules live in packages/application/src/project-adoption/ and stay outside every SCC. quality-exceptions.json and the twelve package export-map keys are unchanged. Implementation A does not edit approved-apply-baseline.ts, generated-file-sync-declared.ts, or approved-apply-engine.ts.
Implementation B retargets those two type imports and is merged as PR #622 (https://github.com/vitala89/Intentloom/pull/622, d6b7d4955f2e58780c1ea2afe134f3217ad3fe86). P1I.3 is complete. approved-apply-baseline.ts imports FileSystem from host-file-system.ts. generated-file-sync-declared.ts imports FileSystem from host-file-system.ts, Plan from project-change.ts, and PostWriteValidationResult, TransactionOptions, TransactionResult, and TransactionStage from generated-file/transaction-contracts.ts. Neither file imports index.ts. approved-apply-engine.ts is unchanged and still imports synchronizeGeneratedFiles from the barrel. Measured import-only membership is only the Neutron mutation trio. Measured re-export membership is sizes 4, 27, and 3: the extension-update quartet, the previous barrel component without approved-apply-baseline.ts and without generated-file-sync-declared.ts, and the unchanged Neutron trio. index.ts and approved-apply-engine.ts remain in the size-27 component. No new component appeared. The retarget does not change runtime behavior. At the P1I.3b merge, index.ts remained 1,878 effective lines and 2,034 physical lines. P1J design PR #623 is merged (https://github.com/vitala89/Intentloom/pull/623, 8a44e342f4001bbdc7d7196f66200269af0689b7). The design document keeps its design-stage proposal wording. The approved implementation decision is Option C and is open for review, not merged. Current measurements are in the P1J section. P1 is not complete. Undo U4 and Desktop Undo U5 have not started.
P1J — legacy Neutron helpers in the barrel
The design is docs/designs/p1j-legacy-neutron-helpers/SYSTEM_DESIGN.md, merged as PR #623 (https://github.com/vitala89/Intentloom/pull/623, 8a44e342f4001bbdc7d7196f66200269af0689b7). That file still records Option C as a design-stage proposal. The approved implementation decision is Option C: move neutronSubagentTaskPath, spawnNeutronSubagentTask, getNeutronSubagentTask, and listNeutronSubagentTasks to packages/application/src/workspace/legacy-subagent-task-record.ts, and keep syncLocalWorkspaceState on index.ts. Do not fold the helpers into src/neutron/. Do not remove the public surface.
The implementation is merged as PR #626 (https://github.com/vitala89/Intentloom/pull/626, 5efc30a0ae21525312425e69ef82ccd30e138c8a). Measured with measureProductionSource on that merge, index.ts is 1,804 effective lines and 1,953 physical lines, down from 1,878 and 2,034. The leaf is 92 effective lines and 100 physical lines. neutronSubagentTaskPath is 3 effective lines, spawnNeutronSubagentTask is 32, getNeutronSubagentTask is 13, and listNeutronSubagentTasks is 36. Import-only SCC membership is unchanged: only the Neutron mutation trio, neutron/mutation/apply/neutron-mutation-apply-durable-record.ts, neutron/mutation/apply/neutron-mutation-apply-store.ts, and neutron/mutation/verification/neutron-mutation-verification-retry-eligibility.ts. Re-export SCC membership is unchanged at sizes 4, 27, and 3. The extension-update quartet is unchanged. The size-27 component is unchanged and still contains index.ts and approved-apply-engine.ts. The Neutron trio is unchanged. The new leaf is outside every component. No runtime behavior changed. inside still checks only the project root. nodeFileSystem.write still follows symlinks and does not revalidate the destination realpath immediately before writing. A caller-supplied task id can still resolve inside the project root and outside .aif/neutron/subagents/. Those risks remain unresolved. P1 is not complete. The next planning document is docs/designs/p1k-remaining-application-barrel/SYSTEM_DESIGN.md, merged as PR #627 (https://github.com/vitala89/Intentloom/pull/627, 1abb80e1e5c7fdcb3a16c14b2897a6a6549446c9). P1K.1 is the first implementation slice and is open as PR #628 (https://github.com/vitala89/Intentloom/pull/628), pending review and not merged. P1K.2 through P1K.17 have not started. Undo U4 and Desktop Undo U5 have not started.
P1K.1 — profile store
The approved design is docs/designs/p1k-remaining-application-barrel/SYSTEM_DESIGN.md, sections 9, 10, 15, 16, and 17. The implementation moves createProfile, getProfile, and listProfiles to packages/application/src/memory/profile-store.ts and re-exports those names from index.ts. delegateTaskRole stays on the barrel and still calls getProfile. Neutron collectors still import getProfile from the package root. There is no memory/index.ts.
The implementation is open as PR #628 (https://github.com/vitala89/Intentloom/pull/628), pending review and not merged. Measured with measureProductionSource, index.ts is 1,751 effective lines and 1,896 physical lines, down from 1,804 and 1,953. The leaf is 66 effective lines and 72 physical lines. createProfile stays 17 effective lines, getProfile stays 14, and listProfiles stays 27. Import-only SCC membership is unchanged: only the Neutron mutation trio. Re-export SCC membership is unchanged at sizes 4, 27, and 3, with the same members. The profile leaf is outside every component. No new component appeared. quality-exceptions.json is unchanged. No runtime behavior changed.
Profile names are still not safe identifiers. inside keeps the resolved path inside the project root, and a name can still leave .aif/memory/profiles/ while remaining inside that root. listProfiles still scans with fs.list(root) and still treats rawPath.startsWith(root) as the absolute-path test. nodeFileSystem.write still follows symlinks and does not revalidate the destination realpath before writing. Those risks stay unresolved. This slice does not sanitize names, normalize paths differently, or migrate stored profiles. P1K.2 through P1K.17 have not started. Undo U4 and Desktop Undo U5 have not started.
What is intentionally not a single PR
Moving all 153 root files at once. Mixing any slice above with a product change. Editing Neutron. Starting U4 or U5. Tightening grandfathered baselines inside a move PR.
12. Architecture ratchets to add with P1B
Add these in the first implementation PR, not in this documentation PR. They guard decisions. They do not freeze an allowlist of every future file.
| Ratchet | What it locks | What it must not do |
|---|---|---|
| Entrypoint no-growth | index.ts effective lines stay ≤ 6,746 and physical lines stay ≤ 7,131, the measured baseline, which is tighter than the grandfathered ceiling | Do not raise the ceiling to make a slice fit |
| File-cycle baseline | The five components in section 5 remain the maximum. A new component fails. | Do not rename files to escape the baseline |
| Neutron topology | Existing tests/application-neutron-topology.test.ts stays unchanged through P1 | Do not copy it into a second Neutron test |
| Forbidden application imports | Fail on imports of CLI, daemon, MCP server, Desktop, React, or Tauri | Do not flag node:fs or node:path |
| Public root exports | The set of root export names is a superset of the names imported by CLI, daemon, and MCP today | Do not require a snapshot of every internal helper |
| New-file budgets | New application files use the existing 400 / 700 production budgets | Do not add an exact-file allowlist that rejects a legitimate new module |
| Subpath keys | The twelve package.json export keys stay | Targets may change only when the topology test's required symbols stay in the target file |
Cycle 5 stays as the recorded Neutron exception inside the topology test. The no-growth ratchet should ignore that recorded component and fail if a sixth component appears.
13. Other packages (not modified in P1A)
Reconciled with a fresh measurement of every packages/*/src tree on this baseline. Application is 363 of the package source files and 47,292 of the effective lines. The next largest trees are protocol and validator.
| Phase | Package | Files | Effective | Physical | Largest file (effective/physical) | Follow-up after P1 |
|---|---|---|---|---|---|---|
| P1 | @intentloom/application | 363 | 47,292 | 50,555 | src/index.ts 6,746/7,131 | This plan |
| P2 | @intentloom/protocol | 128 | 17,101 | 18,763 | src/index.ts 4,280/4,578 | Barrel split. Subpaths for the 48 files application imports relatively. Neutron layout stays as R4B. No neutron/index.ts. |
| P3 | @intentloom/validator | 107 | 15,471 | 16,342 | src/index.ts 844/878 | Same barrel problem, smaller. Neutron layout stays as R4C. |
| P4 | intentloom CLI | 66 | 8,490 | 8,990 | engineering-workspace-command.ts 334/357 | src/command.ts is 171 lines now. The grandfathered ceiling still says 3,243/3,307 and is stale. Star re-export of application stays until P1's barrel is thin. Rendering ownership decision lands here. |
| P5 | @intentloom/daemon | 26 | 5,185 | 5,417 | src/index.ts 1,023/1,050 | Ceiling in the exceptions file is 1,037/1,064, above the file. Replace dist/ and deep src/ imports with the root barrel or a stable subpath. foundation-handlers.ts is 497/518. |
| P5 | @intentloom/mcp-server | 6 | 1,104 | 1,173 | src/index.ts 583/613 | Follows the application barrel. No transport logic moves into application. |
| P6 | @intentloom/core | 3 | 610 | 662 | adoption.ts 398/429 | One adoption module. Split only when a second consumer needs a smaller import. |
| P6 | @intentloom/adapters | 1 | 399 | 420 | src/index.ts 399/420 | Single file, under the hard ceiling, over the 250 preference. |
| P6 | @intentloom/evidence-analysis | 1 | 739 | 777 | src/index.ts 739/777 | Over the hard ceiling. Natural split is the summary family P1B already wraps. |
| P6 | @intentloom/evidence-git | 1 | 211 | 223 | src/index.ts 211/223 | Within budget. |
| P6 | @intentloom/evidence-checker | 3 | 266 | 274 | runner.ts 190/195 | Within budget. |
| P6 | @intentloom/evidence-provider | 10 | 1,178 | 1,285 | src/index.ts 189/205 | Within budget. Stays an adapter. |
P2–P6 do not start in the P1 implementation PRs.
14. Completion criteria
P1A (this PR) is complete when the plan is on a branch, the inventory matches this baseline, validation below has been recorded, and a maintainer can review it. It does not complete P1.
P1 implementation is complete only when all of the following are true:
index.tsis a re-export barrel at or below 400 effective lines and 700 physical lines, or a maintainer-accepted exception names the specific declarations still left and why another slice is unsafe.- The file-cycle ratchet shows no component beyond the baseline in section 5, and the Approved Apply component no longer includes
index.ts. tests/application-neutron-topology.test.tsstill passes without edits that widen its allowlists.- CLI, daemon, and MCP still typecheck against the root barrel with no removed export they import.
pnpm verifypasses.- U4 and U5 are still unstarted.
- No slice mixed a behavior change into a move.
15. What this PR does not do
- No production source move or edit.
- No ratchet test added yet (section 12 is the recommendation).
- No package publish, dependency install change, or hook change.
- No Neutron edit.
- No Undo U4 or Desktop Undo U5.
- No claim that P1 is finished.
Appendix A. Per-file inventory
Effective and physical lines from measureProductionSource. Paths are relative to packages/application/src/.
| File | Effective | Physical |
|---|---|---|
apply-extension-update.ts | 232 | 246 |
approved-apply-baseline.ts | 184 | 210 |
approved-apply-engine.ts | 146 | 160 |
approved-apply-gate.ts | 51 | 58 |
bounded-execution-apply.ts | 58 | 59 |
bounded-execution-capability.ts | 94 | 105 |
bounded-execution-fixtures.ts | 109 | 118 |
bounded-execution-task.ts | 83 | 84 |
bounded-execution-verify.ts | 56 | 57 |
bounded-execution-w11.ts | 8 | 8 |
bounded-execution-workspace-cli.ts | 111 | 115 |
bounded-execution-workspace-viewmodel.ts | 97 | 101 |
bounded-execution-workspace.ts | 216 | 226 |
canonical-json.ts | 36 | 39 |
cli-quality-entry.ts | 1 | 1 |
continuous-loop-apply.ts | 82 | 86 |
continuous-loop-compare.ts | 52 | 55 |
continuous-loop-fixtures.ts | 95 | 104 |
continuous-loop-w12.ts | 6 | 6 |
continuous-loop-workspace-cli.ts | 92 | 96 |
continuous-loop-workspace-viewmodel.ts | 75 | 79 |
continuous-loop-workspace.ts | 141 | 146 |
curated-catalog-entry.ts | 1 | 1 |
destination-collisions.ts | 43 | 46 |
discover-and-apply-extension-update.ts | 32 | 35 |
document-concepts.ts | 31 | 33 |
engineering-assessment.ts | 1 | 1 |
engineering-assessment/assess-options.ts | 28 | 29 |
engineering-assessment/assess.ts | 232 | 255 |
engineering-assessment/conversational.ts | 55 | 59 |
engineering-assessment/historical.ts | 43 | 50 |
engineering-assessment/incremental.ts | 58 | 70 |
engineering-assessment/index.ts | 8 | 8 |
engineering-assessment/remediation.ts | 31 | 35 |
engineering-assessment/renderers.ts | 80 | 87 |
engineering-assessment/viewmodel.ts | 123 | 127 |
engineering-quality-entry.ts | 1 | 1 |
engineering-quality.ts | 1 | 1 |
engineering-quality/baseline-preview.ts | 124 | 132 |
engineering-quality/baseline-ratchet.ts | 174 | 182 |
engineering-quality/baseline-reduction.ts | 56 | 60 |
engineering-quality/check.ts | 72 | 81 |
engineering-quality/checker-execution.ts | 107 | 114 |
engineering-quality/checker-report-common.ts | 186 | 198 |
engineering-quality/checker-report-ingestion.ts | 142 | 145 |
engineering-quality/classifier.ts | 80 | 93 |
engineering-quality/cli-checkers-graph.ts | 168 | 181 |
engineering-quality/cli-commands.ts | 3 | 3 |
engineering-quality/cli-quality-standards.ts | 232 | 248 |
engineering-quality/cli-specialized-packs-external.ts | 205 | 217 |
engineering-quality/cli-specialized-packs.ts | 131 | 140 |
engineering-quality/clippy-report.ts | 63 | 64 |
engineering-quality/curated-catalog.ts | 240 | 256 |
engineering-quality/decomposition-options.ts | 210 | 219 |
engineering-quality/decomposition-planner.ts | 112 | 114 |
engineering-quality/eslint-report.ts | 76 | 77 |
engineering-quality/executable-marketplace-engine.ts | 101 | 116 |
engineering-quality/external-pack-import.ts | 170 | 178 |
engineering-quality/first-party-specialized-pack-runtime.ts | 5 | 6 |
engineering-quality/graph-provider.ts | 214 | 241 |
engineering-quality/index.ts | 39 | 39 |
engineering-quality/metrics.ts | 29 | 35 |
engineering-quality/nx-graph.ts | 170 | 190 |
engineering-quality/organization-catalog-engine.ts | 132 | 145 |
engineering-quality/pack-resolution.ts | 234 | 244 |
engineering-quality/plan-diff.ts | 127 | 131 |
engineering-quality/plan-growth.ts | 204 | 211 |
engineering-quality/pull-request-evidence.ts | 66 | 68 |
engineering-quality/remediation-engine.ts | 142 | 157 |
engineering-quality/sarif-report.ts | 120 | 121 |
engineering-quality/semver-range.ts | 60 | 64 |
engineering-quality/specialized-aliases-engine.ts | 54 | 62 |
engineering-quality/specialized-disciplines-engine.ts | 100 | 110 |
engineering-quality/specialized-pack-catalog-engine.ts | 140 | 152 |
engineering-quality/specialized-pack-check-engine.ts | 237 | 263 |
engineering-quality/specialized-pack-detection-engine.ts | 204 | 229 |
engineering-quality/specialized-pack-external-apply-plan.ts | 167 | 177 |
engineering-quality/specialized-pack-external-apply.ts | 218 | 235 |
engineering-quality/specialized-pack-external-health-findings.ts | 45 | 50 |
engineering-quality/specialized-pack-external-health-local.ts | 200 | 208 |
engineering-quality/specialized-pack-external-health-lock-fields.ts | 238 | 247 |
engineering-quality/specialized-pack-external-health-lock.ts | 82 | 86 |
engineering-quality/specialized-pack-external-health.ts | 75 | 79 |
engineering-quality/specialized-pack-external-lifecycle.ts | 188 | 197 |
engineering-quality/specialized-pack-external-lock.ts | 172 | 184 |
engineering-quality/specialized-pack-external-viewmodel.ts | 145 | 153 |
engineering-quality/specialized-pack-manifest-engine.ts | 124 | 133 |
engineering-quality/specialized-pack-viewmodel.ts | 142 | 153 |
engineering-quality/surface.ts | 78 | 83 |
engineering-quality/typescript-report.ts | 88 | 90 |
engineering-quality/viewmodel-renderers.ts | 57 | 63 |
engineering-quality/viewmodel.ts | 144 | 161 |
existing-project-adoption-apply-gates.ts | 157 | 162 |
existing-project-adoption-apply-health.ts | 64 | 67 |
existing-project-adoption-apply.ts | 258 | 265 |
existing-project-adoption-approval.ts | 173 | 179 |
existing-project-adoption-decisions.ts | 197 | 203 |
existing-project-adoption-generation.ts | 38 | 41 |
existing-project-adoption-plan.ts | 83 | 86 |
existing-project-adoption-prepared-plan-digest.ts | 79 | 85 |
existing-project-adoption-prepared-plan-revalidate.ts | 140 | 143 |
existing-project-adoption-prepared-plan.ts | 239 | 246 |
existing-project-adoption-preview-identity.ts | 29 | 30 |
existing-project-adoption-project-fingerprint.ts | 58 | 61 |
existing-project-fixtures.ts | 107 | 116 |
existing-project-w9.ts | 17 | 17 |
existing-project-workspace-cli.ts | 74 | 79 |
existing-project-workspace-viewmodel.ts | 88 | 93 |
existing-project-workspace.ts | 231 | 247 |
extension-health-evaluator.ts | 106 | 112 |
extension-health-runtime.ts | 199 | 206 |
extension-health.ts | 155 | 163 |
extension-lock-path.ts | 86 | 91 |
extension-removal-files.ts | 140 | 148 |
extension-sandbox.ts | 127 | 139 |
extension-update-files.ts | 161 | 173 |
external-skill-import.ts | 122 | 135 |
feature-intent-create.ts | 54 | 58 |
feature-intent-fixtures.ts | 102 | 111 |
feature-intent-impact.ts | 61 | 63 |
feature-intent-plan.ts | 79 | 81 |
feature-intent-scope.ts | 127 | 136 |
feature-intent-w10.ts | 8 | 8 |
feature-intent-workspace-cli.ts | 89 | 93 |
feature-intent-workspace-viewmodel.ts | 116 | 122 |
feature-intent-workspace.ts | 68 | 71 |
foundation-blueprint-client-viewmodel.ts | 107 | 116 |
foundation-blueprint-store.ts | 19 | 24 |
foundation-blueprint-viewmodel-renderers.ts | 54 | 59 |
foundation-blueprint.ts | 292 | 314 |
foundation-cli.ts | 233 | 254 |
foundation-client-viewmodel.ts | 179 | 193 |
foundation-discovery-client-viewmodel.ts | 99 | 107 |
foundation-discovery-turn.ts | 125 | 134 |
foundation-discovery-viewmodel-renderers.ts | 51 | 56 |
foundation-discovery.ts | 171 | 187 |
foundation-fixtures.ts | 85 | 94 |
foundation-flow.ts | 11 | 11 |
foundation-readiness.ts | 191 | 206 |
foundation-scaffold-apply-revalidation.ts | 172 | 186 |
foundation-scaffold-apply-store.ts | 22 | 27 |
foundation-scaffold-apply.ts | 118 | 129 |
foundation-scaffold-cli.ts | 107 | 111 |
foundation-scaffold-client-viewmodel.ts | 178 | 191 |
foundation-scaffold-store.ts | 29 | 35 |
foundation-scaffold-viewmodel-renderers.ts | 103 | 108 |
foundation-scaffold-workspace-viewmodel.ts | 55 | 64 |
foundation-scaffold.ts | 230 | 243 |
foundation-viewmodel-renderers.ts | 52 | 57 |
foundation-viewmodel.ts | 138 | 147 |
foundation-w2.ts | 6 | 6 |
foundation-w3.ts | 6 | 6 |
foundation-w4.ts | 4 | 4 |
foundation-w6.ts | 5 | 5 |
foundation-w7.ts | 3 | 3 |
foundation-w8.ts | 1 | 1 |
foundation-workshop-defaults.ts | 160 | 165 |
foundation-workshop-store.ts | 48 | 56 |
foundation-workshop.ts | 245 | 266 |
generated-file-sync-declared.ts | 302 | 317 |
generated-metadata-compare.ts | 102 | 108 |
graph-provider-entry.ts | 1 | 1 |
graphify-adapter.ts | 164 | 178 |
harness-adoption-gate.ts | 56 | 64 |
harness-agent-fake.ts | 43 | 45 |
harness-agent-result.ts | 135 | 142 |
harness-agent.ts | 139 | 145 |
harness-benchmark-fixtures.ts | 111 | 122 |
harness-benchmark-sample.ts | 192 | 211 |
harness-benchmark.ts | 166 | 192 |
harness-comparison.ts | 37 | 43 |
harness-runner.ts | 196 | 213 |
harness-sandbox.ts | 197 | 215 |
harness-scenarios.ts | 129 | 139 |
harness-state.ts | 175 | 196 |
harness-surfaces.ts | 48 | 51 |
harness-voting-metrics.ts | 90 | 95 |
harness-voting.ts | 184 | 195 |
harness.ts | 11 | 11 |
inception-actions.ts | 72 | 82 |
inception-approval.ts | 95 | 111 |
inception-blueprint.ts | 108 | 125 |
inception-cli.ts | 128 | 142 |
inception-client-viewmodel.ts | 137 | 148 |
inception-discovery.ts | 106 | 121 |
inception-fixtures.ts | 85 | 94 |
inception-flow.ts | 201 | 227 |
inception-package-name.ts | 26 | 30 |
inception-scaffold-apply.ts | 98 | 115 |
inception-scaffold-planner.ts | 154 | 165 |
inception-session-store.ts | 48 | 56 |
inception-templates.ts | 94 | 109 |
inception-viewmodel-renderers.ts | 41 | 45 |
inception-viewmodel.ts | 106 | 113 |
inception-w1.ts | 6 | 6 |
inception-workspace-scaffold-files.ts | 269 | 276 |
inception-workspace-scaffold-validation.ts | 51 | 59 |
inception.ts | 279 | 309 |
index.ts | 6746 | 7131 |
inspect-extension-manifest.ts | 27 | 32 |
instruction-file-taxonomy.ts | 52 | 58 |
knowledge-provider.ts | 68 | 73 |
model-adapter.ts | 83 | 93 |
neutron/context/neutron-context-assembly.ts | 150 | 158 |
neutron/context/neutron-context-budget.ts | 103 | 112 |
neutron/context/neutron-context-collectors.ts | 211 | 229 |
neutron/context/neutron-context-secret-paths.ts | 35 | 38 |
neutron/context/neutron-context-state-collectors.ts | 227 | 243 |
neutron/context/neutron-context-state-excerpts.ts | 62 | 68 |
neutron/context/neutron-n2-context-hook.ts | 102 | 107 |
neutron/context/neutron-n3-prompt-context.ts | 106 | 116 |
neutron/graph/neutron-graph-mutation-attach.ts | 71 | 74 |
neutron/graph/neutron-graph-mutation-collect.ts | 138 | 145 |
neutron/graph/neutron-graph-mutation-identity.ts | 56 | 60 |
neutron/graph/neutron-graph-mutation-materialize.ts | 133 | 136 |
neutron/graph/neutron-graph-projection.ts | 201 | 214 |
neutron/mutation/apply/neutron-graph-mutation-apply.ts | 102 | 108 |
neutron/mutation/apply/neutron-graph-mutation-evidence.ts | 81 | 84 |
neutron/mutation/apply/neutron-mutation-apply-after-claim.ts | 197 | 203 |
neutron/mutation/apply/neutron-mutation-apply-codes.ts | 49 | 51 |
neutron/mutation/apply/neutron-mutation-apply-durable-fs.ts | 64 | 71 |
neutron/mutation/apply/neutron-mutation-apply-durable-lock.ts | 120 | 128 |
neutron/mutation/apply/neutron-mutation-apply-durable-record.ts | 81 | 88 |
neutron/mutation/apply/neutron-mutation-apply-durable-store.ts | 105 | 109 |
neutron/mutation/apply/neutron-mutation-apply-execute.ts | 164 | 172 |
neutron/mutation/apply/neutron-mutation-apply-lock.ts | 40 | 46 |
neutron/mutation/apply/neutron-mutation-apply-parse.ts | 70 | 73 |
neutron/mutation/apply/neutron-mutation-apply-persist.ts | 165 | 175 |
neutron/mutation/apply/neutron-mutation-apply-result.ts | 66 | 69 |
neutron/mutation/apply/neutron-mutation-apply-run.ts | 166 | 171 |
neutron/mutation/apply/neutron-mutation-apply-store.ts | 183 | 204 |
neutron/mutation/apply/neutron-mutation-apply-types.ts | 37 | 39 |
neutron/mutation/apply/neutron-mutation-apply-validate.ts | 254 | 264 |
neutron/mutation/apply/neutron-mutation-apply-verify.ts | 250 | 256 |
neutron/mutation/apply/neutron-mutation-apply.ts | 129 | 136 |
neutron/mutation/apply/neutron-mutation-authorization.ts | 67 | 72 |
neutron/mutation/apply/neutron-mutation-containment.ts | 85 | 92 |
neutron/mutation/apply/neutron-mutation-diagnostics.ts | 45 | 49 |
neutron/mutation/apply/neutron-mutation-lock.ts | 13 | 18 |
neutron/mutation/apply/neutron-mutation-preflight-parse.ts | 82 | 89 |
neutron/mutation/apply/neutron-mutation-preflight.ts | 222 | 235 |
neutron/mutation/apply/neutron-mutation-replay.ts | 16 | 22 |
neutron/mutation/approval/neutron-mutation-approval-construct.ts | 95 | 100 |
neutron/mutation/approval/neutron-mutation-approval-eligibility.ts | 193 | 208 |
neutron/mutation/approval/neutron-mutation-approval-issue-types.ts | 72 | 82 |
neutron/mutation/approval/neutron-mutation-approval-issue.ts | 72 | 83 |
neutron/mutation/approval/neutron-mutation-approve-apply-public.ts | 93 | 99 |
neutron/mutation/approval/neutron-mutation-approve-apply.ts | 92 | 99 |
neutron/mutation/proposal/neutron-mutation-bindings.ts | 170 | 182 |
neutron/mutation/proposal/neutron-mutation-proposal-capability.ts | 33 | 37 |
neutron/mutation/review/neutron-graph-mutation-current.ts | 26 | 29 |
neutron/mutation/review/neutron-graph-mutation-store.ts | 42 | 45 |
neutron/mutation/review/neutron-mutation-review-bind.ts | 50 | 53 |
neutron/mutation/review/neutron-mutation-review-current.ts | 21 | 22 |
neutron/mutation/review/neutron-mutation-review-files.ts | 154 | 159 |
neutron/mutation/review/neutron-mutation-review-leak.ts | 20 | 22 |
neutron/mutation/review/neutron-mutation-review-payload.ts | 116 | 128 |
neutron/mutation/review/neutron-mutation-review-project.ts | 187 | 193 |
neutron/mutation/review/neutron-mutation-review-result.ts | 27 | 29 |
neutron/mutation/status/neutron-mutation-status-index.ts | 250 | 271 |
neutron/mutation/status/neutron-mutation-status-link.ts | 69 | 72 |
neutron/mutation/status/neutron-mutation-status-public.ts | 70 | 76 |
neutron/mutation/status/neutron-mutation-status-read.ts | 90 | 100 |
neutron/mutation/undo/neutron-mutation-undo-approval.ts | 134 | 148 |
neutron/mutation/undo/neutron-mutation-undo-commit.ts | 157 | 163 |
neutron/mutation/undo/neutron-mutation-undo-current.ts | 70 | 78 |
neutron/mutation/undo/neutron-mutation-undo-eligibility.ts | 164 | 180 |
neutron/mutation/undo/neutron-mutation-undo-execute.ts | 130 | 144 |
neutron/mutation/undo/neutron-mutation-undo-finish.ts | 202 | 210 |
neutron/mutation/undo/neutron-mutation-undo-locate.ts | 69 | 72 |
neutron/mutation/undo/neutron-mutation-undo-plan.ts | 187 | 201 |
neutron/mutation/undo/neutron-mutation-undo-preflight.ts | 269 | 289 |
neutron/mutation/undo/neutron-mutation-undo-preview.ts | 83 | 86 |
neutron/mutation/undo/neutron-mutation-undo-public.ts | 116 | 122 |
neutron/mutation/undo/neutron-mutation-undo-record.ts | 180 | 200 |
neutron/mutation/undo/neutron-mutation-undo-run.ts | 181 | 201 |
neutron/mutation/undo/neutron-mutation-undo-snapshot-apply.ts | 128 | 136 |
neutron/mutation/undo/neutron-mutation-undo-snapshot-capture.ts | 210 | 224 |
neutron/mutation/undo/neutron-mutation-undo-snapshot-files.ts | 135 | 140 |
neutron/mutation/undo/neutron-mutation-undo-snapshot-manifest.ts | 270 | 302 |
neutron/mutation/undo/neutron-mutation-undo-snapshot-store.ts | 233 | 253 |
neutron/mutation/undo/neutron-mutation-undo-snapshot-validate.ts | 210 | 224 |
neutron/mutation/undo/neutron-mutation-undo-store.ts | 172 | 184 |
neutron/mutation/verification/neutron-mutation-verification-build.ts | 161 | 170 |
neutron/mutation/verification/neutron-mutation-verification-bytes.ts | 48 | 50 |
neutron/mutation/verification/neutron-mutation-verification-hidden.ts | 33 | 36 |
neutron/mutation/verification/neutron-mutation-verification-paths.ts | 65 | 68 |
neutron/mutation/verification/neutron-mutation-verification-retry-eligibility.ts | 19 | 28 |
neutron/mutation/verification/neutron-mutation-verification-retry-run.ts | 219 | 241 |
neutron/mutation/verification/neutron-mutation-verification-retry.ts | 42 | 44 |
neutron/mutation/verification/neutron-mutation-verification-rollback.ts | 36 | 37 |
neutron/mutation/verification/neutron-mutation-verification-state.ts | 47 | 49 |
neutron/mutation/verification/neutron-mutation-verification.ts | 113 | 117 |
neutron/neutron-graph-mutation.ts | 56 | 56 |
neutron/neutron-n2-loop.ts | 251 | 261 |
neutron/neutron-runtime-contracts.ts | 47 | 50 |
neutron/neutron-scheduler.ts | 182 | 182 |
neutron/neutron-session-fingerprint.ts | 9 | 10 |
neutron/scheduler/neutron-scheduler-aggregate.ts | 175 | 182 |
neutron/scheduler/neutron-scheduler-attempt.ts | 90 | 95 |
neutron/scheduler/neutron-scheduler-batch.ts | 171 | 179 |
neutron/scheduler/neutron-scheduler-cancellation.ts | 37 | 42 |
neutron/scheduler/neutron-scheduler-clock.ts | 32 | 35 |
neutron/scheduler/neutron-scheduler-errors.ts | 44 | 48 |
neutron/scheduler/neutron-scheduler-graph-result.ts | 168 | 181 |
neutron/scheduler/neutron-scheduler-heartbeat.ts | 46 | 49 |
neutron/scheduler/neutron-scheduler-lease-store.ts | 251 | 266 |
neutron/scheduler/neutron-scheduler-lease.ts | 140 | 154 |
neutron/scheduler/neutron-scheduler-provenance.ts | 218 | 231 |
neutron/scheduler/neutron-scheduler-recovery.ts | 255 | 265 |
neutron/scheduler/neutron-scheduler-retry.ts | 85 | 93 |
neutron/scheduler/neutron-scheduler-run-attempt.ts | 174 | 178 |
neutron/scheduler/neutron-scheduler-select.ts | 200 | 222 |
neutron/scheduler/neutron-scheduler-sort.ts | 10 | 11 |
neutron/scheduler/neutron-scheduler-stale.ts | 169 | 186 |
neutron/scheduler/neutron-scheduler-timeout.ts | 48 | 52 |
neutron/scheduler/neutron-scheduler-transitions.ts | 44 | 49 |
neutron/scheduler/neutron-scheduler-validate.ts | 133 | 143 |
neutron/scheduler/neutron-scheduler-wave-types.ts | 76 | 81 |
neutron/scheduler/node/neutron-node-capabilities.ts | 82 | 89 |
neutron/scheduler/node/neutron-node-errors.ts | 121 | 131 |
neutron/scheduler/node/neutron-node-execution.ts | 174 | 185 |
neutron/scheduler/node/neutron-node-preflight.ts | 142 | 151 |
neutron/scheduler/node/neutron-node-result.ts | 80 | 86 |
neutron/scheduler/node/neutron-node-run.ts | 113 | 116 |
neutron/session/neutron-host-durable-state.ts | 23 | 25 |
neutron/session/neutron-session-activity.ts | 183 | 199 |
neutron/session/neutron-session-errors.ts | 22 | 26 |
neutron/session/neutron-session-graph-mutation.ts | 155 | 160 |
neutron/session/neutron-session-graph.ts | 232 | 239 |
neutron/session/neutron-session-mutation-proposal.ts | 118 | 127 |
neutron/session/neutron-session-review.ts | 77 | 81 |
neutron/session/neutron-session-runtime-approval.ts | 97 | 108 |
neutron/session/neutron-session-runtime-approve-apply.ts | 102 | 111 |
neutron/session/neutron-session-runtime-contract.ts | 99 | 124 |
neutron/session/neutron-session-runtime-graph.ts | 176 | 181 |
neutron/session/neutron-session-runtime-helpers.ts | 85 | 89 |
neutron/session/neutron-session-runtime-review.ts | 52 | 53 |
neutron/session/neutron-session-runtime-status.ts | 72 | 75 |
neutron/session/neutron-session-runtime-verification-retry.ts | 37 | 38 |
neutron/session/neutron-session-runtime.ts | 278 | 297 |
neutron/session/neutron-session-turn.ts | 197 | 201 |
neutron/tools/neutron-tool-authorization.ts | 257 | 268 |
neutron/tools/neutron-tool-definitions-governance.ts | 130 | 134 |
neutron/tools/neutron-tool-definitions-project.ts | 71 | 75 |
neutron/tools/neutron-tool-dispatch.ts | 231 | 246 |
neutron/tools/neutron-tool-errors.ts | 74 | 80 |
neutron/tools/neutron-tool-input.ts | 180 | 191 |
neutron/tools/neutron-tool-registry.ts | 66 | 72 |
neutron/tools/neutron-tool-router.ts | 131 | 138 |
nx-graph-entry.ts | 1 | 1 |
ollama-model-adapter.ts | 203 | 214 |
preview-extension-removal.ts | 124 | 129 |
project-profile-detection.ts | 215 | 228 |
project-profile-evidence.ts | 82 | 86 |
project-root-mutation-lock.ts | 29 | 32 |
project-scan-exclusions.ts | 71 | 76 |
propose-and-apply-extension-adoption.ts | 119 | 135 |
quality-viewmodel-entry.ts | 2 | 2 |
remove-extension.ts | 185 | 193 |
resolve-project-doctor-init.ts | 101 | 109 |
skill-markdown.ts | 18 | 32 |
task-routing.ts | 127 | 131 |
Appendix B. Measurement command notes
Recompute lines with measureProductionSource from scripts/production-file-metrics.mjs. Recompute cycles by resolving static relative imports to .ts files and running a strong-component search. The five components in section 5 are the expected result on f0b19c885d2aa95b041a4582e5218d2f3539f525.