P3D — B3-F1c-c Scheduler Design Report (Updated after constitutional patches)
P3D — B3-F1c-c Scheduler Design Report (Updated after constitutional patches)
Date: 2026-05-13 Author: Opus Last updated: 2026-05-13 (7 constitutional patches applied per GPT review)
Summary
Designed B3-F1c-c DOT-governed scheduler binding for fn_birth_onboarding_full_scan(). Architecture: Directus Flow (schedule) → HTTP Request → Nuxt API endpoint → PG function call. DOT governance via dot_tools registration + dot_config policy keys. Two-pass execution plan (probe+compile → GPT review → execute).
Deliverables created
| # | Path | Type |
|---|---|---|
| 1 | design/p3d-birth-system-b3f1c-c-directus-nuxt-dot-scheduler-design.md |
Design document |
| 2 | prompts/p3d-birth-system-b3f1c-c-scheduler-shape-probe-and-artifact-prompt-DRAFT.md |
Agent probe+compile prompt (DRAFT) |
| 3 | reports/p3d-birth-system-b3f1c-c-scheduler-design-report.md |
This report |
GPT questions answered
| Question | Answer | Confidence |
|---|---|---|
| A. Scheduler registry | directus_flows (execution) + dot_tools (governance) | HIGH — probe needed for dot_tools pattern |
| B. Cadence storage | dot_config = governance policy/candidate, Directus Flow = execution cron. Initial seed must derive both from one reviewed cadence artifact; no Directus-only cadence. | HIGH |
| C. How Flow calls Nuxt | HTTP Request operation, POST to internal URL — exact pattern needs probe | MEDIUM — pattern exists but details unknown |
| D. How Nuxt calls PG | Unknown — probe needed for existing API endpoint patterns | LOW — key unknown |
| E. Observability | system_issues summary issue + Directus Flow log. No new table. All fields are CANDIDATES requiring live schema validation. | MEDIUM — conditional on system_issues shape probe + Directus Flow log retention |
| F. Rollback | Remove only scheduler artifacts (Flow, Operation, dot_config keys, dot_tools row, Nuxt file). Don't touch function, gate, triggers, policy. | HIGH |
| G. Two-pass | B3-F1c-c-a (probe+compile) → GPT review → B3-F1c-c-b (execute) | HIGH |
Key design decisions
-
No new table for observability. Using system_issues avoids full B3-type governance cycle. Tradeoff: mixes scan summaries with individual gaps. All observability fields (issue_type, severity, entity_ref, details) are CANDIDATES — must be derived from live system_issues shape. If system_issues lacks JSONB support → text-only with
observability_status=PARTIAL. If schema cannot accommodate ANY summary →BLOCKED_FOR_OBSERVABILITY_DECISION. Text-only ≠ structured observability. -
Kill switch via dot_config.
policy.birth_full_scan.enabled = true/false— Nuxt endpoint checks before executing. Allows disabling scheduler without Directus admin access. -
Cadence as policy, not hardcode.
0 */6 * * *is CANDIDATE ONLY if no existing policy key exists. Requires GPT/user review before materialization. Directus Flow cron must derive from the same reviewed candidate. No unsynchronized creation allowed. Drift enforcement is future health check. -
Nuxt endpoint writes summary, not PG function. Keeps installed function unchanged. Observability logic lives at the Nuxt layer where it's easier to iterate.
-
Future manual test call is DML-affecting. Invoking
fn_birth_onboarding_full_scan()writes to system_issues via helper. Requires separate GPT/user approval. Not part of automatic execution flow. -
Directus Flow pattern must be discovered, not assumed. If probe cannot safely determine pattern from live scheduled flows →
BLOCKED_PATTERN_UNDISCOVERABLE. Do not compile from assumptions.
7 unknowns requiring probe
All flagged in design document and probe prompt. None are blocking for design, but ALL must be resolved before compile artifacts are final.
Constitutional patches applied (2026-05-13)
| # | Round | Patch | Applied to |
|---|---|---|---|
| 1 | R1 | Observability values → CANDIDATE | Design §E |
| 2 | R1 | Fallback if no JSONB: PARTIAL or BLOCKED | Design §E |
| 3 | R1 | Cadence 0 */6 * * * → candidate only |
Prompt §6c |
| 4 | R1 | BLOCKED_PATTERN_UNDISCOVERABLE | Prompt §6b |
| 5 | R1 | Manual test call + git → require approval | Design §G |
| 6 | R1 | "Accept simpler approach" → removed | Design §5 |
| 7 | R1 | Diagram URL → DISCOVERED placeholder | Design §1 |
| 8 | R2 | "Create lightweight column" → removed, PARTIAL/BLOCKED only | Design §5 risks |
| 9 | R2 | Cấp B → candidate derived from live taxonomy | Design §A, §3 |
| 10 | R2 | dot_tools probe → schema-first, then rows with verified columns | Prompt §2 |
| 11 | R2 | Directus Flow schema preflight before row queries | Prompt §1 |
| 12 | R2 | blocked_reason + observability_status added to final fields | Prompt final |
| 13 | R2 | dot_tools registration → all values candidate, _dot_origin verified | Design §3 (Opus initiative) |
| 14 | R3 | Snapshot count "166+" → "live rows derived at runtime" | Design §1 diagram |
| 15 | R3 | Summary condition: status=complete OR dependency_fail, only if shape supports | Design §1 diagram |
| 16 | R3 | "or equivalents" → exact columns required for Directus system tables | Prompt §1-preflight |
| 17 | R3 | Observability confidence HIGH → MEDIUM/CONDITIONAL | Report |
| 18 | R3 | compiled_from_assumptions=false attestation added | Prompt final fields |
2-vòng rà soát attestation
Vòng 1 — Rà theo GPT directive:
- 7/7 design questions answered (A–G)
- 3/3 deliverables created
- DOT governance defined (dot_tools + dot_config)
- Two-pass plan defined
- No mutation, no execution, no agent dispatch
- 7/7 constitutional patches applied
Vòng 2 — Rà sâu gốc rễ:
- Gốc rễ DOT governance caveat: recurring automation PHẢI đi qua DOT path. Design đảm bảo: Directus Flow → Nuxt → PG, dot_tools registration required.
- Gốc rễ observability: system_health_checks = definition registry. system_issues = candidate observability target, fields must be validated live.
- Gốc rễ hardcode: mọi giá trị cụ thể (URL, cadence, issue_type, severity) đều là CANDIDATE, probe resolves.
Governance status
b3f1c_c_third_pass_patch_status=PASS
snapshot_count_removed=true
dependency_fail_summary_condition_added=true
directus_schema_preflight_exact=true
observability_confidence_lowered_until_probe=true
compiled_from_assumptions_field_added=true
agent_probe_allowed=false_until_gpt_review
scheduler_execution_allowed=false
b3f_complete_allowed=false
phase5c2_migration_allowed=false
next_recommended_action=GPT_REVIEW_THIRD_PASS_PATCHED_DOCS
B3-F1c-c Scheduler Design Report | Updated after constitutional patches | Opus | 2026-05-13