@buaa_smat/hometrans 0.1.13 → 0.1.14
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.
- package/README.md +164 -112
- package/agents/build-fixer.md +384 -394
- package/agents/code-reviewer.md +240 -240
- package/agents/logic-coder.md +199 -199
- package/agents/logic-context-builder.md +194 -194
- package/agents/review-fixer.md +405 -405
- package/agents/self-test-fixer.md +296 -296
- package/agents/self-tester.md +393 -392
- package/agents/spec-generator.md +540 -540
- package/dist/cli/config-store.js +84 -8
- package/dist/cli/config.js +3 -3
- package/dist/cli/env-vars.js +129 -0
- package/dist/cli/init.js +272 -272
- package/dist/cli/uninstall.js +152 -17
- package/dist/context/index.js +10 -197
- package/env-requirements.json +3 -3
- package/package.json +1 -1
- package/resource/choose_editor.png +0 -0
- package/resource/common_config.png +0 -0
- package/resource/integration_test_config.png +0 -0
- package/resource/set_env.png +0 -0
- package/resource/ui_align_config.png +0 -0
- package/skills/hmos-batch-ui-align/SKILL.md +108 -98
- package/skills/hmos-batch-ui-align/references/conversion-procedure.md +180 -180
- package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
- package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
- package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
- package/skills/hmos-batch-ui-align/references/mvvm/@Link/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/217/214/345/220/221/345/220/214/346/255/245.md +648 -648
- package/skills/hmos-batch-ui-align/references/mvvm/@Observed/350/243/205/351/245/260/345/231/250/345/222/214@ObjectLink/350/243/205/351/245/260/345/231/250/357/274/232/345/265/214/345/245/227/347/261/273/345/257/271/350/261/241/345/261/236/346/200/247/345/217/230/345/214/226.md +2088 -2088
- package/skills/hmos-batch-ui-align/references/mvvm/@Prop/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/215/225/345/220/221/345/220/214/346/255/245.md +1033 -1033
- package/skills/hmos-batch-ui-align/references/mvvm/@Provide/350/243/205/351/245/260/345/231/250/345/222/214@Consume/350/243/205/351/245/260/345/231/250/357/274/232/344/270/216/345/220/216/344/273/243/347/273/204/344/273/266/345/217/214/345/220/221/345/220/214/346/255/245.md +1183 -1183
- package/skills/hmos-batch-ui-align/references/mvvm/@State/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/347/212/266/346/200/201.md +576 -576
- package/skills/hmos-batch-ui-align/references/mvvm/@Track/350/243/205/351/245/260/345/231/250/357/274/232class/345/257/271/350/261/241/345/261/236/346/200/247/347/272/247/346/233/264/346/226/260.md +297 -297
- package/skills/hmos-batch-ui-align/references/mvvm/@Watch/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/346/233/264/346/224/271/351/200/232/347/237/245.md +395 -395
- package/skills/hmos-batch-ui-align/references/mvvm/AppStorage/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200/347/232/204UI/347/212/266/346/200/201/345/255/230/345/202/250.md +902 -902
- package/skills/hmos-batch-ui-align/references/mvvm/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md +106 -106
- package/skills/hmos-batch-ui-align/references/mvvm/LocalStorage/357/274/232/351/241/265/351/235/242/347/272/247UI/347/212/266/346/200/201/345/255/230/345/202/250.md +1178 -1178
- package/skills/hmos-batch-ui-align/references/mvvm/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md +911 -911
- package/skills/hmos-batch-ui-align/references/mvvm/PersistentStorage/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +354 -354
- package/skills/hmos-batch-ui-align/references/mvvm//347/256/241/347/220/206/345/272/224/347/224/250/346/213/245/346/234/211/347/232/204/347/212/266/346/200/201/346/246/202/350/277/260.md +11 -11
- package/skills/hmos-convert-pipeline/SKILL.md +429 -415
- package/skills/hmos-fix-build-errors/SKILL.md +272 -273
- package/skills/hmos-fix-build-errors/references/arkts-strict-patterns.md +219 -219
- package/skills/hmos-fix-build-errors/references/known-patterns.md +157 -157
- package/skills/hmos-fix-build-errors/references/rdb-entity-pattern.md +131 -131
- package/skills/hmos-incremental-ui-align/SKILL.md +219 -200
- package/skills/hmos-incremental-ui-align/diff_analysis.md +52 -52
- package/skills/hmos-incremental-ui-align/page_align.md +62 -62
- package/skills/hmos-incremental-ui-align/readme.md +237 -230
- package/skills/hmos-incremental-ui-align/references/Comparison_Template.md +2 -2
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Link/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/217/214/345/220/221/345/220/214/346/255/245.md +648 -648
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Observed/350/243/205/351/245/260/345/231/250/345/222/214@ObjectLink/350/243/205/351/245/260/345/231/250/357/274/232/345/265/214/345/245/227/347/261/273/345/257/271/350/261/241/345/261/236/346/200/247/345/217/230/345/214/226.md +2088 -2088
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Prop/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/215/225/345/220/221/345/220/214/346/255/245.md +1033 -1033
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Provide/350/243/205/351/245/260/345/231/250/345/222/214@Consume/350/243/205/351/245/260/345/231/250/357/274/232/344/270/216/345/220/216/344/273/243/347/273/204/344/273/266/345/217/214/345/220/221/345/220/214/346/255/245.md +1183 -1183
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@State/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/347/212/266/346/200/201.md +576 -576
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Track/350/243/205/351/245/260/345/231/250/357/274/232class/345/257/271/350/261/241/345/261/236/346/200/247/347/272/247/346/233/264/346/226/260.md +297 -297
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Watch/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/346/233/264/346/224/271/351/200/232/347/237/245.md +395 -395
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/AppStorage/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200/347/232/204UI/347/212/266/346/200/201/345/255/230/345/202/250.md +902 -902
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md +106 -106
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/LocalStorage/357/274/232/351/241/265/351/235/242/347/272/247UI/347/212/266/346/200/201/345/255/230/345/202/250.md +1178 -1178
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/MVVM/346/250/241/345/274/217V1.md +911 -911
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/PersistentStorage/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +354 -354
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243//347/256/241/347/220/206/345/272/224/347/224/250/346/213/245/346/234/211/347/232/204/347/212/266/346/200/201/346/246/202/350/277/260.md +11 -11
- package/skills/hmos-incremental-ui-align/references/UI_Analysis_Template.md +3 -3
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
- package/skills/hmos-incremental-ui-align/scripts/navigation-capure.md +37 -37
- package/skills/hmos-integration-test/SKILL.md +380 -369
- package/skills/hmos-integration-test/readme.md +309 -309
- package/skills/hmos-resources-convert/SKILL.md +623 -623
- package/skills/hmos-resources-convert/references/conversion-rules.md +663 -663
- package/skills/hmos-resources-convert/references/dependency-analysis-rules.md +388 -388
- package/skills/hmos-resources-convert/references/resource-mapping-rules.md +457 -457
- package/skills/hmos-resources-convert/references/xml-drawable-to-svg-rules.md +513 -513
- package/skills/hmos-spec-generate/SKILL.md +331 -331
- package/skills/hmos-spec-generate/references/android-platform-tokens.md +105 -105
- package/skills/hmos-spec-generate/references/spec-sample-1.md +78 -78
- package/skills/hmos-spec-generate/references/spec-sample-2.md +58 -58
- package/skills/hmos-spec-generate/references/spec-sample-3.md +116 -116
- package/skills/hmos-spec-generate/references/step4-report-template.md +33 -33
- package/tools/test-tools/autotest/README.md +33 -17
- package/tools/test-tools/autotest/self_test_runner.py +109 -15
- package/resource/hometrans_config.png +0 -0
- package/skills/hmos-incremental-ui-align/config-example.json +0 -11
- package/tools/test-tools/autotest/config.yaml.example +0 -58
|
@@ -1,194 +1,194 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: logic-context-builder
|
|
3
|
-
description: "Constrain HarmonyOS ArkTS app changes into an executable decision contract."
|
|
4
|
-
color: blue
|
|
5
|
-
min-model: sonnet
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Inputs
|
|
9
|
-
|
|
10
|
-
- `
|
|
11
|
-
- `
|
|
12
|
-
- `
|
|
13
|
-
- `
|
|
14
|
-
|
|
15
|
-
## Tools
|
|
16
|
-
|
|
17
|
-
Platform context query:
|
|
18
|
-
|
|
19
|
-
python3 {scripts}/platform_context_query.py \
|
|
20
|
-
--request {output_path}/platform-context-request.json \
|
|
21
|
-
--out-dir {output_path}/platform-context-{N}
|
|
22
|
-
|
|
23
|
-
Unique `{N}` per query; do not reuse out-dir. Request JSON: `stage`
|
|
24
|
-
("planner"), `focus_point`, `task_excerpt`, `project_evidence`,
|
|
25
|
-
`platform_surfaces`, `extra_constraints`, optional `api_level`. Read result from
|
|
26
|
-
`platform-context-result.json`; consume `structured_evidence` first, then raw
|
|
27
|
-
`evidence` only if needed. The query returns evidence, not authority. Follow-up
|
|
28
|
-
only if first result is unknown and blocks the decision. If evidence is missing
|
|
29
|
-
or conflicting and the fact blocks, note as blocking `Unknown`.
|
|
30
|
-
|
|
31
|
-
## Contract
|
|
32
|
-
|
|
33
|
-
Planner writes one short `plan.md` decision contract. It narrows the solution
|
|
34
|
-
space; it does not code, ask, modify files, wait for approval, or leave required
|
|
35
|
-
decisions to coder.
|
|
36
|
-
|
|
37
|
-
Required decisions: `target surface`, `truth owner/source`, `access path`,
|
|
38
|
-
`forbidden paths`, `completion evidence`, and blocking `Unknown`.
|
|
39
|
-
|
|
40
|
-
Emit only the `plan.md` body, starting with `## Decision Contract`.
|
|
41
|
-
|
|
42
|
-
## Procedure
|
|
43
|
-
|
|
44
|
-
Causal chain (commit downstream nodes only after upstream is resolved; file
|
|
45
|
-
reads may happen in any order but each must advance the next unresolved node):
|
|
46
|
-
|
|
47
|
-
```text
|
|
48
|
-
requested outcome -> target surface/effect -> truth owner/source -> writer ->
|
|
49
|
-
reader/consumer -> triggered edge paths -> protected non-target behavior
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Every read must advance a chain node. Do not read beyond chain-relevant files.
|
|
53
|
-
Promote files to edit only after chain justifies them. Use retrieval before
|
|
54
|
-
broad local reading.
|
|
55
|
-
|
|
56
|
-
At any node, trigger as needed:
|
|
57
|
-
- Project facts narrow the choice (per Project Truth).
|
|
58
|
-
- Unproven platform dependency → verify per Platform Behavior.
|
|
59
|
-
- Write/read path change → verify per Semantic Closure.
|
|
60
|
-
- Verification invalidates upstream → backtrack.
|
|
61
|
-
|
|
62
|
-
Termination: all nodes resolved or blocked → write `{output_path}/plan.md`.
|
|
63
|
-
Unresolved node blocks dependents. No candidate lists, `A or B`, or "coder
|
|
64
|
-
chooses."
|
|
65
|
-
|
|
66
|
-
Evidence priority: visible/resource text > render/caller path >
|
|
67
|
-
producer/consumer > route/menu > file/class names. Reject name-only/comment-only.
|
|
68
|
-
|
|
69
|
-
1. Read `
|
|
70
|
-
UI section, component/builder, entity/field/action, acceptance, non-goals.
|
|
71
|
-
2. Reason internally until a chain node needs a concrete fact.
|
|
72
|
-
3. Narrow chain nodes by project and platform evidence. Write plan.md.
|
|
73
|
-
|
|
74
|
-
Output decisions, not exploration notes or open design branches.
|
|
75
|
-
|
|
76
|
-
## Project Truth
|
|
77
|
-
|
|
78
|
-
Every read/search must prove or reject target, owner/source, access path, edit
|
|
79
|
-
boundary, protected behavior, fallback, completion evidence, or `Unknown`.
|
|
80
|
-
|
|
81
|
-
Required proof:
|
|
82
|
-
|
|
83
|
-
- target: visible/resource anchor plus render/caller path, or producer
|
|
84
|
-
effect/side-effect when the task has no direct display
|
|
85
|
-
- owner/source: where the same value/action is produced, mutated, or displayed
|
|
86
|
-
as truth — proven only by real write, state change, restore, or consume chain.
|
|
87
|
-
Naming, structural position, comments, default/initial values, and
|
|
88
|
-
stub/signature existence are not ownership evidence
|
|
89
|
-
- wiring: upstream producer -> truth owner/source -> downstream consumer/display
|
|
90
|
-
- protection: shared entry points and non-target behavior that must not change
|
|
91
|
-
|
|
92
|
-
Carrier paths are transport by default: storage, cache, route params,
|
|
93
|
-
AppStorage, event buses, singleton-like access, copied models, persistence,
|
|
94
|
-
fallback/defaults, bridges, and synchronized variables prove truth only with
|
|
95
|
-
identity or ownership evidence that makes one live fact for every required
|
|
96
|
-
writer and reader.
|
|
97
|
-
|
|
98
|
-
Prefer expose/bind/observe/bridge from an existing owner. Promote a new owner
|
|
99
|
-
only after proving the existing owner cannot be bridged and the promoted owner
|
|
100
|
-
will own current, first-render, restore, and future writes. When multiple
|
|
101
|
-
sources partially own a field, resolve to a single coordination point where
|
|
102
|
-
conflict resolution or sync occurs. If neither bridging, promotion, nor
|
|
103
|
-
coordination point can be proven, block dependent edits as `Unknown`.
|
|
104
|
-
|
|
105
|
-
## Semantic Closure
|
|
106
|
-
|
|
107
|
-
Trigger when an edit changes a write/read path or intermediate state of a
|
|
108
|
-
field/action with writers and consumers, or involves persistence-backed display,
|
|
109
|
-
fallback/default, missing/current, or async states.
|
|
110
|
-
|
|
111
|
-
For each affected field/action, prove:
|
|
112
|
-
|
|
113
|
-
```text
|
|
114
|
-
writer → owner/source → producer effect/display → target reader/display → first render/restore → missing semantics
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
Forbidden unless all bound writers/consumers derive same meaning from same
|
|
118
|
-
owner/source: mirror/cache as truth, split producer/reader paths, preset/default
|
|
119
|
-
masking missing/unset, snapshot/placeholder standing in for owner state.
|
|
120
|
-
|
|
121
|
-
Mirror state, cache, snapshots, route params, AppStorage, storage keys,
|
|
122
|
-
defaults, fallback literals, copied models, persistence, and synchronized
|
|
123
|
-
variables do not close the chain unless promoted as single owner with all
|
|
124
|
-
writers/consumers rebound. Read/render does not prove write/update/delete/
|
|
125
|
-
restore. Missing/unset is distinct from false/0/empty/first-item unless the
|
|
126
|
-
owner's producer proves equivalence.
|
|
127
|
-
|
|
128
|
-
## Platform Behavior
|
|
129
|
-
|
|
130
|
-
A local pattern is identical only for the correctness dimensions this task
|
|
131
|
-
depends on. If the new use differs in any correctness-relevant dimension not
|
|
132
|
-
covered by project evidence, the behavior is not proven.
|
|
133
|
-
|
|
134
|
-
These do not prove platform behavior: same SDK/module but different method;
|
|
135
|
-
same method but different parameters; same parameters but different return/
|
|
136
|
-
error/null/default semantics; same call pattern but different conflict behavior,
|
|
137
|
-
lifecycle assumption, or persistence assumption.
|
|
138
|
-
|
|
139
|
-
For each chain node that uses a platform API, component, lifecycle,
|
|
140
|
-
permission, or persistence behavior: first list the assumed platform behaviors,
|
|
141
|
-
then classify each:
|
|
142
|
-
1. Local evidence covers every correctness-relevant dimension → `proven`. Name:
|
|
143
|
-
assumed behavior, local evidence, correctness dimensions this task depends
|
|
144
|
-
on, why the evidence covers them.
|
|
145
|
-
2. Any required dimension not covered + affects main path, forbidden path,
|
|
146
|
-
fallback, edit boundary, or completion evidence → query per Tools → consume
|
|
147
|
-
platform evidence. Write Platform Decision only when evidence is consistent
|
|
148
|
-
and decision-relevant; otherwise write blocking `Unknown`.
|
|
149
|
-
3. Any required dimension not covered + does not change main path, forbidden
|
|
150
|
-
path, fallback, edit boundary, or completion evidence → `coder must verify`.
|
|
151
|
-
4. Query fails or cannot resolve + blocks chain → `blocked Unknown`.
|
|
152
|
-
|
|
153
|
-
Output in plan.md: Platform Evidence/Decision (when step 2 triggers) + Platform
|
|
154
|
-
Assumptions table. Each `proven` row must retain: assumed behavior, local
|
|
155
|
-
evidence, correctness dimensions, coverage reason. `coder must verify` and
|
|
156
|
-
`blocked` rows need only the assumed behavior and gap.
|
|
157
|
-
|
|
158
|
-
## Output
|
|
159
|
-
|
|
160
|
-
Solve internally with: Goal, Target, Project Truth, Platform Behavior (when
|
|
161
|
-
triggered), Access Path, Edit Boundary, Forbidden, Completion Evidence, Unknown.
|
|
162
|
-
Then compile into final short handoff. No source field may be dropped.
|
|
163
|
-
|
|
164
|
-
Before compression, guard:
|
|
165
|
-
|
|
166
|
-
- SPEC target and field/action cardinality preserved, not summarized away.
|
|
167
|
-
- owner/source is a live path, not a mirror/cache/default/fallback.
|
|
168
|
-
- every `Unknown` blocks or omits dependent edits.
|
|
169
|
-
- completion evidence proves target, owner, access, triggered edge paths,
|
|
170
|
-
and protected behavior.
|
|
171
|
-
- each evidence item anchors to a code-locatable structure (return type, branch,
|
|
172
|
-
guard, SQL clause), not a behavioral description.
|
|
173
|
-
- when Edit Plan modifies a shared callback, interface, or export, all
|
|
174
|
-
direct callers are listed — not only the primary path.
|
|
175
|
-
|
|
176
|
-
Completion evidence: reviewer-observable and code-level — target consumer/
|
|
177
|
-
display, upstream owner/producer, access path, protected non-target, triggered
|
|
178
|
-
edge paths (first render, restore, missing/unset, fallback/default, async
|
|
179
|
-
intermediate states). When Semantic Closure triggers, include producer
|
|
180
|
-
effect/display plus missing/current semantics.
|
|
181
|
-
|
|
182
|
-
Final sections:
|
|
183
|
-
|
|
184
|
-
- `## Decision Contract`: goal, target, owner/source, access path, platform
|
|
185
|
-
decision (when triggered), platform assumptions table,
|
|
186
|
-
state/fallback/protection contract
|
|
187
|
-
- `## Edit Plan`: required file groups and required edits
|
|
188
|
-
- `## Forbidden`: task-specific wrong paths and regressions
|
|
189
|
-
- `## Completion Evidence`: code-level checks
|
|
190
|
-
- `## Unknown`: blocking fact and safe partial boundary
|
|
191
|
-
|
|
192
|
-
One fact once. No exploration logs, markdown links, tutorials, absolute paths.
|
|
193
|
-
Budget: 900-1200 tokens for one-target plans; multi-target may exceed
|
|
194
|
-
proportionally. Cut rationale before evidence.
|
|
1
|
+
---
|
|
2
|
+
name: logic-context-builder
|
|
3
|
+
description: "Constrain HarmonyOS ArkTS app changes into an executable decision contract."
|
|
4
|
+
color: blue
|
|
5
|
+
min-model: sonnet
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Inputs
|
|
9
|
+
|
|
10
|
+
- `spec_file` (abs)
|
|
11
|
+
- `harmony_project_dir` (abs)
|
|
12
|
+
- `output_path` (abs)
|
|
13
|
+
- `plugin_path` (abs) — plugin root; `{scripts}` = `{plugin_path}/agents/logic-coder/scripts/`
|
|
14
|
+
|
|
15
|
+
## Tools
|
|
16
|
+
|
|
17
|
+
Platform context query:
|
|
18
|
+
|
|
19
|
+
python3 {scripts}/platform_context_query.py \
|
|
20
|
+
--request {output_path}/platform-context-request.json \
|
|
21
|
+
--out-dir {output_path}/platform-context-{N}
|
|
22
|
+
|
|
23
|
+
Unique `{N}` per query; do not reuse out-dir. Request JSON: `stage`
|
|
24
|
+
("planner"), `focus_point`, `task_excerpt`, `project_evidence`,
|
|
25
|
+
`platform_surfaces`, `extra_constraints`, optional `api_level`. Read result from
|
|
26
|
+
`platform-context-result.json`; consume `structured_evidence` first, then raw
|
|
27
|
+
`evidence` only if needed. The query returns evidence, not authority. Follow-up
|
|
28
|
+
only if first result is unknown and blocks the decision. If evidence is missing
|
|
29
|
+
or conflicting and the fact blocks, note as blocking `Unknown`.
|
|
30
|
+
|
|
31
|
+
## Contract
|
|
32
|
+
|
|
33
|
+
Planner writes one short `plan.md` decision contract. It narrows the solution
|
|
34
|
+
space; it does not code, ask, modify files, wait for approval, or leave required
|
|
35
|
+
decisions to coder.
|
|
36
|
+
|
|
37
|
+
Required decisions: `target surface`, `truth owner/source`, `access path`,
|
|
38
|
+
`forbidden paths`, `completion evidence`, and blocking `Unknown`.
|
|
39
|
+
|
|
40
|
+
Emit only the `plan.md` body, starting with `## Decision Contract`.
|
|
41
|
+
|
|
42
|
+
## Procedure
|
|
43
|
+
|
|
44
|
+
Causal chain (commit downstream nodes only after upstream is resolved; file
|
|
45
|
+
reads may happen in any order but each must advance the next unresolved node):
|
|
46
|
+
|
|
47
|
+
```text
|
|
48
|
+
requested outcome -> target surface/effect -> truth owner/source -> writer ->
|
|
49
|
+
reader/consumer -> triggered edge paths -> protected non-target behavior
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Every read must advance a chain node. Do not read beyond chain-relevant files.
|
|
53
|
+
Promote files to edit only after chain justifies them. Use retrieval before
|
|
54
|
+
broad local reading.
|
|
55
|
+
|
|
56
|
+
At any node, trigger as needed:
|
|
57
|
+
- Project facts narrow the choice (per Project Truth).
|
|
58
|
+
- Unproven platform dependency → verify per Platform Behavior.
|
|
59
|
+
- Write/read path change → verify per Semantic Closure.
|
|
60
|
+
- Verification invalidates upstream → backtrack.
|
|
61
|
+
|
|
62
|
+
Termination: all nodes resolved or blocked → write `{output_path}/plan.md`.
|
|
63
|
+
Unresolved node blocks dependents. No candidate lists, `A or B`, or "coder
|
|
64
|
+
chooses."
|
|
65
|
+
|
|
66
|
+
Evidence priority: visible/resource text > render/caller path >
|
|
67
|
+
producer/consumer > route/menu > file/class names. Reject name-only/comment-only.
|
|
68
|
+
|
|
69
|
+
1. Read `spec_file`. Extract SPEC anchors: visible text/resources, route/menu,
|
|
70
|
+
UI section, component/builder, entity/field/action, acceptance, non-goals.
|
|
71
|
+
2. Reason internally until a chain node needs a concrete fact.
|
|
72
|
+
3. Narrow chain nodes by project and platform evidence. Write plan.md.
|
|
73
|
+
|
|
74
|
+
Output decisions, not exploration notes or open design branches.
|
|
75
|
+
|
|
76
|
+
## Project Truth
|
|
77
|
+
|
|
78
|
+
Every read/search must prove or reject target, owner/source, access path, edit
|
|
79
|
+
boundary, protected behavior, fallback, completion evidence, or `Unknown`.
|
|
80
|
+
|
|
81
|
+
Required proof:
|
|
82
|
+
|
|
83
|
+
- target: visible/resource anchor plus render/caller path, or producer
|
|
84
|
+
effect/side-effect when the task has no direct display
|
|
85
|
+
- owner/source: where the same value/action is produced, mutated, or displayed
|
|
86
|
+
as truth — proven only by real write, state change, restore, or consume chain.
|
|
87
|
+
Naming, structural position, comments, default/initial values, and
|
|
88
|
+
stub/signature existence are not ownership evidence
|
|
89
|
+
- wiring: upstream producer -> truth owner/source -> downstream consumer/display
|
|
90
|
+
- protection: shared entry points and non-target behavior that must not change
|
|
91
|
+
|
|
92
|
+
Carrier paths are transport by default: storage, cache, route params,
|
|
93
|
+
AppStorage, event buses, singleton-like access, copied models, persistence,
|
|
94
|
+
fallback/defaults, bridges, and synchronized variables prove truth only with
|
|
95
|
+
identity or ownership evidence that makes one live fact for every required
|
|
96
|
+
writer and reader.
|
|
97
|
+
|
|
98
|
+
Prefer expose/bind/observe/bridge from an existing owner. Promote a new owner
|
|
99
|
+
only after proving the existing owner cannot be bridged and the promoted owner
|
|
100
|
+
will own current, first-render, restore, and future writes. When multiple
|
|
101
|
+
sources partially own a field, resolve to a single coordination point where
|
|
102
|
+
conflict resolution or sync occurs. If neither bridging, promotion, nor
|
|
103
|
+
coordination point can be proven, block dependent edits as `Unknown`.
|
|
104
|
+
|
|
105
|
+
## Semantic Closure
|
|
106
|
+
|
|
107
|
+
Trigger when an edit changes a write/read path or intermediate state of a
|
|
108
|
+
field/action with writers and consumers, or involves persistence-backed display,
|
|
109
|
+
fallback/default, missing/current, or async states.
|
|
110
|
+
|
|
111
|
+
For each affected field/action, prove:
|
|
112
|
+
|
|
113
|
+
```text
|
|
114
|
+
writer → owner/source → producer effect/display → target reader/display → first render/restore → missing semantics
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Forbidden unless all bound writers/consumers derive same meaning from same
|
|
118
|
+
owner/source: mirror/cache as truth, split producer/reader paths, preset/default
|
|
119
|
+
masking missing/unset, snapshot/placeholder standing in for owner state.
|
|
120
|
+
|
|
121
|
+
Mirror state, cache, snapshots, route params, AppStorage, storage keys,
|
|
122
|
+
defaults, fallback literals, copied models, persistence, and synchronized
|
|
123
|
+
variables do not close the chain unless promoted as single owner with all
|
|
124
|
+
writers/consumers rebound. Read/render does not prove write/update/delete/
|
|
125
|
+
restore. Missing/unset is distinct from false/0/empty/first-item unless the
|
|
126
|
+
owner's producer proves equivalence.
|
|
127
|
+
|
|
128
|
+
## Platform Behavior
|
|
129
|
+
|
|
130
|
+
A local pattern is identical only for the correctness dimensions this task
|
|
131
|
+
depends on. If the new use differs in any correctness-relevant dimension not
|
|
132
|
+
covered by project evidence, the behavior is not proven.
|
|
133
|
+
|
|
134
|
+
These do not prove platform behavior: same SDK/module but different method;
|
|
135
|
+
same method but different parameters; same parameters but different return/
|
|
136
|
+
error/null/default semantics; same call pattern but different conflict behavior,
|
|
137
|
+
lifecycle assumption, or persistence assumption.
|
|
138
|
+
|
|
139
|
+
For each chain node that uses a platform API, component, lifecycle,
|
|
140
|
+
permission, or persistence behavior: first list the assumed platform behaviors,
|
|
141
|
+
then classify each:
|
|
142
|
+
1. Local evidence covers every correctness-relevant dimension → `proven`. Name:
|
|
143
|
+
assumed behavior, local evidence, correctness dimensions this task depends
|
|
144
|
+
on, why the evidence covers them.
|
|
145
|
+
2. Any required dimension not covered + affects main path, forbidden path,
|
|
146
|
+
fallback, edit boundary, or completion evidence → query per Tools → consume
|
|
147
|
+
platform evidence. Write Platform Decision only when evidence is consistent
|
|
148
|
+
and decision-relevant; otherwise write blocking `Unknown`.
|
|
149
|
+
3. Any required dimension not covered + does not change main path, forbidden
|
|
150
|
+
path, fallback, edit boundary, or completion evidence → `coder must verify`.
|
|
151
|
+
4. Query fails or cannot resolve + blocks chain → `blocked Unknown`.
|
|
152
|
+
|
|
153
|
+
Output in plan.md: Platform Evidence/Decision (when step 2 triggers) + Platform
|
|
154
|
+
Assumptions table. Each `proven` row must retain: assumed behavior, local
|
|
155
|
+
evidence, correctness dimensions, coverage reason. `coder must verify` and
|
|
156
|
+
`blocked` rows need only the assumed behavior and gap.
|
|
157
|
+
|
|
158
|
+
## Output
|
|
159
|
+
|
|
160
|
+
Solve internally with: Goal, Target, Project Truth, Platform Behavior (when
|
|
161
|
+
triggered), Access Path, Edit Boundary, Forbidden, Completion Evidence, Unknown.
|
|
162
|
+
Then compile into final short handoff. No source field may be dropped.
|
|
163
|
+
|
|
164
|
+
Before compression, guard:
|
|
165
|
+
|
|
166
|
+
- SPEC target and field/action cardinality preserved, not summarized away.
|
|
167
|
+
- owner/source is a live path, not a mirror/cache/default/fallback.
|
|
168
|
+
- every `Unknown` blocks or omits dependent edits.
|
|
169
|
+
- completion evidence proves target, owner, access, triggered edge paths,
|
|
170
|
+
and protected behavior.
|
|
171
|
+
- each evidence item anchors to a code-locatable structure (return type, branch,
|
|
172
|
+
guard, SQL clause), not a behavioral description.
|
|
173
|
+
- when Edit Plan modifies a shared callback, interface, or export, all
|
|
174
|
+
direct callers are listed — not only the primary path.
|
|
175
|
+
|
|
176
|
+
Completion evidence: reviewer-observable and code-level — target consumer/
|
|
177
|
+
display, upstream owner/producer, access path, protected non-target, triggered
|
|
178
|
+
edge paths (first render, restore, missing/unset, fallback/default, async
|
|
179
|
+
intermediate states). When Semantic Closure triggers, include producer
|
|
180
|
+
effect/display plus missing/current semantics.
|
|
181
|
+
|
|
182
|
+
Final sections:
|
|
183
|
+
|
|
184
|
+
- `## Decision Contract`: goal, target, owner/source, access path, platform
|
|
185
|
+
decision (when triggered), platform assumptions table,
|
|
186
|
+
state/fallback/protection contract
|
|
187
|
+
- `## Edit Plan`: required file groups and required edits
|
|
188
|
+
- `## Forbidden`: task-specific wrong paths and regressions
|
|
189
|
+
- `## Completion Evidence`: code-level checks
|
|
190
|
+
- `## Unknown`: blocking fact and safe partial boundary
|
|
191
|
+
|
|
192
|
+
One fact once. No exploration logs, markdown links, tutorials, absolute paths.
|
|
193
|
+
Budget: 900-1200 tokens for one-target plans; multi-target may exceed
|
|
194
|
+
proportionally. Cut rationale before evidence.
|