kenaz 0.3.21 → 0.3.23
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/core/.claude/commands/Ansuz.md +2 -0
- package/core/.claude/hooks/__tests__/peer-session-fill.test.js +37 -0
- package/core/.claude/hooks/_ansuz-conversation.js +32 -1
- package/core/.claude/hooks/_user-scope.js +1 -1
- package/core/.claude/hooks/core-resolve.js +1 -1
- package/core/.claude/hooks/peer-optin.test.js +74 -0
- package/core/.claude/hooks/peer-session-fill.js +38 -0
- package/core/.claude/hooks/turn-context.js +5 -4
- package/core/.claude/hooks/worktree-create.js +6 -6
- package/core/.claude/hooks/worktree-remove.js +4 -4
- package/core/.claude/settings.json +9 -0
- package/core/.collaboration/core/reconcile.js +16 -1
- package/core/.collaboration/core/task-2467-lifecycle.test.js +63 -0
- package/core/.collaboration/core/task-api.js +37 -7
- package/core/.formation/bifrost/launch.js +1 -1
- package/core/.formation/bifrost/openai/codex-hook-shim.js +21 -4
- package/core/.formation/bifrost/openai/codex-peer-pull.test.js +42 -0
- package/core/.formation/bifrost/provider-launch.js +2 -1
- package/core/.formation/tools/kenaz-stats.js +1 -1
- package/core/.formation/tools/post-complete/git-merge.js +1 -1
- package/core/.formation/tools/prompt.js +1 -1
- package/core/.kenaz/specialist/ansuz_rules.yaml +7 -51
- package/core/.kenaz/specialist/ansuz_session_handoff.schema.json +2 -6
- package/core/.rule/general/project-self-containment.yaml +2 -2
- package/core/.specialist/Amelia/README.md +1 -1
- package/core/.specialist/Amelia/rule.yaml +1 -1
- package/core/.specialist/Ansuz/RULES.md +1 -1
- package/core/.specialist/Ansuz/concepts/commitment_layer.yaml +1 -1
- package/core/.specialist/Ansuz/concepts/evolvable_guardrails.yaml +1 -1
- package/core/.specialist/Ansuz/knowledge.yaml +1 -3
- package/core/.specialist/tools/__tests__/task-2409-lessons.test.js +10 -0
- package/core/.specialist/tools/__tests__/task-2427-harvest.test.js +25 -0
- package/core/.specialist/tools/ansuz-boot-fast.js +1 -1
- package/core/.specialist/tools/failure-detector.js +4 -4
- package/core/.specialist/tools/handoff-doc.js +1 -1
- package/core/.specialist/tools/lessons.js +2 -2
- package/core/CLAUDE.md +5 -5
- package/core/KENAZ_CORE_VERSION +1 -1
- package/core/dashboard/scripts/install-kenaz-cli.js +471 -0
- package/core/dev/scripts/check-file-size.js +1 -1
- package/core/dev/scripts/ci-feedback.js +1 -1
- package/core/dev/scripts/gc-agent-worktrees.js +11 -11
- package/core/dev/scripts/kenaz-session.js +3 -3
- package/core/dev/scripts/peer-identity-e2e.js +3 -3
- package/core/dev/scripts/run-rust-tests.js +2 -2
- package/core/dev/scripts/skill-routing-replay.js +3 -3
- package/core/dev/scripts/task1961/selftest.js +2 -2
- package/core/dev/scripts/windows-hide-guard.test.js +97 -0
- package/core/plugins/kenaz/commands/Ansuz.md +2 -0
- package/core/plugins/kenaz/guidance.md +2 -0
- package/core/plugins/kenaz/hooks/core-resolve.js +1 -1
- package/core/plugins/kenaz/hooks/hooks.json +9 -0
- package/core/plugins/kenaz/hooks/kenaz-hook.js +53 -4
- package/core/plugins/kenaz/scripts/kenaz.test.js +72 -5
- package/core/plugins/kenaz/scripts/ygg.js +40 -4
- package/core/plugins/kenaz/scripts/ygg.test.js +63 -3
- package/core/plugins/kenaz-peer/hooks/register.test.ts +59 -2
- package/core/plugins/kenaz-peer/hooks/register.ts +24 -1
- package/lib/cli.js +9 -5
- package/package.json +6 -6
- package/vendor/install-kenaz-cli.js +21 -6
- package/core/.kenaz/designs/METAPLASTICITY_CONFIDENCE_DESIGN.md +0 -537
- package/core/.kenaz/designs/REFLEX_INITIATOR_DESIGN.md +0 -501
- package/core/.kenaz/designs/TASK_1385_handoff_mcp_design.md +0 -426
- package/core/.kenaz/designs/TASK_932_hippocampus_consolidation.md +0 -103
- package/core/.kenaz/designs/TASK_934_efe_signal_engine.md +0 -97
- package/core/.kenaz/designs/TASK_935_self_evolution_framework.md +0 -154
- package/core/.kenaz/designs/VISION_cognitive_architecture_roadmap.md +0 -159
- package/core/.kenaz/designs/metaplasticity_simulation_results.json +0 -696
- package/core/.kenaz/main-memory/README.md +0 -230
- package/core/.kenaz/main-memory/kenaz/cortex/001_cortex_overview.md +0 -168
- package/core/.kenaz/main-memory/kenaz/cortex/001_rag_engine_overview.md +0 -30
- package/core/.kenaz/main-memory/kenaz/memory-system/001_three_tier_architecture.md +0 -361
- package/core/.kenaz/main-memory/kenaz/pipeline/001_task_execution_flow.md +0 -117
- package/core/.kenaz/main-memory/kenaz/pipeline/001_task_granularity.md +0 -154
- package/core/.kenaz/main-memory/kenaz/pipeline/002_team_priority.md +0 -51
- package/core/.kenaz/main-memory/kenaz/pipeline/003_feature_id_system.md +0 -46
- package/core/.kenaz/main-memory/kenaz/rules/001_gen_007_self_containment.md +0 -108
- package/core/.kenaz/main-memory/kenaz/rules/001_rule_priority_system.md +0 -121
- package/core/.kenaz/main-memory/kenaz/rules/002_agt_006_pre_check.md +0 -0
- package/core/.kenaz/main-memory/kenaz/rules/003_ppl_002_task_archival.md +0 -48
- package/core/.kenaz/main-memory/kenaz/system/001_dual_track_task_system.md +0 -197
- package/core/.kenaz/main-memory/knowledge/patterns/001_json_bom_issue.md +0 -78
- package/core/.kenaz/main-memory/knowledge/patterns/001_leader_worker_pattern.md +0 -0
- package/core/.kenaz/main-memory/knowledge/patterns/002_scope_path_conflict.md +0 -115
- package/core/.kenaz/main-memory/knowledge/patterns/002_task_dependency_resolution.md +0 -223
- package/core/.kenaz/main-memory/knowledge/patterns/003_question_protocol.md +0 -242
- package/core/.kenaz/main-memory/knowledge/patterns/004_user_insight_value.md +0 -111
- package/core/.kenaz/main-memory/knowledge/patterns/005_file_lock_pattern.md +0 -274
- package/core/.kenaz/main-memory/knowledge/references/001_ppl_rules.md +0 -28
- package/core/.kenaz/main-memory/knowledge/solutions/001_json_bom_issue.md +0 -137
- package/core/.kenaz/main-memory/knowledge/solutions/001_team_invocation.md +0 -0
- package/core/.kenaz/main-memory/knowledge/solutions/002_passive_monitoring.md +0 -0
- package/core/.kenaz/main-memory/knowledge/solutions/003_windows_file_race_condition.md +0 -239
- package/core/.kenaz/main-memory/registry.json +0 -326
- package/core/.kenaz/main-memory/version.yaml +0 -58
- package/core/.kenaz/specialist/memory_guard_fired.json +0 -1
- package/core/.kenaz/specialist/memory_guard_trigger_cache.json +0 -1
- package/core/.kenaz/specialist/memory_source_priority.yaml +0 -260
- package/core/.kenaz/specialist/prompt_1775.txt +0 -317
- package/core/.kenaz/specialist/prompt_1776.txt +0 -326
- package/core/.kenaz/specialist/prompt_1791.txt +0 -320
- package/core/.kenaz/specialist/prompt_1792.txt +0 -320
- package/core/.kenaz/specialist/prompt_1795.txt +0 -281
- package/core/.kenaz/specialist/prompt_1813.txt +0 -332
- package/core/.kenaz/specialist/prompt_1814.txt +0 -401
- package/core/.kenaz/specialist/prompt_1815.txt +0 -394
- package/core/.kenaz/specialist/prompt_1816.txt +0 -437
- package/core/.kenaz/specialist/prompt_1818.txt +0 -361
- package/core/.kenaz/specialist/prompt_1819.txt +0 -421
- package/core/.kenaz/specialist/prompt_1821.txt +0 -345
- package/core/.kenaz/specialist/prompt_1822.txt +0 -313
- package/core/.kenaz/specialist/prompt_1824.txt +0 -348
- package/core/.kenaz/specialist/prompt_1826.txt +0 -388
- package/core/.kenaz/specialist/rune_efe_salience_gap.md +0 -21
- package/core/.kenaz/specialist/task1825_update.json +0 -43
- package/core/.kenaz/specialist/taskgen/consolidation_i.json +0 -38
- package/core/.kenaz/specialist/taskgen/csharp_a.json +0 -44
- package/core/.kenaz/specialist/taskgen/csharp_b.json +0 -40
- package/core/.kenaz/specialist/taskgen/embedding_e.json +0 -34
- package/core/.kenaz/specialist/taskgen/hygiene_fg.json +0 -39
- package/core/.kenaz/specialist/taskgen/pathology_h.json +0 -36
- package/core/.kenaz/specialist/taskgen/unity_noise_d.json +0 -38
- package/core/.kenaz/specialist/taskgen/visibility_c.json +0 -38
- package/core/.specialist/Ansuz/decisions/ADR-requirement-graph-layer.md +0 -390
- package/core/.specialist/Ansuz/self_model_seed.backup.json +0 -100
- package/core/.specialist/ansuz_session_handoff.json +0 -96
- package/core/dev/ALAYA_FIELD_FEEDBACK_DESIGN.md +0 -126
- package/core/dev/ANSUZ_SCAFFOLD_DIET_2026-09-20.md +0 -231
- package/core/dev/ANSUZ_STARTUP_INJECTION_REVIEW.md +0 -355
- package/core/dev/ANSUZ_WORKFLOW_MODERNIZATION.md +0 -143
- package/core/dev/CORTEX_META_GRAPH_ASSESSMENT.md +0 -99
- package/core/dev/FREYA_DOWNSTREAM_BUGS_2026-09-19.md +0 -44
- package/core/dev/GLOBAL_MEMORY_IDENTITY_CONSOLIDATION.md +0 -263
- package/core/dev/GUARD_EFFECTIVENESS_DESIGN.md +0 -180
- package/core/dev/HEALTH_GATE_VARIANCE_ASSESSMENT.md +0 -271
- package/core/dev/HOOK_DIET_2026-09-21.md +0 -126
- package/core/dev/JEV_INTEGRATION_PLAN.md +0 -189
- package/core/dev/KENAZ_AGENT_CONNECT_v1_SPEC.md +0 -139
- package/core/dev/MOBILE_DESIGN_SPEC.md +0 -569
- package/core/dev/MULTI_ANSUZ_SPEC.md +0 -136
- package/core/dev/MUNINN_RETIREMENT.md +0 -115
- package/core/dev/PHASE3_ATTRIBUTION_POPULATION_DIAGNOSIS.md +0 -211
- package/core/dev/PHASE3_P3-2B_TASKLEVEL_PROBE.md +0 -83
- package/core/dev/PHASE3_P3-2_POPULATION_DISJOINTNESS.md +0 -83
- package/core/dev/PHASE3_P3-2_REMEASURE_REPORT.md +0 -231
- package/core/dev/PREDICTION_GROUNDING_DESIGN.md +0 -376
- package/core/dev/PRODUCT_SPEC.md +0 -317
- package/core/dev/PROJECT_REGISTRY_DUPLICATE_ASSESSMENT.md +0 -86
- package/core/dev/STARTUP_TIMELINE_TASK_1995.md +0 -181
- package/core/dev/SYNAPSE_WORKER_PER_PROJECT.md +0 -881
- package/core/dev/TASK_1680_P3-3_DISPATCH_SPEC.md +0 -96
- package/core/dev/TASK_1684_CALIBRATION_IMPACT_ANALYSIS.md +0 -170
- package/core/dev/TASK_1684_FORK_A_GOODHART_DESIGN.md +0 -171
- package/core/dev/TASK_1684_P3_2_REMEASURE_VALIDATION.md +0 -262
- package/core/dev/TASK_1903_SIGNAL_AUC_MEASUREMENT.md +0 -207
- package/core/dev/TASK_1904_BRANCH_INTEGRITY_AUDIT.md +0 -146
- package/core/dev/ansuz-eval/README.md +0 -38
- package/core/dev/ansuz-eval/build-fixtures.js +0 -87
- package/core/dev/ansuz-eval/grade.js +0 -96
- package/core/dev/ansuz-eval/grader.test.js +0 -117
- package/core/dev/ansuz-eval/tasks.md +0 -32
- package/core/dev/archive/ansuz/BOOT_FULL.md +0 -141
- package/core/dev/archive/ansuz/agents/ansuz-boot.md +0 -176
- package/core/dev/archive/ansuz/designs/alaya-passive-surfacing.md +0 -84
- package/core/dev/archive/ansuz/designs/cc_memory_indexing.md +0 -307
- package/core/dev/archive/ansuz/designs/check_guard.md +0 -322
- package/core/dev/archive/ansuz/designs/consequence_loop.md +0 -227
- package/core/dev/archive/ansuz/designs/mcp_kuzudb_lock_architecture.md +0 -312
- package/core/dev/archive/ansuz/designs/phase0_git_enrichment.md +0 -278
- package/core/dev/archive/ansuz/designs/refactor_mcp_tools_synapse.md +0 -490
- package/core/dev/archive/ansuz/designs/semantic_markdown_extraction.md +0 -167
- package/core/dev/archive/ansuz/designs/task_1372_prompt_injects_into.md +0 -193
- package/core/dev/archive/ansuz/designs/thought_stack.md +0 -286
- package/core/dev/archive/ansuz/investigations/reachability_unified_api_2026-04-11.md +0 -330
- package/core/dev/archive/ansuz/investigations/synapse_orphans_indexing_bug_2026-04-11.md +0 -352
- package/core/dev/archive/ansuz/investigations/synapse_orphans_reindex_verification_2026-04-11.md +0 -48
- package/core/dev/archive/ansuz/investigations/synapse_orphans_verification_2026-04-11.md +0 -170
- package/core/dev/archive/ansuz/legacy/kernel.yaml +0 -399
- package/core/dev/archive/ansuz/legacy/phases/phase_0.yaml +0 -418
- package/core/dev/archive/ansuz/legacy/phases/phase_1.yaml +0 -376
- package/core/dev/archive/ansuz/legacy/phases/phase_10.yaml +0 -35
- package/core/dev/archive/ansuz/legacy/phases/phase_11.yaml +0 -582
- package/core/dev/archive/ansuz/legacy/phases/phase_2.yaml +0 -94
- package/core/dev/archive/ansuz/legacy/phases/phase_3.yaml +0 -274
- package/core/dev/archive/ansuz/legacy/phases/phase_4.yaml +0 -67
- package/core/dev/archive/ansuz/legacy/phases/phase_5.yaml +0 -32
- package/core/dev/archive/ansuz/legacy/phases/phase_6.yaml +0 -91
- package/core/dev/archive/ansuz/legacy/phases/phase_7.yaml +0 -58
- package/core/dev/archive/ansuz/legacy/phases/phase_8.yaml +0 -146
- package/core/dev/archive/ansuz/legacy/phases/phase_9.yaml +0 -424
- package/core/dev/archive/ansuz/specs/INDEX_bifrost_hook_parity.yaml +0 -92
- package/core/dev/archive/ansuz/specs/active-inference-formation.yaml +0 -453
- package/core/dev/archive/ansuz/specs/brief_TASK_1228_userpromptsubmit.yaml +0 -191
- package/core/dev/archive/ansuz/specs/brief_TASK_1229_pretooluse_posttooluse.yaml +0 -250
- package/core/dev/archive/ansuz/specs/brief_TASK_1230_sessionstart_stop.yaml +0 -301
- package/core/dev/archive/ansuz/specs/brief_TASK_1231_verification.yaml +0 -272
- package/core/dev/archive/skills/feature_agent/SKILL.md +0 -289
- package/core/dev/design/PHASE4_DESIGN.md +0 -559
- package/core/dev/design/dashboard_docs_integration_PLAN.md +0 -388
- package/core/dev/design/matrix_format_ABBREVIATIONS.md +0 -655
- package/core/dev/design/matrix_format_DESIGN_SPEC.md +0 -601
- package/core/dev/design/matrix_format_DISCUSSION_SUMMARY.md +0 -484
- package/core/dev/design/matrix_format_EXAMPLE_memory.matrix +0 -13
- package/core/dev/design/matrix_format_EXAMPLE_project_status.matrix +0 -9
- package/core/dev/design/matrix_format_EXAMPLE_tasks.matrix +0 -14
- package/core/dev/design/matrix_format_SYNTAX_BNF.md +0 -754
- package/core/dev/design/matrix_format_TOKEN_COMPARISON.md +0 -484
- package/core/dev/design/matrix_v2_COGNITIVE_DESIGN.md +0 -503
- package/core/dev/design/matrix_v2_DISCUSSION_SUMMARY.md +0 -414
- package/core/dev/design/matrix_v2_EXAMPLE.matrix +0 -67
- package/core/dev/designs/EXPANDABLE_CARD_DESIGN_SPEC.md +0 -509
- package/core/dev/jev-eval/ACTIVE_CORRECTION.md +0 -52
- package/core/dev/jev-eval/ANNOTATION_GUIDE.md +0 -68
- package/core/dev/jev-eval/BASELINE_COMPARISON.md +0 -45
- package/core/dev/jev-eval/CONTEXT_REVIEW.md +0 -31
- package/core/dev/jev-eval/EVALUATION_STATUS.md +0 -39
- package/core/dev/jev-eval/HISTORICAL_CORPUS.md +0 -33
- package/core/dev/jev-eval/PACKAGING_VERIFICATION.md +0 -42
- package/core/dev/jev-eval/README.md +0 -101
- package/core/dev/jev-eval/THALAMUS_RANKING.md +0 -58
- package/core/dev/jev-eval/VALIDATION_PROGRESS.md +0 -54
- package/core/dev/jev-eval/cli.mjs +0 -50
- package/core/dev/jev-eval/context.mjs +0 -183
- package/core/dev/jev-eval/corpus.mjs +0 -186
- package/core/dev/jev-eval/fixtures/conversation-review.seed.jsonl +0 -6
- package/core/dev/jev-eval/fixtures/synthetic.jsonl +0 -11
- package/core/dev/jev-eval/metrics.mjs +0 -67
- package/core/dev/jev-eval/muninn-baseline.mjs +0 -119
- package/core/dev/jev-eval/providers.mjs +0 -95
- package/core/dev/jev-eval/reports/annotation-pilot-2026-09-20.json +0 -32
- package/core/dev/jev-eval/reports/context-review-2026-09-20.json +0 -48
- package/core/dev/jev-eval/reports/conversation-review.pending.json +0 -151
- package/core/dev/jev-eval/reports/history-corpus-2026-09-20.json +0 -52
- package/core/dev/jev-eval/reports/length-probe-2026-09-20.json +0 -133
- package/core/dev/jev-eval/reports/live-smoke-2026-09-20.json +0 -616
- package/core/dev/jev-eval/reports/muninn-baseline-2026-09-20.json +0 -52
- package/core/dev/jev-eval/reports/resilience-2026-09-20.json +0 -520
- package/core/dev/jev-eval/reports/rules-baseline.json +0 -197
- package/core/dev/jev-eval/reports/synthetic-review.pending.json +0 -357
- package/core/dev/jev-eval/resilience.mjs +0 -71
- package/core/dev/jev-eval/review.mjs +0 -78
- package/core/dev/jev-eval/schema.mjs +0 -87
- package/core/dev/jev-eval/test/context.test.mjs +0 -95
- package/core/dev/jev-eval/test/corpus.test.mjs +0 -102
- package/core/dev/jev-eval/test/eval.test.mjs +0 -146
- package/core/dev/jev-eval/test/muninn-baseline.test.mjs +0 -71
- package/core/dev/jev-eval/test/resilience.test.mjs +0 -72
- package/core/dev/jev-eval/test/review.test.mjs +0 -61
- package/core/dev/pipeline/PHASE3_PLANNING_SUMMARY.md +0 -338
- package/core/dev/pipeline/PROGRESS.md +0 -113
- package/core/dev/pipeline/PROGRESS_template.md +0 -860
- package/core/dev/pipeline/QA_REPORT_F008.md +0 -431
- package/core/dev/pipeline/QA_REPORT_LOCAL_CLAUDE_DIAGNOSIS.md +0 -583
- package/core/dev/pipeline/README.md +0 -210
- package/core/dev/pipeline/WORKFLOW_GUIDE.md +0 -824
- package/core/dev/pipeline/archived/TASK_015_tauri_init.yaml +0 -53
- package/core/dev/pipeline/archived/TASK_016_tauri_commands.yaml +0 -54
- package/core/dev/pipeline/archived/TASK_017_rust_pty.yaml +0 -54
- package/core/dev/pipeline/archived/TASK_018_tauri_bundle.yaml +0 -53
- package/core/dev/pipeline/archived/TASK_019_release_workflow.yaml +0 -56
- package/core/dev/pipeline/archived/TASK_020_update_ui.yaml +0 -54
- package/core/dev/pipeline/archived/TASK_021_update_notification_ui.yaml +0 -55
- package/core/dev/pipeline/archived/TASK_022_remove_node_pty.yaml +0 -65
- package/core/dev/pipeline/archived/TASK_023_api_routes_migration.yaml +0 -86
- package/core/dev/pipeline/archived/TASK_024_feature_id_system.yaml +0 -51
- package/core/dev/pipeline/archived/TASK_025_executable_acceptance.yaml +0 -66
- package/core/dev/pipeline/archived/TASK_026_spec_versioning.yaml +0 -56
- package/core/dev/pipeline/archived/TASK_027_drift_detection.yaml +0 -60
- package/core/dev/pipeline/archived/TASK_028_tauri_pty_manager.yaml +0 -60
- package/core/dev/pipeline/archived/TASK_029_tauri_pty_commands.yaml +0 -62
- package/core/dev/pipeline/archived/TASK_030_frontend_session_adapter.yaml +0 -54
- package/core/dev/pipeline/archived/TASK_031_terminal_tauri_events.yaml +0 -56
- package/core/dev/pipeline/archived/TASK_041_scheduler_data_models.yaml +0 -54
- package/core/dev/pipeline/archived/TASK_042_path_lock_manager.yaml +0 -53
- package/core/dev/pipeline/archived/TASK_043_process_manager.yaml +0 -57
- package/core/dev/pipeline/archived/TASK_044_git_integration.yaml +0 -85
- package/core/dev/pipeline/archived/TASK_045_task_queue_manager.yaml +0 -54
- package/core/dev/pipeline/archived/TASK_046_scheduler_dispatcher.yaml +0 -60
- package/core/dev/pipeline/archived/TASK_047_tauri_scheduler_commands.yaml +0 -55
- package/core/dev/pipeline/archived/TASK_048_realtime_status_push.yaml +0 -92
- package/core/dev/pipeline/archived/TASK_049_frontend_scheduler_integration.yaml +0 -58
- package/core/dev/pipeline/archived/TASK_050_error_recovery.yaml +0 -56
- package/core/dev/pipeline/archived/TASK_051_optimization_proposals_backend.yaml +0 -53
- package/core/dev/pipeline/archived/TASK_052_optimization_proposals_ui.yaml +0 -58
- package/core/dev/pipeline/archived/TASK_053_optimization_proposals_diff_view.yaml +0 -54
- package/core/dev/pipeline/archived/TASK_054_multi_project_scheduler_state.yaml +0 -76
- package/core/dev/pipeline/archived/TASK_055_scheduler_api_project_scope.yaml +0 -64
- package/core/dev/pipeline/archived/TASK_056_frontend_scheduler_project_scope.yaml +0 -62
- package/core/dev/pipeline/archived/TASK_057_scheduler_module_structure.yaml +0 -54
- package/core/dev/pipeline/archived/TASK_058_scheduler_models_extract.yaml +0 -51
- package/core/dev/pipeline/archived/TASK_059_scheduler_core_extract.yaml +0 -51
- package/core/dev/pipeline/archived/TASK_060_scheduler_commands_extract.yaml +0 -51
- package/core/dev/pipeline/archived/TASK_061_scheduler_specialized_commands.yaml +0 -53
- package/core/dev/pipeline/archived/TASK_062_process_manager_module_structure.yaml +0 -56
- package/core/dev/pipeline/archived/TASK_063_process_manager_core_extract.yaml +0 -56
- package/core/dev/pipeline/archived/TASK_064_recovery_module_structure.yaml +0 -57
- package/core/dev/pipeline/archived/TASK_065_recovery_core_extract.yaml +0 -56
- package/core/dev/pipeline/archived/TASK_066_self_enhancement_scheduler_models.yaml +0 -60
- package/core/dev/pipeline/archived/TASK_067_agents_section_quick_actions.yaml +0 -53
- package/core/dev/pipeline/archived/TASK_067_self_enhancement_scheduler_core.yaml +0 -65
- package/core/dev/pipeline/archived/TASK_068_agent_workflow_rule_enhancement.yaml +0 -46
- package/core/dev/pipeline/archived/TASK_068_self_enhancement_tauri_commands.yaml +0 -61
- package/core/dev/pipeline/archived/TASK_069_agent_wizard_responsive.yaml +0 -46
- package/core/dev/pipeline/archived/TASK_069_self_enhancement_ui.yaml +0 -62
- package/core/dev/pipeline/archived/TASK_070_preview_panel_redesign.yaml +0 -62
- package/core/dev/pipeline/archived/TASK_070_self_enhancement_integration.yaml +0 -57
- package/core/dev/pipeline/archived/TASK_071_preview_panel_qa.yaml +0 -98
- package/core/dev/pipeline/archived/TASK_071_single_agent_config.yaml +0 -57
- package/core/dev/pipeline/archived/TASK_072_preview_modal_esc_fix.yaml +0 -71
- package/core/dev/pipeline/archived/TASK_072_product_review_module.yaml +0 -57
- package/core/dev/pipeline/archived/TASK_073_agents_page_component_refactor.yaml +0 -68
- package/core/dev/pipeline/archived/TASK_073_rename_single_agent.yaml +0 -64
- package/core/dev/pipeline/archived/TASK_074_preview_mode_ui_diagnosis.yaml +0 -71
- package/core/dev/pipeline/archived/TASK_074_single_agent_ui_toggle.yaml +0 -56
- package/core/dev/pipeline/archived/TASK_075_agents_page_component_refactor.yaml +0 -69
- package/core/dev/pipeline/archived/TASK_075_single_agent_integration_test.yaml +0 -75
- package/core/dev/pipeline/archived/TASK_076_preview_mode_ui_diagnosis.yaml +0 -70
- package/core/dev/pipeline/archived/TASK_076_single_agent_continuous_mode.yaml +0 -65
- package/core/dev/pipeline/archived/TASK_077_failure_directory_structure.yaml +0 -51
- package/core/dev/pipeline/archived/TASK_077_single_agent_typescript_types.yaml +0 -59
- package/core/dev/pipeline/archived/TASK_078_fail_001_agent_no_output.yaml +0 -53
- package/core/dev/pipeline/archived/TASK_078_single_agent_ui_simplify.yaml +0 -74
- package/core/dev/pipeline/archived/TASK_079_dashboard_rwd_responsive.yaml +0 -63
- package/core/dev/pipeline/archived/TASK_079_fail_002_json_bom.yaml +0 -56
- package/core/dev/pipeline/archived/TASK_080_fail_003_queue_pollution.yaml +0 -56
- package/core/dev/pipeline/archived/TASK_080_http_server_module.yaml +0 -55
- package/core/dev/pipeline/archived/TASK_081_failure_logging_tools.yaml +0 -57
- package/core/dev/pipeline/archived/TASK_081_http_api_routes.yaml +0 -62
- package/core/dev/pipeline/archived/TASK_082_frontend_api_adapter.yaml +0 -51
- package/core/dev/pipeline/archived/TASK_082_integrate_failure_to_workflow.yaml +0 -60
- package/core/dev/pipeline/archived/TASK_083_cleanup_nextjs_api.yaml +0 -48
- package/core/dev/pipeline/archived/TASK_083_task_queue_cleanup.yaml +0 -67
- package/core/dev/pipeline/archived/TASK_084_rust_dead_code_cleanup.yaml +0 -66
- package/core/dev/pipeline/archived/TASK_084_scheduler_sync_logic_fix.yaml +0 -68
- package/core/dev/pipeline/archived/TASK_085_http_api_web_mode_fixes.yaml +0 -46
- package/core/dev/pipeline/archived/TASK_085_memory_consolidation_0204_0205.yaml +0 -98
- package/core/dev/pipeline/archived/TASK_086_collapsible_preview_panel.yaml +0 -161
- package/core/dev/pipeline/archived/TASK_086_web_mode_feature_parity.yaml +0 -62
- package/core/dev/pipeline/archived/TASK_087_manual_memory_archival.yaml +0 -163
- package/core/dev/pipeline/archived/TASK_087_mobile_http_control.yaml +0 -68
- package/core/dev/pipeline/archived/TASK_088_fail_003_to_ppl_002_rule.yaml +0 -63
- package/core/dev/pipeline/archived/TASK_088_mobile_http_qa.yaml +0 -121
- package/core/dev/pipeline/archived/TASK_089_agent_collaboration_topic.yaml +0 -60
- package/core/dev/pipeline/archived/TASK_089_web_mode_monitor_fix.yaml +0 -58
- package/core/dev/pipeline/archived/TASK_090_cli_detection_fix.yaml +0 -61
- package/core/dev/pipeline/archived/TASK_090_ui_ux_lessons_topic.yaml +0 -63
- package/core/dev/pipeline/archived/TASK_091_expandable_card_design.yaml +0 -56
- package/core/dev/pipeline/archived/TASK_091_move_agent_section_components.yaml +0 -65
- package/core/dev/pipeline/archived/TASK_092_expandable_card_component.yaml +0 -60
- package/core/dev/pipeline/archived/TASK_092_refactor_agent_create_wizard.yaml +0 -84
- package/core/dev/pipeline/archived/TASK_093_taskcard_detail_integration.yaml +0 -57
- package/core/dev/pipeline/archived/TASK_093_update_barrel_exports_test.yaml +0 -84
- package/core/dev/pipeline/archived/TASK_094_ai_agent_generation_enhancement.yaml +0 -115
- package/core/dev/pipeline/archived/TASK_094_proposalcard_detail_integration.yaml +0 -55
- package/core/dev/pipeline/archived/TASK_095_preview_fixes.yaml +0 -129
- package/core/dev/pipeline/archived/TASK_095_single_agent_task_selector.yaml +0 -60
- package/core/dev/pipeline/archived/TASK_096_agents_page_ux_improvements.yaml +0 -163
- package/core/dev/pipeline/archived/TASK_096_single_agent_status_sync.yaml +0 -60
- package/core/dev/pipeline/archived/TASK_097_local_claude_error_logging.yaml +0 -59
- package/core/dev/pipeline/archived/TASK_097_single_agent_monitor_events.yaml +0 -59
- package/core/dev/pipeline/archived/TASK_098_product_manager_team_phase2.yaml +0 -60
- package/core/dev/pipeline/archived/TASK_098_single_agent_refactor_test.yaml +0 -58
- package/core/dev/pipeline/archived/TASK_099_backend_team_creation.yaml +0 -258
- package/core/dev/pipeline/archived/TASK_100_frontend_team_creation.yaml +0 -61
- package/core/dev/pipeline/archived/TASK_101_orchestrator_system.yaml +0 -403
- package/core/dev/pipeline/archived/TASK_102_designer_sre_teams.yaml +0 -90
- package/core/dev/pipeline/archived/TASK_103_integration_testing.yaml +0 -86
- package/core/dev/pipeline/archived/TASK_128_integration_testing.yaml +0 -83
- package/core/dev/pipeline/archived/TASK_134_cortex_v2_phase3_file_watcher.yaml +0 -65
- package/core/dev/pipeline/archived/TASK_134_team_http_api.yaml +0 -96
- package/core/dev/pipeline/archived/TASK_135_cortex_v2_phase3_git_monitor.yaml +0 -63
- package/core/dev/pipeline/archived/TASK_136_cortex_v2_phase3_change_analyzer.yaml +0 -69
- package/core/dev/pipeline/archived/TASK_137_cortex_v2_phase3_cache_invalidator.yaml +0 -67
- package/core/dev/pipeline/archived/TASK_137_team_orchestrator_integration.yaml +0 -93
- package/core/dev/pipeline/archived/TASK_138_cortex_v2_phase3_distributed_cache.yaml +0 -68
- package/core/dev/pipeline/archived/TASK_138_matrix_folder_structure.yaml +0 -61
- package/core/dev/pipeline/archived/TASK_139_cortex_v2_phase3_cache_prewarming.yaml +0 -65
- package/core/dev/pipeline/archived/TASK_146_unified_documentation.yaml +0 -141
- package/core/dev/pipeline/archived/TASK_147_pipeline_execution_rules.yaml +0 -76
- package/core/dev/pipeline/archived/TASK_148_update_claude_md.yaml +0 -77
- package/core/dev/pipeline/archived/TASK_149_fix_nextjs_mdx_serialization.yaml +0 -63
- package/core/dev/pipeline/archived/TASK_149_update_team_docs.yaml +0 -77
- package/core/dev/pipeline/archived/TASK_150_pipeline_workflow_guide.yaml +0 -82
- package/core/dev/pipeline/archived/TASK_164_fix_smart_context_switch.yaml +0 -49
- package/core/dev/pipeline/archived/TASK_165_ctags_symbol_index.yaml +0 -53
- package/core/dev/pipeline/archived/TASK_166_symbol_search_mcp_tool.yaml +0 -48
- package/core/dev/pipeline/archived/TASK_167_llm_module_summary.yaml +0 -55
- package/core/dev/pipeline/archived/TASK_168_map_reduce_context.yaml +0 -51
- package/core/dev/pipeline/archived/TASK_169_v2_integration_testing.yaml +0 -52
- package/core/dev/pipeline/backups/archive_2026-02-04T22-07-22/TASK_QUEUE_backup.json +0 -95
- package/core/dev/pipeline/docs/multi-agent-coordination.md +0 -446
- package/core/dev/pipeline/docs/overview.md +0 -406
- package/core/dev/pipeline/docs/task-management.md +0 -412
- package/core/dev/pipeline/docs/workflows.md +0 -32
- package/core/dev/pipeline/orchestrator/schemas/task_queue_schema.json +0 -58
- package/core/dev/pipeline/orchestrator/schemas/task_schema.json +0 -139
- package/core/dev/pipeline/plans/PLAN_task_cli_refactor.md +0 -281
- package/core/dev/pipeline/test_results/TASK_TEST_PARALLEL_002_result.txt +0 -27
- package/core/dev/plans/ANSUZ_SLIM_PLAN.md +0 -68
- package/core/dev/plans/CLI_FIRST_INSTALL_FLOW.md +0 -120
- package/core/dev/plans/FORMATION_RETIREMENT_PLAN.md +0 -313
- package/core/dev/plans/KUZU_REPLACEMENT_PLAN.md +0 -126
- package/core/dev/scripts/CRASH_DIAGNOSIS.md +0 -47
- package/core/dev/scripts/README.md +0 -142
- package/core/dev/scripts/RUN_ONCE.bat +0 -40
- package/core/dev/scripts/START_DEV_AGENT.bat +0 -63
- package/core/dev/scripts/START_MULTI_AGENT.bat +0 -80
- package/core/dev/scripts/dev_agent_scheduler.ps1 +0 -536
- package/core/dev/scripts/init_git.ps1 +0 -396
- package/core/dev/scripts/init_git.sh +0 -337
- package/core/dev/scripts/init_project.ps1 +0 -851
- package/core/dev/scripts/init_project.sh +0 -477
- package/core/dev/scripts/multi_agent_scheduler.ps1 +0 -2021
- package/core/dev/scripts/multi_agent_scheduler.sh +0 -1344
- package/core/dev/scripts/run_once.sh +0 -47
- package/core/dev/scripts/setup_rag.ps1 +0 -304
- package/core/dev/scripts/setup_rag.sh +0 -230
- package/core/dev/scripts/start_dev_agent.sh +0 -137
- package/core/dev/scripts/start_multi_agent.sh +0 -41
- package/core/dev/scripts/sync_task_queue.ps1 +0 -505
- package/core/dev/scripts/sync_task_queue.sh +0 -392
- package/core/dev/specs/agent-connect/PROTOCOL.md +0 -177
- package/core/dev/specs/agent-connect/SDK_GUIDE.md +0 -915
- package/core/dev/specs/agent-connect/examples/minimal-site/README.md +0 -137
- package/core/dev/specs/agent-connect/examples/minimal-site/package.json +0 -12
- package/core/dev/specs/agent-connect/examples/minimal-site/public/index.html +0 -116
- package/core/dev/specs/agent-connect/examples/minimal-site/public/install-redirect.js +0 -73
- package/core/dev/specs/agent-connect/examples/minimal-site/server.js +0 -516
- package/core/dev/specs/agent-connect/examples/minimal-site/test/smoke.test.mjs +0 -263
- package/core/dev/specs/agent-connect/history/DEFECT_REPORT_kenaz-agent-hub_2026-09-09_v0.4-empty-prompt-no-first-turn.md +0 -77
- package/core/dev/specs/agent-connect/history/DEFECT_REPORT_kenaz-agent-hub_2026-09-09_v0.4-prompt-mojibake.md +0 -90
- package/core/dev/specs/agent-connect/history/FEATURE_REQUEST_kenaz-agent-hub_2026-09-07.md +0 -61
- package/core/dev/specs/agent-connect/history/FEATURE_REQUEST_kenaz-agent-hub_2026-09-08_relay-v1-conformance.md +0 -76
- package/core/dev/specs/agent-connect/history/FEATURE_REQUEST_kenaz-agent-hub_2026-09-09_v0.4-session-channel.md +0 -87
- package/core/dev/specs/agent-connect/history/FLOWPIX_REPLY_agent-hub_2026-09-08_relay-v1-answers.md +0 -68
- package/core/dev/specs/agent-connect/history/FLOWPIX_bridge_CONTRACT.md +0 -642
- package/core/dev/specs/agent-connect/history/FLOWPIX_spikes_relay_spike_relay.mjs +0 -244
- package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-07.md +0 -77
- package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-08_direction-change-v0.3.md +0 -44
- package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-08_relay-v1-answers-ack.md +0 -37
- package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-08_relay-v1-conformance.md +0 -56
- package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-09_annotations-install-coldstart.md +0 -44
- package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-09_empty-prompt-first-turn.md +0 -56
- package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-09_prompt-mojibake-fixed.md +0 -48
- package/core/dev/specs/agent-connect/history/KENAZ_RESPONSE_agent-hub_2026-09-09_session-channel.md +0 -57
- package/core/dev/specs/agent-connect/history/PROTOCOL_v0.3_snapshot.md +0 -379
- package/core/dev/specs/agent-connect/history/README.md +0 -47
- package/core/dev/specs/peer/CODEX_INTERACTIVE_PUSH.md +0 -65
- package/core/dev/specs/peer/CODEX_MANAGED_DAEMON.md +0 -54
- package/core/dev/specs/peer/CODEX_PEER_PULL_SPIKE.md +0 -54
- package/core/dev/specs/peer/MODS_SPIKE.md +0 -133
- package/core/dev/specs/peer/PER_PROJECT_ADDRESSING.md +0 -143
- package/core/dev/specs/peer/SWARM_PROTOCOLS.md +0 -256
- package/core/dev/specs/peer/codex-hook-shim-peer.test.js +0 -113
- package/core/dev/specs/peer/codex-push-launcher.test.js +0 -142
- package/core/dev/specs/peer/setup-codex-hooks.test.js +0 -60
- package/core/dev/specs/peer-ansuz/DELIVERY_SPIKE.md +0 -397
- package/core/dev/specs/peer-ansuz/DESIGN.md +0 -109
- package/core/dev/specs/peer-ansuz/spike/claude_poke.js +0 -129
- package/core/dev/specs/peer-ansuz/spike/claude_session_start_hook.js +0 -37
- package/core/dev/specs/peer-ansuz/spike/claude_settings_hook.json +0 -14
- package/core/dev/specs/peer-ansuz/spike/codex_appserver_client.js +0 -105
- package/core/dev/specs/peer-ansuz/spike/codex_appserver_query.js +0 -29
- package/core/dev/specs/peer-ansuz/spike/extract_timeline.js +0 -26
- package/core/dev/specs/synapse/SYMBOL_IDENTITY.md +0 -305
- package/core/dev/spikes/A4-cypher-varlen.md +0 -176
- package/core/dev/spikes/bloat-rounds.sh +0 -25
- package/core/dev/spikes/mods/clean-claude.js +0 -9
- package/core/dev/spikes/mods/drive-probe.js +0 -29
- package/core/dev/spikes/mods/e2e-peer.js +0 -71
- package/core/dev/spikes/mods/evidence/e2e-peer-control.json +0 -17
- package/core/dev/spikes/mods/evidence/e2e-peer-mod.json +0 -17
- package/core/dev/spikes/mods/evidence/probe-006a6e65-d807-4bc1-b648-fd7d1edfe0b4.jsonl +0 -4
- package/core/dev/spikes/mods/evidence/probe-cebdf1f7-f9c4-47a8-83cd-7c0786177404.jsonl +0 -12
- package/core/dev/spikes/mods/evidence/probe-eb21147d-10ce-4c32-93ed-37ca37d88d5a.jsonl +0 -11
- package/core/dev/spikes/mods/evidence/stream-cebdf1f7.jsonl +0 -18
- package/core/dev/spikes/mods/kenaz-mod-probe/.claude-plugin/plugin.json +0 -1
- package/core/dev/spikes/mods/kenaz-mod-probe/hooks/hooks.json +0 -1
- package/core/dev/spikes/mods/kenaz-mod-probe/hooks/register.ts +0 -65
- package/core/dev/spikes/mods/kenaz-mod-probe/tsconfig.json +0 -3
|
@@ -1,754 +0,0 @@
|
|
|
1
|
-
# .matrix 格式 EBNF 語法定義
|
|
2
|
-
|
|
3
|
-
> **版本**: 1.0.0
|
|
4
|
-
> **日期**: 2026-02-08
|
|
5
|
-
> **標準**: Extended Backus-Naur Form (EBNF)
|
|
6
|
-
> **狀態**: 正式規範
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## 📋 概述
|
|
11
|
-
|
|
12
|
-
本文檔定義 .matrix 格式的正式語法規則,使用 EBNF 標準表示。此語法定義將作為 Parser 實作的標準參考。
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## 🔤 EBNF 記號說明
|
|
17
|
-
|
|
18
|
-
| 記號 | 意義 | 範例 |
|
|
19
|
-
|------|------|------|
|
|
20
|
-
| `=` | 定義 | `rule = expression` |
|
|
21
|
-
| `,` | 連接(依序出現) | `A, B` |
|
|
22
|
-
| `\|` | 選擇(擇一) | `A \| B` |
|
|
23
|
-
| `( )` | 分組 | `(A \| B), C` |
|
|
24
|
-
| `[ ]` | 可選(0或1次) | `[A]` |
|
|
25
|
-
| `{ }` | 重複(0或多次) | `{A}` |
|
|
26
|
-
| `" "` | 終端符號(字面值) | `"@meta"` |
|
|
27
|
-
| `' '` | 終端符號(字面值) | `'|'` |
|
|
28
|
-
| `(* *)` | 註釋 | `(* comment *)` |
|
|
29
|
-
| `-` | 排除 | `A - B` (A 但不包含 B) |
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## 🏗️ 完整語法定義
|
|
34
|
-
|
|
35
|
-
### 頂層結構
|
|
36
|
-
|
|
37
|
-
```ebnf
|
|
38
|
-
(* .matrix 文件根結構 *)
|
|
39
|
-
matrix_file =
|
|
40
|
-
[ comment_line ] ,
|
|
41
|
-
meta_section ,
|
|
42
|
-
index_section ,
|
|
43
|
-
data_section ;
|
|
44
|
-
|
|
45
|
-
comment_line =
|
|
46
|
-
"#" , { any_character - newline } , newline ;
|
|
47
|
-
|
|
48
|
-
newline =
|
|
49
|
-
"\n" | "\r\n" ;
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
## 📊 @meta 層語法
|
|
55
|
-
|
|
56
|
-
### Meta Section 結構
|
|
57
|
-
|
|
58
|
-
```ebnf
|
|
59
|
-
(* @meta 層:文件元數據 *)
|
|
60
|
-
meta_section =
|
|
61
|
-
"@meta" , ws , "|" , meta_fields , "|" , newline ;
|
|
62
|
-
|
|
63
|
-
meta_fields =
|
|
64
|
-
meta_field , { "|" , meta_field } ;
|
|
65
|
-
|
|
66
|
-
meta_field =
|
|
67
|
-
meta_key , "=" , meta_value ;
|
|
68
|
-
|
|
69
|
-
meta_key =
|
|
70
|
-
"v" (* version *)
|
|
71
|
-
| "c" (* category *)
|
|
72
|
-
| "t" (* timestamp *)
|
|
73
|
-
| "r" (* range *)
|
|
74
|
-
| "proj" (* project *)
|
|
75
|
-
| identifier ;
|
|
76
|
-
|
|
77
|
-
meta_value =
|
|
78
|
-
version_string
|
|
79
|
-
| category_string
|
|
80
|
-
| timestamp_string
|
|
81
|
-
| identifier
|
|
82
|
-
| text_value ;
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### Meta 值類型
|
|
86
|
-
|
|
87
|
-
```ebnf
|
|
88
|
-
(* 版本號格式 *)
|
|
89
|
-
version_string =
|
|
90
|
-
digit , "." , digit , [ "." , digit ] ;
|
|
91
|
-
|
|
92
|
-
(* 分類字符串 *)
|
|
93
|
-
category_string =
|
|
94
|
-
letter , { letter | "-" | "_" } ;
|
|
95
|
-
|
|
96
|
-
(* 時間戳格式 *)
|
|
97
|
-
timestamp_string =
|
|
98
|
-
short_date , [ "-" , short_time ] ;
|
|
99
|
-
|
|
100
|
-
short_date =
|
|
101
|
-
year_short , month_digit , day_digit ;
|
|
102
|
-
(* 範例: 260207 → 2026-02-07 *)
|
|
103
|
-
|
|
104
|
-
year_short =
|
|
105
|
-
digit , digit ; (* YY *)
|
|
106
|
-
|
|
107
|
-
month_digit =
|
|
108
|
-
digit , digit ; (* MM *)
|
|
109
|
-
|
|
110
|
-
day_digit =
|
|
111
|
-
digit , digit ; (* DD *)
|
|
112
|
-
|
|
113
|
-
short_time =
|
|
114
|
-
hour_digit , minute_digit ;
|
|
115
|
-
|
|
116
|
-
hour_digit =
|
|
117
|
-
digit , digit ; (* HH *)
|
|
118
|
-
|
|
119
|
-
minute_digit =
|
|
120
|
-
digit , digit ; (* MM *)
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
**範例**:
|
|
124
|
-
```
|
|
125
|
-
@meta |v=1.0|c=project-status|t=260207-0530|proj=KenazAI|
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
## 📇 @index 層語法
|
|
131
|
-
|
|
132
|
-
### Index Section 結構
|
|
133
|
-
|
|
134
|
-
```ebnf
|
|
135
|
-
(* @index 層:快速查詢索引 *)
|
|
136
|
-
index_section =
|
|
137
|
-
"@index" , ws , "|" , index_fields , "|" , newline ;
|
|
138
|
-
|
|
139
|
-
index_fields =
|
|
140
|
-
index_field , { "|" , index_field } ;
|
|
141
|
-
|
|
142
|
-
index_field =
|
|
143
|
-
index_key , "=" , index_value ;
|
|
144
|
-
|
|
145
|
-
index_key =
|
|
146
|
-
"ty" (* type *)
|
|
147
|
-
| "tot" (* total *)
|
|
148
|
-
| "c" (* completed *)
|
|
149
|
-
| "p" (* in_progress *)
|
|
150
|
-
| "b" (* blocked *)
|
|
151
|
-
| "d" (* date *)
|
|
152
|
-
| "e" (* entries *)
|
|
153
|
-
| "cat" (* category *)
|
|
154
|
-
| "act" (* active *)
|
|
155
|
-
| "upd" (* updated *)
|
|
156
|
-
| identifier ;
|
|
157
|
-
|
|
158
|
-
index_value =
|
|
159
|
-
number_value
|
|
160
|
-
| status_code
|
|
161
|
-
| date_list
|
|
162
|
-
| category_list
|
|
163
|
-
| text_value ;
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### Index 值類型
|
|
167
|
-
|
|
168
|
-
```ebnf
|
|
169
|
-
(* 數字值 *)
|
|
170
|
-
number_value =
|
|
171
|
-
[ "-" ] , digit , { digit } , [ "." , digit , { digit } ] ;
|
|
172
|
-
|
|
173
|
-
(* 日期列表 *)
|
|
174
|
-
date_list =
|
|
175
|
-
short_date , { "," , short_date } ;
|
|
176
|
-
|
|
177
|
-
(* 分類列表 *)
|
|
178
|
-
category_list =
|
|
179
|
-
identifier , { "," , identifier } ;
|
|
180
|
-
|
|
181
|
-
(* 狀態代碼 *)
|
|
182
|
-
status_code =
|
|
183
|
-
"C" | "P" | "D" | "B" | "0" | "1" ;
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
**範例**:
|
|
187
|
-
```
|
|
188
|
-
@index |tot=123|c=100|p=15|b=8|act=1|upd=260207|
|
|
189
|
-
@index |d=260207,260206,260205|e=25|cat=dev,bug,feat,doc|
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
---
|
|
193
|
-
|
|
194
|
-
## 💾 @data 層語法
|
|
195
|
-
|
|
196
|
-
### Data Section 結構
|
|
197
|
-
|
|
198
|
-
```ebnf
|
|
199
|
-
(* @data 層:實際數據內容 *)
|
|
200
|
-
data_section =
|
|
201
|
-
"@data" , newline ,
|
|
202
|
-
{ data_line } ;
|
|
203
|
-
|
|
204
|
-
data_line =
|
|
205
|
-
record_id , "|" , data_fields , "|" , newline ;
|
|
206
|
-
|
|
207
|
-
record_id =
|
|
208
|
-
identifier ;
|
|
209
|
-
|
|
210
|
-
data_fields =
|
|
211
|
-
data_field , { "|" , data_field } ;
|
|
212
|
-
|
|
213
|
-
data_field =
|
|
214
|
-
field_key , "=" , field_value ;
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
### Data 鍵名
|
|
218
|
-
|
|
219
|
-
```ebnf
|
|
220
|
-
(* 欄位鍵名(縮寫) *)
|
|
221
|
-
field_key =
|
|
222
|
-
(* 狀態與優先級 *)
|
|
223
|
-
"st" (* status *)
|
|
224
|
-
| "p" (* priority *)
|
|
225
|
-
|
|
226
|
-
(* 時間相關 *)
|
|
227
|
-
| "t" (* time *)
|
|
228
|
-
| "ct" (* created_at *)
|
|
229
|
-
| "ut" (* updated_at *)
|
|
230
|
-
| "dur" (* duration *)
|
|
231
|
-
|
|
232
|
-
(* 識別與關係 *)
|
|
233
|
-
| "i" (* id *)
|
|
234
|
-
| "ty" (* type *)
|
|
235
|
-
| "ag" (* agent_type *)
|
|
236
|
-
| "dep" (* dependencies *)
|
|
237
|
-
| "blk" (* blocked_by *)
|
|
238
|
-
|
|
239
|
-
(* 內容 *)
|
|
240
|
-
| "d" (* description *)
|
|
241
|
-
| "desc" (* description (long) *)
|
|
242
|
-
| "note" (* note *)
|
|
243
|
-
| "cat" (* category *)
|
|
244
|
-
|
|
245
|
-
(* 數值 *)
|
|
246
|
-
| "c" (* count *)
|
|
247
|
-
| "tot" (* total *)
|
|
248
|
-
| "est" (* estimated *)
|
|
249
|
-
| "act" (* actual *)
|
|
250
|
-
| "succ" (* success_rate *)
|
|
251
|
-
|
|
252
|
-
(* 擴展 *)
|
|
253
|
-
| identifier ;
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
### Data 值類型
|
|
257
|
-
|
|
258
|
-
```ebnf
|
|
259
|
-
(* 欄位值 *)
|
|
260
|
-
field_value =
|
|
261
|
-
status_value
|
|
262
|
-
| priority_value
|
|
263
|
-
| duration_value
|
|
264
|
-
| timestamp_value
|
|
265
|
-
| list_value
|
|
266
|
-
| task_group
|
|
267
|
-
| text_value
|
|
268
|
-
| number_value
|
|
269
|
-
| boolean_value ;
|
|
270
|
-
|
|
271
|
-
(* 狀態值 *)
|
|
272
|
-
status_value =
|
|
273
|
-
"C" (* completed *)
|
|
274
|
-
| "P" (* in_progress *)
|
|
275
|
-
| "D" (* pending *)
|
|
276
|
-
| "B" (* blocked *)
|
|
277
|
-
| "X" (* cancelled *)
|
|
278
|
-
| "R" (* review *)
|
|
279
|
-
| "T" (* testing *) ;
|
|
280
|
-
|
|
281
|
-
(* 優先級值 *)
|
|
282
|
-
priority_value =
|
|
283
|
-
"0" (* P0 - highest *)
|
|
284
|
-
| "1" (* P1 *)
|
|
285
|
-
| "2" (* P2 *)
|
|
286
|
-
| "3" (* P3 - lowest *) ;
|
|
287
|
-
|
|
288
|
-
(* 時長值 *)
|
|
289
|
-
duration_value =
|
|
290
|
-
number_value , time_unit ;
|
|
291
|
-
|
|
292
|
-
time_unit =
|
|
293
|
-
"s" (* seconds *)
|
|
294
|
-
| "m" (* minutes *)
|
|
295
|
-
| "h" (* hours *)
|
|
296
|
-
| "d" (* days *)
|
|
297
|
-
| "w" (* weeks *) ;
|
|
298
|
-
|
|
299
|
-
(* 列表值 *)
|
|
300
|
-
list_value =
|
|
301
|
-
identifier , { "," , identifier } ;
|
|
302
|
-
|
|
303
|
-
(* 任務組(分號分隔的複雜結構) *)
|
|
304
|
-
task_group =
|
|
305
|
-
task_item , { ";" , task_item } ;
|
|
306
|
-
|
|
307
|
-
task_item =
|
|
308
|
-
identifier , { "," , sub_field } ;
|
|
309
|
-
|
|
310
|
-
sub_field =
|
|
311
|
-
field_key , "=" , field_value ;
|
|
312
|
-
|
|
313
|
-
(* 布林值 *)
|
|
314
|
-
boolean_value =
|
|
315
|
-
"0" | "1" | "true" | "false" ;
|
|
316
|
-
|
|
317
|
-
(* 文本值 *)
|
|
318
|
-
text_value =
|
|
319
|
-
{ any_character - ( "|" | newline ) } ;
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
**範例**:
|
|
323
|
-
```
|
|
324
|
-
@data
|
|
325
|
-
T121|st=C|p=0|dur=135m|ct=260206-1430|desc=API integration|
|
|
326
|
-
T122|st=C|p=1|dur=90m|ct=260206-1500|desc=UI refactoring|
|
|
327
|
-
260207|dev|T123,st=P,dur=45m;T124,st=P,dur=60m|note=DB migration in progress|
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
---
|
|
331
|
-
|
|
332
|
-
## 🔤 基本詞法單元
|
|
333
|
-
|
|
334
|
-
### 標識符與字符
|
|
335
|
-
|
|
336
|
-
```ebnf
|
|
337
|
-
(* 標識符 *)
|
|
338
|
-
identifier =
|
|
339
|
-
letter , { letter | digit | "_" | "-" } ;
|
|
340
|
-
|
|
341
|
-
(* 字母 *)
|
|
342
|
-
letter =
|
|
343
|
-
uppercase_letter | lowercase_letter ;
|
|
344
|
-
|
|
345
|
-
uppercase_letter =
|
|
346
|
-
"A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J"
|
|
347
|
-
| "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T"
|
|
348
|
-
| "U" | "V" | "W" | "X" | "Y" | "Z" ;
|
|
349
|
-
|
|
350
|
-
lowercase_letter =
|
|
351
|
-
"a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j"
|
|
352
|
-
| "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t"
|
|
353
|
-
| "u" | "v" | "w" | "x" | "y" | "z" ;
|
|
354
|
-
|
|
355
|
-
(* 數字 *)
|
|
356
|
-
digit =
|
|
357
|
-
"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;
|
|
358
|
-
|
|
359
|
-
(* 空白字符 *)
|
|
360
|
-
ws =
|
|
361
|
-
" " | "\t" ;
|
|
362
|
-
|
|
363
|
-
(* 任意字符(不含特殊符號) *)
|
|
364
|
-
any_character =
|
|
365
|
-
letter | digit | symbol | ws ;
|
|
366
|
-
|
|
367
|
-
symbol =
|
|
368
|
-
"!" | "@" | "#" | "$" | "%" | "^" | "&" | "*" | "(" | ")"
|
|
369
|
-
| "-" | "+" | "=" | "[" | "]" | "{" | "}" | ";" | ":"
|
|
370
|
-
| "'" | "\"" | "," | "." | "/" | "?" | "<" | ">" | "~" | "`" ;
|
|
371
|
-
```
|
|
372
|
-
|
|
373
|
-
---
|
|
374
|
-
|
|
375
|
-
## 📐 語法樹範例
|
|
376
|
-
|
|
377
|
-
### 範例 1:最小 .matrix 文件
|
|
378
|
-
|
|
379
|
-
**原始**:
|
|
380
|
-
```
|
|
381
|
-
# .matrix v1.0
|
|
382
|
-
@meta |v=1.0|c=test|t=260208|
|
|
383
|
-
@index |tot=1|
|
|
384
|
-
@data
|
|
385
|
-
T1|st=C|
|
|
386
|
-
```
|
|
387
|
-
|
|
388
|
-
**語法樹**:
|
|
389
|
-
```
|
|
390
|
-
matrix_file
|
|
391
|
-
├── comment_line
|
|
392
|
-
│ └── "# .matrix v1.0"
|
|
393
|
-
├── meta_section
|
|
394
|
-
│ ├── "@meta"
|
|
395
|
-
│ └── meta_fields
|
|
396
|
-
│ ├── meta_field: v=1.0
|
|
397
|
-
│ ├── meta_field: c=test
|
|
398
|
-
│ └── meta_field: t=260208
|
|
399
|
-
├── index_section
|
|
400
|
-
│ ├── "@index"
|
|
401
|
-
│ └── index_fields
|
|
402
|
-
│ └── index_field: tot=1
|
|
403
|
-
└── data_section
|
|
404
|
-
├── "@data"
|
|
405
|
-
└── data_line
|
|
406
|
-
├── record_id: T1
|
|
407
|
-
└── data_fields
|
|
408
|
-
└── data_field: st=C
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
### 範例 2:複雜任務記錄
|
|
412
|
-
|
|
413
|
-
**原始**:
|
|
414
|
-
```
|
|
415
|
-
@data
|
|
416
|
-
T123|st=P|p=0|dur=45m|ct=260207-0900|desc=DB migration|dep=T120,T121|
|
|
417
|
-
```
|
|
418
|
-
|
|
419
|
-
**語法樹**:
|
|
420
|
-
```
|
|
421
|
-
data_line
|
|
422
|
-
├── record_id: "T123"
|
|
423
|
-
└── data_fields
|
|
424
|
-
├── data_field
|
|
425
|
-
│ ├── field_key: "st"
|
|
426
|
-
│ └── field_value: status_value("P")
|
|
427
|
-
├── data_field
|
|
428
|
-
│ ├── field_key: "p"
|
|
429
|
-
│ └── field_value: priority_value("0")
|
|
430
|
-
├── data_field
|
|
431
|
-
│ ├── field_key: "dur"
|
|
432
|
-
│ └── field_value: duration_value("45m")
|
|
433
|
-
├── data_field
|
|
434
|
-
│ ├── field_key: "ct"
|
|
435
|
-
│ └── field_value: timestamp_value("260207-0900")
|
|
436
|
-
├── data_field
|
|
437
|
-
│ ├── field_key: "desc"
|
|
438
|
-
│ └── field_value: text_value("DB migration")
|
|
439
|
-
└── data_field
|
|
440
|
-
├── field_key: "dep"
|
|
441
|
-
└── field_value: list_value("T120,T121")
|
|
442
|
-
```
|
|
443
|
-
|
|
444
|
-
### 範例 3:記憶系統記錄
|
|
445
|
-
|
|
446
|
-
**原始**:
|
|
447
|
-
```
|
|
448
|
-
@data
|
|
449
|
-
260207|dev|T123,st=P,dur=45m;T124,st=P,dur=60m|note=DB migration in progress|
|
|
450
|
-
```
|
|
451
|
-
|
|
452
|
-
**語法樹**:
|
|
453
|
-
```
|
|
454
|
-
data_line
|
|
455
|
-
├── record_id: "260207"
|
|
456
|
-
└── data_fields
|
|
457
|
-
├── data_field
|
|
458
|
-
│ ├── field_key: (implicit type)
|
|
459
|
-
│ └── field_value: identifier("dev")
|
|
460
|
-
├── data_field
|
|
461
|
-
│ ├── field_key: (implicit tasks)
|
|
462
|
-
│ └── field_value: task_group
|
|
463
|
-
│ ├── task_item
|
|
464
|
-
│ │ ├── identifier: "T123"
|
|
465
|
-
│ │ ├── sub_field: st=P
|
|
466
|
-
│ │ └── sub_field: dur=45m
|
|
467
|
-
│ └── task_item
|
|
468
|
-
│ ├── identifier: "T124"
|
|
469
|
-
│ ├── sub_field: st=P
|
|
470
|
-
│ └── sub_field: dur=60m
|
|
471
|
-
└── data_field
|
|
472
|
-
├── field_key: "note"
|
|
473
|
-
└── field_value: text_value("DB migration in progress")
|
|
474
|
-
```
|
|
475
|
-
|
|
476
|
-
---
|
|
477
|
-
|
|
478
|
-
## ⚙️ 解析規則
|
|
479
|
-
|
|
480
|
-
### 優先級順序
|
|
481
|
-
|
|
482
|
-
| 優先級 | 元素 | 說明 |
|
|
483
|
-
|-------|------|------|
|
|
484
|
-
| 1 | `comment_line` | 以 `#` 開頭的註釋行 |
|
|
485
|
-
| 2 | `@meta` | 文件元數據(必須) |
|
|
486
|
-
| 3 | `@index` | 索引層(必須) |
|
|
487
|
-
| 4 | `@data` | 數據層(可選) |
|
|
488
|
-
|
|
489
|
-
### 解析步驟
|
|
490
|
-
|
|
491
|
-
1. **詞法分析**(Tokenization)
|
|
492
|
-
- 識別分隔符: `|`, `=`, `,`, `;`
|
|
493
|
-
- 識別保留字: `@meta`, `@index`, `@data`
|
|
494
|
-
- 識別標識符、數字、字符串
|
|
495
|
-
|
|
496
|
-
2. **語法分析**(Parsing)
|
|
497
|
-
- 驗證三層結構順序
|
|
498
|
-
- 驗證各層語法規則
|
|
499
|
-
- 建立抽象語法樹(AST)
|
|
500
|
-
|
|
501
|
-
3. **語義分析**(Semantic Analysis)
|
|
502
|
-
- 驗證欄位鍵名合法性
|
|
503
|
-
- 驗證值類型匹配
|
|
504
|
-
- 驗證引用完整性(dep, blk)
|
|
505
|
-
|
|
506
|
-
4. **建立數據模型**(Model Building)
|
|
507
|
-
- 轉換為內部數據結構
|
|
508
|
-
- 建立索引映射
|
|
509
|
-
- 準備查詢接口
|
|
510
|
-
|
|
511
|
-
---
|
|
512
|
-
|
|
513
|
-
## 🔒 約束規則
|
|
514
|
-
|
|
515
|
-
### 必須性約束
|
|
516
|
-
|
|
517
|
-
```ebnf
|
|
518
|
-
(* 必須包含的元素 *)
|
|
519
|
-
required_elements =
|
|
520
|
-
meta_section ,
|
|
521
|
-
index_section ;
|
|
522
|
-
|
|
523
|
-
(* @data 層可選 *)
|
|
524
|
-
optional_elements =
|
|
525
|
-
data_section ;
|
|
526
|
-
```
|
|
527
|
-
|
|
528
|
-
### 唯一性約束
|
|
529
|
-
|
|
530
|
-
- **@meta 層**: 必須唯一,只能出現一次
|
|
531
|
-
- **@index 層**: 必須唯一,只能出現一次
|
|
532
|
-
- **@data 層**: 最多一次
|
|
533
|
-
- **record_id**: 在 @data 層內必須唯一
|
|
534
|
-
|
|
535
|
-
### 順序約束
|
|
536
|
-
|
|
537
|
-
- **層級順序**: `@meta` → `@index` → `@data`(強制順序)
|
|
538
|
-
- **欄位順序**: 無強制要求(但建議保持一致)
|
|
539
|
-
|
|
540
|
-
### 數值約束
|
|
541
|
-
|
|
542
|
-
```ebnf
|
|
543
|
-
(* 版本號約束 *)
|
|
544
|
-
version_constraint =
|
|
545
|
-
major_version = 1 ,
|
|
546
|
-
minor_version >= 0 ;
|
|
547
|
-
|
|
548
|
-
(* 時間戳約束 *)
|
|
549
|
-
timestamp_constraint =
|
|
550
|
-
year_short: 00..99 ,
|
|
551
|
-
month_digit: 01..12 ,
|
|
552
|
-
day_digit: 01..31 ,
|
|
553
|
-
hour_digit: 00..23 ,
|
|
554
|
-
minute_digit: 00..59 ;
|
|
555
|
-
|
|
556
|
-
(* 優先級約束 *)
|
|
557
|
-
priority_constraint =
|
|
558
|
-
priority_value IN { "0", "1", "2", "3" } ;
|
|
559
|
-
```
|
|
560
|
-
|
|
561
|
-
---
|
|
562
|
-
|
|
563
|
-
## ❌ 錯誤處理
|
|
564
|
-
|
|
565
|
-
### 語法錯誤類型
|
|
566
|
-
|
|
567
|
-
| 錯誤代碼 | 錯誤類型 | 範例 | 處理方式 |
|
|
568
|
-
|---------|---------|------|---------|
|
|
569
|
-
| E001 | 缺少必要層級 | 缺少 @meta | 拒絕解析 |
|
|
570
|
-
| E002 | 層級順序錯誤 | @data 在 @meta 之前 | 拒絕解析 |
|
|
571
|
-
| E003 | 分隔符錯誤 | 缺少 `\|` | 拒絕解析 |
|
|
572
|
-
| E004 | 欄位格式錯誤 | `st:C`(應為 `st=C`) | 拒絕解析 |
|
|
573
|
-
| E005 | 值類型錯誤 | `p=High`(應為 `p=0`) | 警告,嘗試修正 |
|
|
574
|
-
| E006 | 時間戳格式錯誤 | `t=2026-02-07`(應為 `t=260207`) | 警告,嘗試修正 |
|
|
575
|
-
| E007 | 重複 record_id | 兩個 `T123` | 拒絕解析 |
|
|
576
|
-
| E008 | 未知欄位鍵名 | `unknown=value` | 警告,保留 |
|
|
577
|
-
|
|
578
|
-
### 錯誤訊息格式
|
|
579
|
-
|
|
580
|
-
```
|
|
581
|
-
Error [E001]: Missing required section '@meta'
|
|
582
|
-
at line 1, column 1
|
|
583
|
-
|
|
584
|
-
Expected:
|
|
585
|
-
# .matrix v1.0
|
|
586
|
-
@meta |v=1.0|c=...|
|
|
587
|
-
|
|
588
|
-
Got:
|
|
589
|
-
@index |tot=123|
|
|
590
|
-
```
|
|
591
|
-
|
|
592
|
-
---
|
|
593
|
-
|
|
594
|
-
## ✅ 驗證器實作指南
|
|
595
|
-
|
|
596
|
-
### 驗證步驟
|
|
597
|
-
|
|
598
|
-
```python
|
|
599
|
-
def validate_matrix_file(content: str) -> ValidationResult:
|
|
600
|
-
"""
|
|
601
|
-
驗證 .matrix 文件語法
|
|
602
|
-
"""
|
|
603
|
-
# Step 1: 詞法驗證
|
|
604
|
-
tokens = tokenize(content)
|
|
605
|
-
if not tokens:
|
|
606
|
-
return ValidationResult(False, "E000: Empty file")
|
|
607
|
-
|
|
608
|
-
# Step 2: 結構驗證
|
|
609
|
-
if not has_meta_section(tokens):
|
|
610
|
-
return ValidationResult(False, "E001: Missing @meta section")
|
|
611
|
-
|
|
612
|
-
if not has_index_section(tokens):
|
|
613
|
-
return ValidationResult(False, "E001: Missing @index section")
|
|
614
|
-
|
|
615
|
-
# Step 3: 順序驗證
|
|
616
|
-
if not check_section_order(tokens):
|
|
617
|
-
return ValidationResult(False, "E002: Invalid section order")
|
|
618
|
-
|
|
619
|
-
# Step 4: 語法驗證
|
|
620
|
-
ast = parse_tokens(tokens)
|
|
621
|
-
if not ast:
|
|
622
|
-
return ValidationResult(False, "E003: Syntax error")
|
|
623
|
-
|
|
624
|
-
# Step 5: 語義驗證
|
|
625
|
-
semantic_errors = validate_semantics(ast)
|
|
626
|
-
if semantic_errors:
|
|
627
|
-
return ValidationResult(False, semantic_errors)
|
|
628
|
-
|
|
629
|
-
return ValidationResult(True, "Valid .matrix file")
|
|
630
|
-
```
|
|
631
|
-
|
|
632
|
-
### Parser 實作建議
|
|
633
|
-
|
|
634
|
-
1. **使用遞歸下降解析器**(Recursive Descent Parser)
|
|
635
|
-
- 簡單直觀
|
|
636
|
-
- 易於實作錯誤恢復
|
|
637
|
-
- 適合 .matrix 的簡單語法
|
|
638
|
-
|
|
639
|
-
2. **建立明確的 AST 節點類型**
|
|
640
|
-
```python
|
|
641
|
-
class MatrixFile:
|
|
642
|
-
meta: MetaSection
|
|
643
|
-
index: IndexSection
|
|
644
|
-
data: Optional[DataSection]
|
|
645
|
-
|
|
646
|
-
class MetaSection:
|
|
647
|
-
fields: Dict[str, str]
|
|
648
|
-
|
|
649
|
-
class IndexSection:
|
|
650
|
-
fields: Dict[str, Any]
|
|
651
|
-
|
|
652
|
-
class DataSection:
|
|
653
|
-
records: List[DataRecord]
|
|
654
|
-
|
|
655
|
-
class DataRecord:
|
|
656
|
-
id: str
|
|
657
|
-
fields: Dict[str, Any]
|
|
658
|
-
```
|
|
659
|
-
|
|
660
|
-
3. **提供友善的錯誤訊息**
|
|
661
|
-
- 明確的錯誤位置(行號、列號)
|
|
662
|
-
- 預期與實際的對比
|
|
663
|
-
- 修正建議
|
|
664
|
-
|
|
665
|
-
---
|
|
666
|
-
|
|
667
|
-
## 🧪 測試案例
|
|
668
|
-
|
|
669
|
-
### 正向測試(Valid)
|
|
670
|
-
|
|
671
|
-
```
|
|
672
|
-
# Test 1: 最小有效文件
|
|
673
|
-
@meta |v=1.0|c=test|
|
|
674
|
-
@index |tot=0|
|
|
675
|
-
```
|
|
676
|
-
|
|
677
|
-
```
|
|
678
|
-
# Test 2: 包含所有層級
|
|
679
|
-
# .matrix v1.0
|
|
680
|
-
@meta |v=1.0|c=test|t=260208|
|
|
681
|
-
@index |tot=1|c=1|
|
|
682
|
-
@data
|
|
683
|
-
T1|st=C|p=0|
|
|
684
|
-
```
|
|
685
|
-
|
|
686
|
-
```
|
|
687
|
-
# Test 3: 複雜數據結構
|
|
688
|
-
@meta |v=1.0|c=memory|t=260208|r=7d|
|
|
689
|
-
@index |d=260208,260207|e=10|cat=dev,bug|
|
|
690
|
-
@data
|
|
691
|
-
260208|dev|T1,st=P,dur=30m;T2,st=C,dur=45m|note=Daily work|
|
|
692
|
-
260207|bug|T3,st=B,blk=REVIEW|note=Blocked issue|
|
|
693
|
-
```
|
|
694
|
-
|
|
695
|
-
### 負向測試(Invalid)
|
|
696
|
-
|
|
697
|
-
```
|
|
698
|
-
# Test 4: 缺少 @meta(應拒絕)
|
|
699
|
-
@index |tot=1|
|
|
700
|
-
@data
|
|
701
|
-
T1|st=C|
|
|
702
|
-
```
|
|
703
|
-
|
|
704
|
-
```
|
|
705
|
-
# Test 5: 順序錯誤(應拒絕)
|
|
706
|
-
@data
|
|
707
|
-
T1|st=C|
|
|
708
|
-
@meta |v=1.0|c=test|
|
|
709
|
-
@index |tot=1|
|
|
710
|
-
```
|
|
711
|
-
|
|
712
|
-
```
|
|
713
|
-
# Test 6: 分隔符錯誤(應拒絕)
|
|
714
|
-
@meta |v=1.0|c=test
|
|
715
|
-
@index |tot=1|
|
|
716
|
-
```
|
|
717
|
-
|
|
718
|
-
```
|
|
719
|
-
# Test 7: 欄位格式錯誤(應拒絕)
|
|
720
|
-
@data
|
|
721
|
-
T1|st:C|p:0|
|
|
722
|
-
```
|
|
723
|
-
|
|
724
|
-
---
|
|
725
|
-
|
|
726
|
-
## 📚 參考資源
|
|
727
|
-
|
|
728
|
-
### EBNF 標準
|
|
729
|
-
|
|
730
|
-
- **ISO/IEC 14977:1996** - Information technology — Syntactic metalanguage — Extended BNF
|
|
731
|
-
- **W3C EBNF Notation** - https://www.w3.org/TR/REC-xml/#sec-notation
|
|
732
|
-
|
|
733
|
-
### 相關文檔
|
|
734
|
-
|
|
735
|
-
- **格式規格**: `matrix_format_DESIGN_SPEC.md`
|
|
736
|
-
- **縮寫映射表**: `matrix_format_ABBREVIATIONS.md`
|
|
737
|
-
- **Token 對比**: `matrix_format_TOKEN_COMPARISON.md`
|
|
738
|
-
- **範例文件**: `matrix_format_EXAMPLE_*.matrix`
|
|
739
|
-
|
|
740
|
-
---
|
|
741
|
-
|
|
742
|
-
## 🔄 版本歷史
|
|
743
|
-
|
|
744
|
-
| 版本 | 日期 | 變更內容 |
|
|
745
|
-
|------|------|---------|
|
|
746
|
-
| 1.0.0 | 2026-02-08 | 初始版本 - 完整 EBNF 定義 |
|
|
747
|
-
|
|
748
|
-
---
|
|
749
|
-
|
|
750
|
-
**文檔版本**: 1.0.0
|
|
751
|
-
**最後更新**: 2026-02-08
|
|
752
|
-
**維護者**: Developer Team
|
|
753
|
-
**Feature ID**: F-015
|
|
754
|
-
**Task ID**: TASK_139
|