engineering-memory 1.10.3 → 1.10.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -83,26 +83,51 @@ Temporary code written to reach or force a path — a pinned state, a fixed serv
83
83
 
84
84
  Do not write task Markdown files directly. The bridge owns event IDs, expected task versions, atomic projections, outbox state, and synchronization.
85
85
 
86
- ## Adopting a Project That Already Exists
87
-
88
- A repository bound with a working system in it can be surveyed at any time, not only at the moment
89
- it is bound. When the user asks for its architecture to be learned, read, recorded or understood,
90
- that is a survey: open it as a read-only task and follow `engineering-core.adopting-an-existing-project`,
91
- which says what a survey records and what it must never do.
92
-
93
- Four things come out of it and nothing else: the discovery policy that matches the repository's
94
- actual layout, the architecture already in place recorded on the project profile under
95
- `architecture.adopted` with the pressure each structure relieves — or `inherited, reason not
96
- recorded` where nobody knows — one module record per module saying what it owns, and one current
97
- deviation per divergence, each carrying what the rule says, what the project does, both costs, and
98
- a decision or an explicit deferral. Everything else is written as later tasks reach it.
99
-
100
- The survey changes nothing in the tree. No formatting, no renames, no tidying of dead code it
101
- finds; leftovers are recorded as observations and decided like any other divergence.
102
-
103
- Where the same product has a client and a backend, they are two projects. Adopt them separately,
104
- then link them with `project.link` once both exist, and ask before linking rather than inferring it
105
- from the names.
86
+ ## Four-mode project onboarding
87
+
88
+ Use `references/project-onboarding.md` and `engineering-core.adopting-an-existing-project` for the
89
+ full flow. Project creation asks through a native questionnaire for `greenfield`, `adopt`, or
90
+ `rework`; later incremental work is `refresh`. Read-only maturity analysis can recommend a mode but
91
+ cannot select one. Adopt, rework discovery, and refresh use committed `HEAD` by default, walk an
92
+ exhaustive cross-stack source inventory, and classify results as evidence, inference, or unknown.
93
+ The inventory covers frontend pages, navigation, state, service classes and network layers; backend
94
+ modules, services, data and API endpoints; project architecture; and the contracts connecting both
95
+ sides.
96
+
97
+ Greenfield applies compatible organization architecture modules and gates them with the real local
98
+ toolchain. Adopt and refresh never modify source. Rework asks per project whether the target keeps
99
+ behavior or redesigns it before proposing phased branches and tasks. Existing membership, active
100
+ user, tenant scope, explicit assignments, Project-first strongest-lock-first ordering, supplied
101
+ `EntityManager` transactions, immutable revisions and scope authority remain in force.
102
+
103
+ The implemented onboarding operations are `project.inspect`, `project.initialize`, `memory.source`,
104
+ `memory.sync_start`, `memory.sync_status`, `memory.sync_inventory`, `memory.sync_plan`,
105
+ `memory.sync_next`, `memory.sync_submit`, `memory.sync_reopen`, `memory.sync_delta`,
106
+ `memory.sync_verify`, `memory.catalog`, `memory.read_revisions`, and `memory.review_batch`.
107
+ `memory.sync_start` snapshots a selected Git ref, persists its commit/tree/manifest hashes and file
108
+ count, and uploads all manifest pages including exclusions. `memory.source` serves only bounded pages
109
+ or exact file reads from that committed snapshot. `memory.sync_status` lists runs or paged units and
110
+ coverage counters without exposing claim tokens.
111
+
112
+ `memory.sync_plan` uploads semantic units and their paths and dependency keys. The initial plan must
113
+ cover included and removed behavior, but analyzing may add newly discovered cross-module flow units.
114
+ Existing unit identities and definitions remain immutable; every added unit needs the same complete
115
+ submission, exact memory approval references and final verification before the run can complete.
116
+ `memory.sync_next` claims a distinct unit for 15 minutes;
117
+ the saved claim token explicitly resumes or renews that claim. `memory.sync_submit` records evidence,
118
+ all behavior facets, gaps and exact proposal or unchanged revision references. No unit is autoapproved,
119
+ and no historical task or motivation may be invented. Rejected or gapped unfinished units use
120
+ `memory.sync_reopen` with the current expected version. `memory.sync_delta` compares a completed prior
121
+ run's content hashes, memory revisions and transitive dependencies.
122
+
123
+ `memory.review_batch` displays full proposal texts before a durable native questionnaire records the
124
+ exact proposal IDs, content digests and base revisions. Pending or dismissed approval writes nothing;
125
+ stale batches fail atomically. `memory.sync_verify` requires sealed inventory, complete semantic and
126
+ removed-file coverage, submitted evidence, no unresolved gaps or failed unknown execution, and
127
+ approved immutable references for changed memory. `questionnaire.ask` and `questionnaire.resume`
128
+ support `preparation: true` for missing-folder decisions; `project.initialize` uses that native
129
+ confirmation before preparing the folder and Git repository. Raw secrets, headers, customer payloads
130
+ and PII are never uploaded.
106
131
 
107
132
  ## The Task Baseline
108
133
 
@@ -0,0 +1,159 @@
1
+ # Project onboarding and memory refresh
2
+
3
+ ## Choose the journey before changing the repository
4
+
5
+ Call `project.inspect` for the selected directory, including a missing directory. Its maturity
6
+ classification is `missing`, `empty`, `scaffold` or `established`, supported by manifests and
7
+ architecture/state/service/network/data/screen evidence. These are observations, not a mode choice.
8
+ Explain the appropriate options to the user and use `project.onboard` (or `project.initialize` for
9
+ initial Git preparation). The tool opens native forms for the actual mode and profile; do not write
10
+ an answer in chat or infer a choice from the directory classification.
11
+
12
+ The modes are `greenfield`, `adopt`, `rework` and `refresh`. Initial onboarding offers the first three;
13
+ refresh is available for a selected existing project at any later time. Recognize the user's intent
14
+ semantically in their own phrasing, with no keyword trigger table. Rework asks preserve or redesign
15
+ explicitly. Choosing another mode than the proposed input returns that choice without changing files;
16
+ repeat with the same requestKey and the user's selected mode.
17
+
18
+ Use a stable requestKey per onboarding occurrence. Profile answers must be collected with native
19
+ forms; each independent field is reviewed separately with its current value visible. The user may
20
+ keep it, explicitly defer it, or request an edit in the same bounded native text field. An edited value
21
+ is persisted as part of the exact decision and reaches the final profile digest; it cannot be silently
22
+ replaced by a later chat value. The onboarding forms confirm the exact
23
+ stack/runtime/architecture, service/API/auth/storage/environment choices and existing backend project
24
+ IDs. For Flutter/React they additionally confirm Figma, color palette, font families and text styles,
25
+ design system, navigation, platforms and languages; for Nest/Spring they confirm migration strategy.
26
+ An explicit absence or deferral is acceptable; a made-up answer is not.
27
+ The local machine's installed runtime is validation capability, not an architecture preference.
28
+
29
+ `project.initialize` only prepares Git for the approved greenfield mode. It supports missing, empty
30
+ and barely-started non-Git directories without overwriting existing files; parent repositories and
31
+ symbolic links are protected. Choices persist in user-local Engineering Memory state outside the
32
+ repository and installed package. After creating/selecting the backend project, pass projectId to
33
+ `project.onboard` to store its exact choice in the project onboarding history. Include the confirmed
34
+ profile in the normal project/profile proposal; onboarding choices do not independently activate
35
+ engineering rules. `project.onboarding_status` reads those choices and any rework plans. Old projects
36
+ remain uninspected until they opt in.
37
+
38
+ If a native form is pending, preserve its identifier and resume it. A wizard can return the next
39
+ pending form after one answer is accepted; complete that form and call the originating onboarding
40
+ operation again to advance. Restart reuses answered questions and exact choice data. It never assumes
41
+ approval after a cancellation, empty response or timeout.
42
+
43
+ ## Greenfield architecture and links
44
+
45
+ Prepare and bind the repository through the existing project.setup flow, then use architecture.plan
46
+ and architecture.module with the approved project profile. Apply the matching Flutter, React, NestJS
47
+ or Spring templates through the scaffold task lifecycle. Replace technical demonstration inputs with
48
+ approved application profile values; a compile fixture is not a user product or a ready live API.
49
+ Flutter exposes injected service/transport, state lifecycle and cancellation, storage boundary,
50
+ navigation and profile-controlled palette/typography. Validate the actual selected toolchain.
51
+
52
+ List authorized backend/frontend projects when services may already exist. Offer the actual selected
53
+ project IDs in the native profile form. Create approved links with project.link; a selection alone
54
+ never changes a link, and fullstack discipline never replaces membership or link authority. Keep
55
+ unavailable service contracts explicit rather than inventing endpoint behavior.
56
+
57
+ ## Durable deep learning
58
+
59
+ Adopt, refresh and the learning stage of rework do not modify application source. They inventory and
60
+ learn the whole architecture: modules, service classes, network and API contracts, state management,
61
+ persistence/data models/migrations, navigation, screens/components, localization, deployment,
62
+ authentication, runtime/toolchain and cross-module/end-to-end flows. Record source facts, tested
63
+ behavior, inference and unknown historical reasons separately. Never fabricate historical tasks,
64
+ prior developer decisions or reasons the code cannot establish.
65
+
66
+ 1. `memory.sync_start` opens a durable native confirmation bound to the mode, committed source hash
67
+ and previousRunId/rework behavior. Only acceptance starts the run. It snapshots the selected HEAD
68
+ or explicit ref, uploads every manifest page with exclusion reasons and seals the inventory.
69
+ Dirty worktree changes never silently enter shared memory. Repeating an occurrence reuses its key;
70
+ another commit requires a new occurrence and its own exact confirmation.
71
+ 2. `memory.source` pages the committed manifest or bounded chunks of one exact-commit file. Follow
72
+ nextCursor/nextOffset until null. Exclusions are reviewable evidence; inspect suspicious exclusions
73
+ and correct the classifier rather than declaring an incomplete project fully learned. Large owned
74
+ files remain in scope; bounded Git reads at the same commit can supplement the tool.
75
+ 3. `memory.sync_plan` creates meaningful semantic units with module keys, knowledge kinds, source
76
+ paths and dependency unit keys. Declare applicable architecture/state/services/network/data/UI/flow
77
+ areas and justify absence with source evidence. File coverage is necessary but does not certify
78
+ semantic understanding. Do not collapse an application into a generic all-files summary.
79
+ 4. `memory.sync_next` leases one unit for fifteen minutes. Save claimToken and use distinct requestKeys
80
+ for parallel workers; retry the same key after response loss. `memory.sync_status` exposes progress
81
+ and missing units without exposing another worker's token. No database transaction spans analysis.
82
+ 5. `memory.sync_submit` attaches per-path source or actual execution evidence and explicit findings
83
+ for entry, exit, authority, effects, errors, cancellation, retry, persistence and dependencies.
84
+ Link concrete witnesses; lack of applicability needs evidence and a reason. A source read and a
85
+ successful test are separate claims. Automated structural checks cannot prove the prose is true;
86
+ review the complete module package against actual code and tests before approval.
87
+ 6. Reuse the normal KnowledgeResource → pending Proposal → immutable Revision model. Present complete
88
+ module records, source evidence, uncertainty, deviations and archival actions. `memory.review_batch`
89
+ binds native approval to exact IDs, content hashes and base revisions, and reviews atomically under
90
+ existing authority. Deferring makes no change; when the user wants to reconsider, use its returned
91
+ nextReviewAttempt. Retrying the old attempt preserves the deferral, not an invented approval.
92
+ 7. `memory.sync_reopen` uses expectedVersion to repair an unfinished unit. `memory.sync_verify` requires
93
+ sealed inventory, source/removed-path and declared-area coverage, valid evidence, resolved gaps and
94
+ approved exact memory references. It cannot replace the Git diff gate for any source-writing task.
95
+
96
+ ## Incremental refresh and Git evidence
97
+
98
+ Use a completed previousRunId. `memory.sync_delta` refuses an unsealed new inventory and pages changed
99
+ units and dependent flows. With repoRoot on the first page it adds bounded Git history/rename evidence;
100
+ `memory.source` with previousCommit and commit can read further source change pages. Commit IDs and
101
+ source trees establish provenance; commit messages do not establish developer intent. Squash or
102
+ rewritten/missing history falls back explicitly to the persisted file/blob comparison. A missing
103
+ commit is not proof of zero changes.
104
+
105
+ Review renames against existing resource identities and propose selector relocation rather than
106
+ unnecessarily creating duplicate records. Removed behavior requires reviewed archival with the old
107
+ identity; revision history is retained. Code deviating from a rule does not silently change that rule.
108
+ Known changed memory invalidates its units/dependants. New records are compared against selectors;
109
+ unscoped records may require conservative review because there is no defensible narrow scope.
110
+ A source/memory no-op reuses approved evidence with provenance and creates no gratuitous revisions.
111
+
112
+ At module boundaries read memory.sync_status with repoRoot. If newer commits exist, keep the pinned
113
+ inspection unchanged and start a new `memory.sync_start` refresh occurrence with the follow-up commit
114
+ and previousRunId; never silently move its baseline or call old coverage current. Read-only completion
115
+ is a coverage decision, not an implementation verification. Long-running analysis must checkpoint its
116
+ remaining units and decisions durably.
117
+
118
+ The core pack is intentionally bounded. Linked contracts remain inline while they fit the budget; when
119
+ the response reports `additionalMemory`, read the full authorized catalogue with
120
+ `memory.catalog({projectId, includeLinked: true, afterId, limit})`, then use the current session with
121
+ `memory.read_revisions` for the exact revision IDs needed by the task. Do not assume the core pack is
122
+ exhaustive. `memory.catalog` is the paging surface for linked project memory; it does not grant access
123
+ or change project links.
124
+
125
+ For source orientation, prefer the bounded summary returned by `project.inspect` and its nested stack
126
+ signals. Its `totalFiles`, `omittedFiles`, `prunedDirectories` and `historyTruncated` fields are part
127
+ of the evidence: a nonzero omission or truncated history requires bounded follow-up, not a claim that
128
+ the tree or history was fully read. Use the existing paged `memory.source` pages only for the committed
129
+ paths and symbols required by the chosen unit; do not request or serialize an unbounded full tree.
130
+
131
+ ## Rework target and execution
132
+
133
+ Complete deep learning first. Propose and approve target architecture in existing immutable knowledge;
134
+ redesign also requires the intended screens, flows and API/service contracts. Build a dependency-ordered
135
+ phase plan with acceptance criteria and branch names, covering every inspected unit by key. Present it
136
+ in full. `project.rework_plan` opens a native form for that exact source/target/phase digest and persists
137
+ real WorkItems and their dependencies; stale targets, incomplete learning or changed idempotency inputs
138
+ must refuse before partial creation. Deferred plans can be submitted under a new explicit requestKey
139
+ when the user requests review again.
140
+
141
+ Each phase opens an ordinary implementation task on its recorded branch in a separate worktree where
142
+ needed. Preserve all lease, history, reconciliation, self-review, validation, verify, close and delivery
143
+ gates. Cross-project phases use existing work_item.plan/confirm_plan with explicit scope authorization
144
+ and independent per-repository runs. Planning tasks does not perform their implementation.
145
+
146
+ A deferred individual field or final profile saves no onboarding choice. Retrying that request preserves its deferral. When the user explicitly resumes, use the returned `nextRequestKey` for fresh native decisions; never infer approval from a previous defer.
147
+
148
+ ## Inspection confirmation language
149
+
150
+ For memory.sync_start, pass language: tr in a Turkish conversation and language: en in an English
151
+ conversation. Use the conversation language, never the computer locale. Legacy calls without language
152
+ use English. The form shows a short source reference, scope, the treatment of uncommitted changes and
153
+ the separate approval needed for permanent memory. Full commit and request hashes stay in the durable
154
+ approval binding, not in the visible question. Generic questionnaire.ask messages and option labels
155
+ are written by the agent in the same language; pass language for the native help and field labels.
156
+
157
+ An existing exact-request questionnaire retains its original wording and answer across updates and
158
+ restart, including an older English form. Resume that question rather than silently replacing or
159
+ withdrawing it. Language changes never broaden the approved source, mode or previous-run scope.
@@ -60,7 +60,7 @@ Switching off records the decision and ends the subject. Switching back on clear
60
60
 
61
61
  Changing the organization always means asking for the project again afterwards, because a project belongs to exactly one organization and the old answer cannot survive the change. Run the organization questionnaire, then the project one, then bind the repository to the chosen project with `project.resolve` so the local binding matches what the user just said.
62
62
 
63
- When the repository being bound already has a working system in it — code somebody else wrote, a shape nobody here decided — say so and offer the survey rather than starting as though the project began now. Ask whether to adopt it: read what is there, record its modules, its architecture and the discovery policy that matches its actual layout, and list where it diverges from the rules with what changing and keeping each one would cost. Do not offer a single choice between reworking the project and leaving it alone; that question is asked once per divergence, after the survey, and the adoption rule says why. The survey is a read-only task and changes nothing.
63
+ When the repository being bound already has a working system in it — code somebody else wrote, a shape nobody here decided — present the three project creation modes. Adopt and rework both begin with the exhaustive cross-stack inventory described below; rework then asks per project whether the target preserves behavior or redesigns it. Do not offer a single choice between reworking the project and leaving it alone before the evidence exists. The inventory is read-only and changes nothing.
64
64
 
65
65
  A task that is still open blocks the switch, and says so plainly. Its lease, its journal and its checkpoints all belong to the project it was opened against, and carrying them into another one records work under a project it did not happen in. Close the open task first, or abandon it with `task.abandon` once the user has said that is what they want, and only then switch. This is about this session's own task and nothing else: another person's unfinished task in the same repository never blocks anything.
66
66
 
@@ -68,11 +68,34 @@ A task that is still open blocks the switch, and says so plainly. Its lease, its
68
68
 
69
69
  Ask whether the current repository belongs to an existing accessible project, should become a new project, or should skip Engineering Memory for this task. When an existing project is chosen, present only projects returned for the authenticated user. Confirm the project selection before saving its user-local binding; no repository file is written.
70
70
 
71
- For a repository the backend has not seen before, ask whether this is an existing codebase import or a greenfield project. Before a local binding or backend task exists, an existing-codebase import may perform one bounded local read-only structural and Figma discovery pass. It must not edit code. Use the findings in a native questionnaire to confirm the initial project profile and the repository-relative patterns that identify new memory resources. Send them as `discoveryUnits`, one unit per kind the project actually has: a client project declares `screen_logic` and `component_mapping`, and a server-side project declares `module_logic`, `data_model` and `api_endpoint` against its own layout. Never ask a server-side project for screen patterns, and never invent a unit for a kind the repository does not contain. Then call `project.setup`; the backend creates the project, owner membership, active profile revision, and pinned discovery policy atomically. Persist the user-local binding only after that succeeds, then start the normal `session.bootstrap` lifecycle. Later discoveries are reviewable memory proposals.
72
-
73
- Greenfield setup asks for project name, framework, the response envelope, the exception model, authentication needs, localization languages, storage policy, and the initial discovery patterns. A client project is also asked for the Figma library and screen links if available, the design token sources, the page architecture and the navigation pattern; a server-side project is asked instead for the data layer, the migration tool and how configuration and secrets arrive. A Spring project must also name Maven or Gradle, its Java release, its exact Spring Boot version and its `javax` or `jakarta` namespace before any architecture template is offered; `Spring Boot` alone is not enough information to select compatible source. Record those confirmed values in `initialProjectProfile.metadata.runtimeContract` as `language: "java"`, `languageVersion`, `framework: "spring-boot"`, `frameworkVersion`, `buildTool` and `namespace`. Never infer or invent this object. The backend compares it with each source module and returns no incompatible module; an absent contract means broad Spring rules still apply but no constrained source template is offered. Ask what the project is before deciding which list applies. Do not save a binding unless the setup response contains the active initial profile and discovery policy.
74
-
75
- After setup, ask whether to build the project from the organization architecture templates. If the user accepts, follow `scaffolding.md`: confirm the optional modules, then confirm the package name and the concrete class name behind every rename placeholder in one questionnaire, then ask for each required asset role and each tenant-specific value the templates deliberately leave open.
71
+ For a repository the backend has not seen before, ask for the project mode through a native
72
+ questionnaire: `greenfield`, `adopt`, or `rework`. Maturity inspection is read-only evidence and may
73
+ recommend a mode, but it never selects one. Adopt and rework perform an exhaustive cross-stack source
74
+ inventory from committed `HEAD` by default, covering frontend pages/navigation/state/service classes/
75
+ network layers, backend modules/services/data/API, project architecture and connecting contracts.
76
+ The agent labels evidence, inference and unknown while the backend
77
+ persists coverage. There is no bounded survey and no source mutation. Use `project.onboard` with the confirmed mode and profile; only greenfield calls `project.initialize`
78
+ to prepare Git. Send repository-relative discovery units through the existing project.setup/profile
79
+ contract, not as extra initialize fields. A client declares
80
+ `screen_logic` and `component_mapping`; a server declares `module_logic`, `data_model` and
81
+ `api_endpoint`. Never invent a unit the repository does not contain.
82
+
83
+ Greenfield setup asks for project name, framework, runtime/toolchain contract, response envelope,
84
+ exception model, authentication, localization, storage policy and discovery patterns. A client is
85
+ also asked for Figma and navigation context; a server is asked for its data layer and configuration
86
+ source. Spring still requires Maven or Gradle, Java release, exact Spring Boot version and
87
+ `javax`/`jakarta` namespace before compatible templates are offered. Never infer these values.
88
+ Rework asks per project whether the approved target preserves behavior or redesigns it. Existing
89
+ project membership, active user, tenant scope, explicit code/privacy assignments and scope authority
90
+ remain in force.
91
+
92
+ After setup, greenfield asks whether to build from organization architecture templates. If accepted,
93
+ follow `scaffolding.md`. For Flutter, the template's real SDK gate must run against the local PATH
94
+ or configured command; missing Flutter is a red result and never triggers a download. Existing
95
+ projects may later use `refresh`, which requires confirmed natural intent and native confirmation,
96
+ uses committed `HEAD` by default, persists resumable units, and never triggers from keywords.
97
+ Module-batched proposal approval binds exact hashes and source revision; incomplete or stale batches
98
+ fail, and raw secrets, headers, customer payloads and PII are excluded.
76
99
 
77
100
  ## Project Membership
78
101
 
@@ -179,3 +202,53 @@ When installing enforcement and an existing pre-commit hook is present, offer:
179
202
  - Cancel hook installation
180
203
 
181
204
  Never overwrite or delete an unknown hook.
205
+
206
+ ### Exact onboarding decisions
207
+
208
+ Use project.onboard/project.initialize for the four-mode choice and stack-specific profile. Their
209
+ native forms review each independent profile field with its current value visible. Keep and explicit
210
+ deferral are durable answers; an edit uses the bounded native text field in that same question and is
211
+ stored in the exact profile decision. Client profiles
212
+ include Figma, palette, typography/font families/text styles, design system, navigation, platforms and
213
+ languages. Backend profiles include API, auth, storage, migration and environments. Empty knowledge is
214
+ an explicit absence or deferral, never a guessed preference. project.inspect returns a maturity
215
+ classification; it does not select a mode. Choices persist locally before Git and project-wide after
216
+ selecting a project.
217
+
218
+ memory.sync_start confirms the exact committed source and mode before starting adopt/refresh/rework.
219
+ project.rework_plan confirms an exact approved target and phase digest after learning. memory.review_batch
220
+ reviewAttempt distinguishes a new requested review from a retry of a previously deferred batch. Do not
221
+ turn defer into approve or loop new attempts without the user's intent to reconsider.
222
+
223
+ The initial context pack may be budgeted. If it reports `additionalMemory`, use
224
+ `memory.catalog({projectId, includeLinked: true, afterId, limit})` to page all authorized linked
225
+ resource headers, then call `memory.read_revisions` with the current session for the exact revisions
226
+ needed. Never assume that the core pack contains every linked record. Source inspection should begin
227
+ with the bounded orientation summary from `project.inspect`; use paged committed-source reads for the
228
+ units being learned.
229
+
230
+ ### Explicit withdrawal and initialization continuation
231
+
232
+ When the user explicitly cancels the owning work, call `questionnaire.withdraw` with its exact
233
+ identifier and repository/preparation scope. Withdrawal is durable, creates no approval, rejects late
234
+ answers and removes only that pending question from entry/resume. A timeout or dismissed form is not
235
+ cancellation of the work; unanswered decisions remain pending without automatic expiry. Other tasks
236
+ can continue independently. A withdrawn workflow needs a new request key only if the user starts it
237
+ again.
238
+
239
+ `project.onboard` can save the profile before initialization. Calling `project.initialize` with the
240
+ same request key reuses the profile answers and asks a separate exact Git-initialization confirmation.
241
+ Saving a profile does not authorize filesystem initialization.
242
+
243
+ ## Inspection confirmation language
244
+
245
+ For memory.sync_start, pass language: tr in a Turkish conversation and language: en in an English
246
+ conversation. Use the conversation language, never the computer locale. Legacy calls without language
247
+ use English. The form shows a short source reference, scope, the treatment of uncommitted changes and
248
+ the separate approval needed for permanent memory. Full commit and request hashes stay in the durable
249
+ approval binding, not in the visible question. Generic questionnaire.ask messages and option labels
250
+ are written by the agent in the same language; pass language for the native help and field labels.
251
+
252
+ An existing exact-request questionnaire retains its original wording and answer across updates and
253
+ restart, including an older English form. Resume that question rather than silently replacing or
254
+ withdrawing it. Language changes never broaden the approved source, mode or previous-run scope.
@@ -6,12 +6,21 @@ Architecture templates are source modules stored as approved engineering memory.
6
6
 
7
7
  Engineering rules, quality gates and architecture templates all live on the organization. A project created in a fresh organization inherits none of them.
8
8
 
9
- Call `organization.list` and ask the user which organization the project belongs to before `project.setup`. Creating a new organization is a separate, explicit choice: state plainly that the project will start with no engineering core and no architecture templates, and pass the acknowledgement only after the user confirms that.
9
+ Call `organization.list` and ask the user which organization the project belongs to before
10
+ `project.setup`. If the repository folder is missing, use `questionnaire.ask` or
11
+ `questionnaire.resume` with `preparation: true`; `project.initialize` asks the native confirmation
12
+ before creating the folder and Git repository. Each initialization occurrence carries a unique
13
+ `requestKey`; retries reuse that key, while a new occurrence cannot be authorized by an old answer.
14
+ Preparation question wording omits personal absolute paths from the stored question. Creating a new organization is a separate, explicit
15
+ choice: state plainly that the project will start with no engineering core and no architecture
16
+ templates, and pass the acknowledgement only after the user confirms that.
10
17
 
11
18
  ## Apply sequence
12
19
 
13
20
  1. Open the task in `scaffold` mode and complete the normal bootstrap, discovery and `context.prepare_change` steps. Prepare the full set of intended paths before the first write.
14
- 2. Call `architecture.plan`. It returns each module's manifest in apply order with its dependencies, rename map, string replacements, pubspec dependencies, asset contract and tenant-specific points. It carries no file bodies.
21
+ 2. Call `architecture.plan`. It returns each module's manifest in apply order with its dependencies,
22
+ rename map, string replacements, package dependencies, asset contract and tenant-specific points.
23
+ It carries no file bodies.
15
24
  3. Present the optional modules through the native questionnaire. A package-shaped project usually skips the application modules; an application usually takes them.
16
25
  4. Treat the modules returned by the backend as the compatibility boundary: it compares each manifest's `compatibility` object with the approved project profile `runtimeContract` before returning it. Read both contracts back and confirm them in the questionnaire; never add a module the plan withheld or substitute a conversational guess. For Spring, the comparison covers Java release, exact Spring Boot release line, build tool and `javax` or `jakarta` namespace. If the plan is empty, say that no compatible starter exists and continue without scaffolding; never upgrade or downgrade the project to make a template fit.
17
26
  5. Confirm the naming decisions in one questionnaire: package name and the concrete class name behind every rename placeholder. Never invent a name the user did not choose.
@@ -19,7 +28,7 @@ Call `organization.list` and ask the user which organization the project belongs
19
28
  7. Merge every module's `packageDependencies` into the project's dependency manifest — `pubspec.yaml`, `package.json`, whatever the stack uses. Keep the existing constraint when a dependency already exists and report the conflict.
20
29
  8. Satisfy the `assetContract`. Ask the user for each required asset role. Never invent an asset, never ship a placeholder binary, and never copy a licensed font from another project.
21
30
  9. Resolve every `tenantSpecific` point through the questionnaire: base URLs, backend header contracts, storage key prefixes, supported locales, bundle identifiers. These are deliberately absent from the template. Do not guess them.
22
- 10. Run the stack's generator, compiler or type checker against every emitted source file before calling the scaffold complete. If the required local compiler is unavailable or below the selected template's declared release, stop with the exact tool and version needed rather than claiming the source is valid. This refusal applies only to applying that template, not to using Engineering Memory with an existing project. Then run code generation, localization generation, static analysis and tests that the project requires.
31
+ 10. Run the stack's generator, compiler or type checker against every emitted source file before calling the scaffold complete. If the required local compiler is unavailable or below the selected template's declared release, stop with the exact tool and version needed rather than claiming the source is valid. This refusal applies only to applying that template, not to using Engineering Memory with an existing project. Then run code generation, localization generation, static analysis and tests that the project requires. The shipped Flutter gate runs the local SDK's `pub get`, `analyze --no-pub` and `test --no-pub`; it accepts `ENGINEERING_MEMORY_FLUTTER_COMMAND` for a Windows `.bat` launcher and never downloads an SDK.
23
32
  11. Reconcile each applied template resource with a `scaffold_applied` reconciliation carrying a short reason, then run `task.verify`.
24
33
 
25
34
  ## What scaffold mode does and does not relax
@@ -34,6 +43,6 @@ Write the first real unit of work — a screen, a resource — as a separate `wr
34
43
 
35
44
  When a task establishes a new shared architecture structure, or changes one the templates carry, the template is now stale. Propose the template revision through `memory.propose_revision` with `scope: organization` and `kind: architecture_template`, and let the user approve it like any other permanent memory change.
36
45
 
37
- A template revision must keep its manifest and its content in step: every `## file:` block has a matching `files[]` entry with the same path, byte count and SHA-256, in the same order. The backend rejects a revision whose manifest and content disagree.
46
+ A template revision must keep its manifest and its content in step: every `## file:` block has a matching `files[]` entry with the same path, byte count and SHA-256, in the same order. The backend rejects a revision whose manifest and content disagree. Product defaults are parsed from front matter into `architecture-template/v1`: `scope` is product or organization, `stack` and `moduleKey` are lowercase slugs, `applyOrder` is an integer, `dependsOn` contains lowercase module slugs, `packageDependencies` is a valid `name@constraint` list, and every fenced file block is represented exactly once. `assetContract` and `tenantSpecific` default to empty arrays; they must not be simulated with placeholder assets or hidden template tokens. Validate defaults with the backend product-default loader/parser as well as a compiler.
38
47
 
39
48
  Templates carry source, not secrets. Never place a real base URL, token, customer payload, licensed binary or personal path in a template revision.