You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -54,6 +54,199 @@ export function getSkillIntro(language: string): string {
54
54
- **Only recommend applicable options.** If Scan doesn't apply (no code), don't mention it. If the project is empty, don't list View. Internally exclude inapplicable paths and only present meaningful choices to the user`;
55
55
}
56
56
57
+
// ── Skill file: Philosophy section ──
58
+
59
+
export function getPhilosophySection(language: string): string {
Software systems never break starting from code — they break when design and implementation drift apart.
160
+
161
+
A wrong function? Fix one line. But when ten modules each define "order" differently, which line do you fix? When implicit assumptions between modules start contradicting each other, the system enters an entropy spiral: every fix introduces new inconsistencies, every new feature breaks old features in unexpected ways.
162
+
163
+
Traditional software engineering uses architecture reviews, interface documents, and design specs to fight this entropy. But these all depend on human discipline — and AI-era coding speed has outpaced human discipline. AI can write a complete module in an hour, but nothing guarantees that module is architecturally consistent with the other nine.
164
+
165
+
SVP formalizes the common sense of "design first, implement second" into an executable protocol.
166
+
167
+
### The Compilation Model
168
+
169
+
SVP's core abstraction is a one-way compilation chain:
Each layer derives only from the layer above, never depending on layers below. This guarantees a key property: **you can always recompile downward from any layer without breaking the design integrity of upper layers.**
176
+
177
+
This is the same property as traditional compilation: edit the .cpp, recompile, and you get a correct .o without thinking about .o internals. SVP lets you edit an L3 contract, recompile, and get correct L1 code without thinking about L1 implementation details.
178
+
179
+
The reverse doesn't hold. Editing L1 directly won't update L3 — just like patching a .o file won't update the .cpp. This isn't a technical limitation; it's mathematical fact: information expands and multiplies as it flows from high to low levels, and this process is irreversible.
180
+
181
+
### L3: The Pivot Layer
182
+
183
+
L3 is the center of gravity of the entire system.
184
+
185
+
L5 (intent) and L4 (architecture) are relatively stable — system goals and major module divisions don't change frequently. L2 (skeleton) and L1 (code) are auto-derived. What truly needs careful design and frequent evolution is L3 — the precise contract of each functional module.
186
+
187
+
L3 defines a module's boundaries: what it accepts, what it produces, what rules it follows. For REST API projects:
188
+
189
+
- One L3 block ≈ one functional endpoint
190
+
- Input pins ≈ request parameters
191
+
- Output pins ≈ response data
192
+
- Constraints ≈ route paths, HTTP methods, status codes, validation rules, business logic
193
+
194
+
**L3 precision directly determines compilation quality.** Writing \`input: body\` says nothing — the compiler can only guess. Writing \`constraint: "POST /api/v1/auth/register, tenant ID from X-Tenant-ID header, password min 8 chars, first registered user auto-becomes admin"\` leaves the compiler almost no room to guess.
195
+
196
+
### Reference Documents = Header Files
197
+
198
+
C/C++ compilation depends on header files to understand other modules' interfaces. SVP compilation depends on \`nodes/<block-id>/refs/\` to understand external constraints.
199
+
200
+
API specs, design mockups, third-party SDK docs, algorithm papers — any information that affects how code should be written belongs in refs/. Forge automatically injects refs/ contents when generating compilation prompts.
201
+
202
+
Compiling without refs/ is like compiling without #include: the compiler can't see interface definitions and can only infer. The inference might happen to be correct, but you shouldn't rely on that luck.
203
+
204
+
### The Correct Response to Errors
205
+
206
+
When compilation output is wrong, the natural reaction is "go fix the code." In SVP, the correct reaction is "find which layer's contract is imprecise."
207
+
208
+
\`\`\`
209
+
Compiled route is /users/register but should be /auth/register
This isn't dogma. It's the most efficient approach:
215
+
216
+
- Change one L3 line → recompile fixes all related files
217
+
- Change one L1 spot → fixes only one file, next recompile overwrites it
218
+
- L3 changes are persistent and propagating; L1 changes are temporary and local
219
+
220
+
### Context Isolation
221
+
222
+
The main Agent doesn't read L1 code. This constraint isn't about "division of labor" — it's **cognitive protection**.
223
+
224
+
An Agent that reads L1 unconsciously anchors on implementation details. It starts caring about "this if-statement's branch coverage" instead of "is this module's interface definition complete?" It transforms from architect to debug engineer.
225
+
226
+
SVP's subagent model forces the main Agent to stay at the contract layer:
227
+
228
+
- Main Agent reads L3 contracts → finds issues → modifies contracts → dispatches subagent to recompile
229
+
- Subagent compiles in an isolated context → only sees the current module's contract and reference docs
230
+
231
+
This isolation keeps the main Agent's global vision intact, undistracted by local implementation.
232
+
233
+
### Verification: Translation Validation
234
+
235
+
SVP doesn't prove the compiler (AI) is always correct — that's unrealistic.
236
+
237
+
SVP adopts the Translation Validation paradigm: **verify the product of each compilation, not the compiler itself.**
0 commit comments