@@ -253,11 +253,123 @@ Milestones that previously snapped to working days will now schedule on their ac
253253
254254---
255255
256- ## 11. Open Questions
256+ ## 11. Phase 2 Design Decisions (Finalized)
257257
258- * Should regimes be visualized explicitly in reports?
259- * Should dependencies be validated across incompatible regimes?
260- * When to expose user-defined regimes?
258+ The following decisions are ** authoritative** for Phase 2 implementation.
259+
260+ ### 11.1 Grammar Design — ` regime: ` as Task Attribute
261+
262+ ** Decision:** ` regime: ` MUST be a task attribute, not a declaration modifier.
263+
264+ ``` proj
265+ task "Release v1.0" {
266+ regime: event
267+ start_no_earlier_than: 2024-06-03
268+ }
269+ ```
270+
271+ ** Rationale:**
272+ - Consistency with ` duration: ` , ` depends: ` , ` milestone: `
273+ - Orthogonality: regime describes * temporal semantics* , not * task kind*
274+ - Parser simplicity: no grammar explosion
275+ - No redundancy: avoids ` task event milestone "X" ` confusion
276+
277+ ** Default resolution:**
278+ - ` milestone: true ` ⇒ implicit ` event `
279+ - otherwise ⇒ implicit ` work `
280+
281+ ### 11.2 Validation Strategy — Informative, Not Punitive
282+
283+ ** Decision:** Use diagnostics (Info/Warning), not hard errors.
284+
285+ | Situation | Diagnostic | Severity | Code |
286+ | -----------| ------------| ----------| ------|
287+ | Event regime + non-zero duration | "Event tasks are typically point-in-time" | Info | R001 |
288+ | Work regime + constraint on non-working day | "Will round to next working day" | Info | R002 |
289+ | Deadline regime without deadline constraint | "Deadline regime without deadline" | Warning | R003 |
290+ | Milestone without explicit regime | "Implicit Event regime applied" | Info | R004 |
291+
292+ ** Explicitly allowed:**
293+ - Multi-day events (conferences, audits)
294+ - Work tasks constrained on weekends (floor semantics)
295+
296+ > ** Principle:** utf8proj should ** teach** , not forbid.
297+
298+ ### 11.3 Mixed-Regime Dependencies — Silent by Default
299+
300+ ** Decision:** Correct behavior is silent; diagnostics are opt-in.
301+
302+ When a ` work ` task depends on an ` event ` task on Sunday, the work task starts Monday.
303+ This is ** correct and intuitive** — no diagnostic needed by default.
304+
305+ ** Diagnostic emitted only when:**
306+ - ` --explain ` or ` --verbose ` flag is set
307+ - Date shift is materially significant
308+
309+ ```
310+ info[R005]: Work task scheduled after Event dependency
311+ Approval (Event): Sunday 2024-06-02
312+ Implementation (Work): Monday 2024-06-03
313+ ```
314+
315+ ### 11.4 Structural Scope — Regimes Are Leaf-Semantic
316+
317+ ** Decision:** Regimes apply to leaf tasks only. Containers MUST NOT declare regimes.
318+
319+ | Case | Behavior |
320+ | ------| ----------|
321+ | Container with no regime | Valid (normal case) |
322+ | Container with explicit regime | ❌ Error |
323+ | Children with mixed regimes | Valid |
324+ | Milestone container | Allowed (summary event) |
325+
326+ ** Rationale:**
327+ - Containers aggregate heterogeneous temporal semantics
328+ - Containers have no intrinsic duration semantics
329+ - Allowing regimes on containers creates contradictions
330+
331+ ### 11.5 Extensibility — Designed, Not Exposed
332+
333+ ** Decision:** No user-defined regimes in Phase 2. Internal design allows future extension.
334+
335+ ``` rust
336+ pub enum TemporalRegime {
337+ Work ,
338+ Event ,
339+ Deadline ,
340+ // Reserved for future: Custom(String)
341+ }
342+ ```
343+
344+ Work / Event / Deadline covers ~ 95% of real projects. Custom regimes deferred until real demand.
345+
346+ ### 11.6 Phase 2 Implementation Checklist
347+
348+ #### Grammar (utf8proj-parser)
349+ - [ ] Add ` regime_attr ` to grammar: ` regime: work | event | deadline `
350+ - [ ] Parse regime in task block
351+ - [ ] Update serializer for round-trip
352+
353+ #### Core Types (utf8proj-core)
354+ - [ ] Add ` TemporalRegime ` enum
355+ - [ ] Add ` Task.regime: Option<TemporalRegime> `
356+ - [ ] Add ` Task.effective_regime() ` method (resolves implicit)
357+ - [ ] Add diagnostic codes R001-R005
358+
359+ #### Solver (utf8proj-solver)
360+ - [ ] Refactor constraint handling to use ` effective_regime() `
361+ - [ ] Remove ` is_milestone ` special-casing (use regime instead)
362+ - [ ] Emit R001-R005 diagnostics in ` analyze_project() `
363+
364+ #### CLI (utf8proj-cli)
365+ - [ ] Add ` --explain ` flag for verbose regime diagnostics
366+
367+ #### Tests
368+ - [ ] Explicit ` regime: event ` on non-milestone task
369+ - [ ] Explicit ` regime: work ` on milestone (override)
370+ - [ ] Mixed-regime dependency chain
371+ - [ ] Container with explicit regime (error)
372+ - [ ] Deadline regime basics
261373
262374---
263375
@@ -270,7 +382,20 @@ They resolve real bugs, clarify semantics, simplify the solver, and position utf
270382> * Calendars describe when we can work.*
271383> * Regimes describe what time means.*
272384
385+ This is not a scheduling tweak — it is a ** conceptual correction** that crosses utf8proj from "tool" into ** language** .
386+
273387---
274388
275- ** Recommendation:**
276- Approve Phase 1 for immediate inclusion, with Phase 2 targeted for 0.10.
389+ ## 13. Status
390+
391+ | Phase | Status | Version |
392+ | -------| --------| ---------|
393+ | Phase 1: Implicit regimes | ✅ Implemented | v0.9.4 |
394+ | Phase 2: Explicit ` regime: ` syntax | 📝 Design Finalized | v0.10+ |
395+
396+ ** Next steps:**
397+ 1 . Implement Phase 2 grammar and parser
398+ 2 . Add ` TemporalRegime ` enum to core types
399+ 3 . Refactor solver to use ` effective_regime() `
400+ 4 . Add R001-R005 diagnostics
401+ 5 . Write acceptance tests
0 commit comments