ortim 0.8.0__tar.gz

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.
Files changed (152) hide show
  1. ortim-0.8.0/LICENSE +96 -0
  2. ortim-0.8.0/LICENSE.commercial +47 -0
  3. ortim-0.8.0/NOTICE +29 -0
  4. ortim-0.8.0/PKG-INFO +462 -0
  5. ortim-0.8.0/README.md +426 -0
  6. ortim-0.8.0/ortim/__init__.py +5 -0
  7. ortim-0.8.0/ortim/agents/__init__.py +19 -0
  8. ortim-0.8.0/ortim/agents/analyst.py +68 -0
  9. ortim-0.8.0/ortim/agents/architect.py +419 -0
  10. ortim-0.8.0/ortim/agents/documenter.py +87 -0
  11. ortim-0.8.0/ortim/agents/intent_analyst.py +121 -0
  12. ortim-0.8.0/ortim/agents/orchestrator.py +440 -0
  13. ortim-0.8.0/ortim/agents/prd_analyst.py +134 -0
  14. ortim-0.8.0/ortim/agents/stack_analyst.py +148 -0
  15. ortim-0.8.0/ortim/architecture/__init__.py +33 -0
  16. ortim-0.8.0/ortim/architecture/bootstrap.py +766 -0
  17. ortim-0.8.0/ortim/architecture/golden_paths.py +528 -0
  18. ortim-0.8.0/ortim/architecture/locked_stack.py +97 -0
  19. ortim-0.8.0/ortim/audit/__init__.py +30 -0
  20. ortim-0.8.0/ortim/audit/aggregator.py +368 -0
  21. ortim-0.8.0/ortim/audit/logger.py +134 -0
  22. ortim-0.8.0/ortim/audit/redact.py +98 -0
  23. ortim-0.8.0/ortim/audit/verify.py +93 -0
  24. ortim-0.8.0/ortim/babel/__init__.py +5 -0
  25. ortim-0.8.0/ortim/babel/intent.py +174 -0
  26. ortim-0.8.0/ortim/budget/__init__.py +5 -0
  27. ortim-0.8.0/ortim/budget/tracker.py +160 -0
  28. ortim-0.8.0/ortim/codebase/__init__.py +59 -0
  29. ortim-0.8.0/ortim/codebase/baseline.py +272 -0
  30. ortim-0.8.0/ortim/codebase/exports.py +309 -0
  31. ortim-0.8.0/ortim/codebase/frameworks.py +322 -0
  32. ortim-0.8.0/ortim/codebase/prior_tasks.py +192 -0
  33. ortim-0.8.0/ortim/codebase/reader.py +707 -0
  34. ortim-0.8.0/ortim/codebase/schema.py +131 -0
  35. ortim-0.8.0/ortim/concurrency/__init__.py +5 -0
  36. ortim-0.8.0/ortim/concurrency/lock.py +82 -0
  37. ortim-0.8.0/ortim/dialog/__init__.py +57 -0
  38. ortim-0.8.0/ortim/dialog/storage.py +252 -0
  39. ortim-0.8.0/ortim/doctor.py +486 -0
  40. ortim-0.8.0/ortim/env.py +69 -0
  41. ortim-0.8.0/ortim/executor/__init__.py +96 -0
  42. ortim-0.8.0/ortim/executor/git_ops.py +195 -0
  43. ortim-0.8.0/ortim/executor/perf_reviewer.py +94 -0
  44. ortim-0.8.0/ortim/executor/reviewer.py +294 -0
  45. ortim-0.8.0/ortim/executor/runner.py +573 -0
  46. ortim-0.8.0/ortim/executor/sandbox.py +162 -0
  47. ortim-0.8.0/ortim/executor/security_reviewer.py +102 -0
  48. ortim-0.8.0/ortim/executor/status.py +55 -0
  49. ortim-0.8.0/ortim/executor/test_reviewer.py +116 -0
  50. ortim-0.8.0/ortim/executor/test_runner.py +257 -0
  51. ortim-0.8.0/ortim/executor/worker.py +231 -0
  52. ortim-0.8.0/ortim/extend/__init__.py +45 -0
  53. ortim-0.8.0/ortim/extend/delta_writer.py +86 -0
  54. ortim-0.8.0/ortim/extend/drift.py +409 -0
  55. ortim-0.8.0/ortim/extend/extender_agent.py +200 -0
  56. ortim-0.8.0/ortim/extend/schema.py +69 -0
  57. ortim-0.8.0/ortim/hooks/__init__.py +5 -0
  58. ortim-0.8.0/ortim/hooks/registry.py +157 -0
  59. ortim-0.8.0/ortim/llm/__init__.py +23 -0
  60. ortim-0.8.0/ortim/llm/client.py +274 -0
  61. ortim-0.8.0/ortim/llm/providers.py +100 -0
  62. ortim-0.8.0/ortim/llm/router.py +85 -0
  63. ortim-0.8.0/ortim/main.py +3963 -0
  64. ortim-0.8.0/ortim/memory/__init__.py +5 -0
  65. ortim-0.8.0/ortim/memory/loader.py +57 -0
  66. ortim-0.8.0/ortim/mutation/__init__.py +22 -0
  67. ortim-0.8.0/ortim/mutation/case.py +146 -0
  68. ortim-0.8.0/ortim/mutation/cases.py +287 -0
  69. ortim-0.8.0/ortim/mutation/runner.py +145 -0
  70. ortim-0.8.0/ortim/mutation/scoring.py +53 -0
  71. ortim-0.8.0/ortim/orchestrator/__init__.py +49 -0
  72. ortim-0.8.0/ortim/orchestrator/gate_detector.py +198 -0
  73. ortim-0.8.0/ortim/orchestrator/project.py +225 -0
  74. ortim-0.8.0/ortim/orchestrator/state_machine.py +232 -0
  75. ortim-0.8.0/ortim/orchestrator/task_dag.py +164 -0
  76. ortim-0.8.0/ortim/scope/__init__.py +21 -0
  77. ortim-0.8.0/ortim/scope/schema.py +202 -0
  78. ortim-0.8.0/ortim/security/__init__.py +8 -0
  79. ortim-0.8.0/ortim/security/sensitive_patterns.py +142 -0
  80. ortim-0.8.0/ortim/skills/__init__.py +23 -0
  81. ortim-0.8.0/ortim/skills/loader.py +202 -0
  82. ortim-0.8.0/ortim/skills/resolver.py +102 -0
  83. ortim-0.8.0/ortim/skills/schema.py +112 -0
  84. ortim-0.8.0/ortim.egg-info/PKG-INFO +462 -0
  85. ortim-0.8.0/ortim.egg-info/SOURCES.txt +150 -0
  86. ortim-0.8.0/ortim.egg-info/dependency_links.txt +1 -0
  87. ortim-0.8.0/ortim.egg-info/entry_points.txt +3 -0
  88. ortim-0.8.0/ortim.egg-info/requires.txt +12 -0
  89. ortim-0.8.0/ortim.egg-info/top_level.txt +1 -0
  90. ortim-0.8.0/pyproject.toml +76 -0
  91. ortim-0.8.0/setup.cfg +4 -0
  92. ortim-0.8.0/tests/test_app_class_inference.py +79 -0
  93. ortim-0.8.0/tests/test_architect_brownfield.py +221 -0
  94. ortim-0.8.0/tests/test_architect_key_libraries_discipline.py +332 -0
  95. ortim-0.8.0/tests/test_audit_aggregator.py +450 -0
  96. ortim-0.8.0/tests/test_audit_chain.py +90 -0
  97. ortim-0.8.0/tests/test_audit_logger.py +90 -0
  98. ortim-0.8.0/tests/test_audit_redact.py +93 -0
  99. ortim-0.8.0/tests/test_bootstrap.py +893 -0
  100. ortim-0.8.0/tests/test_budget_gate.py +239 -0
  101. ortim-0.8.0/tests/test_budget_multi_provider.py +155 -0
  102. ortim-0.8.0/tests/test_budget_tracker.py +151 -0
  103. ortim-0.8.0/tests/test_cli_brownfield.py +110 -0
  104. ortim-0.8.0/tests/test_codebase_baseline.py +103 -0
  105. ortim-0.8.0/tests/test_codebase_reader.py +339 -0
  106. ortim-0.8.0/tests/test_concurrency_lock.py +116 -0
  107. ortim-0.8.0/tests/test_demo.py +124 -0
  108. ortim-0.8.0/tests/test_dialog_analysts.py +273 -0
  109. ortim-0.8.0/tests/test_dialog_storage.py +156 -0
  110. ortim-0.8.0/tests/test_doctor.py +218 -0
  111. ortim-0.8.0/tests/test_drift_detection.py +401 -0
  112. ortim-0.8.0/tests/test_env_shim.py +119 -0
  113. ortim-0.8.0/tests/test_executor.py +732 -0
  114. ortim-0.8.0/tests/test_export_extractor.py +161 -0
  115. ortim-0.8.0/tests/test_extend_cli.py +382 -0
  116. ortim-0.8.0/tests/test_extend_dag_validation.py +388 -0
  117. ortim-0.8.0/tests/test_extend_delta_writer.py +158 -0
  118. ortim-0.8.0/tests/test_extend_schema.py +287 -0
  119. ortim-0.8.0/tests/test_extender_agent.py +287 -0
  120. ortim-0.8.0/tests/test_gate_detector.py +222 -0
  121. ortim-0.8.0/tests/test_golden_paths.py +248 -0
  122. ortim-0.8.0/tests/test_hooks.py +162 -0
  123. ortim-0.8.0/tests/test_llm_providers.py +118 -0
  124. ortim-0.8.0/tests/test_llm_retry.py +196 -0
  125. ortim-0.8.0/tests/test_llm_router.py +147 -0
  126. ortim-0.8.0/tests/test_m2_integration.py +258 -0
  127. ortim-0.8.0/tests/test_memory_loader.py +88 -0
  128. ortim-0.8.0/tests/test_mutation_cases.py +81 -0
  129. ortim-0.8.0/tests/test_mutation_runner.py +240 -0
  130. ortim-0.8.0/tests/test_mutation_scoring.py +207 -0
  131. ortim-0.8.0/tests/test_ollama_provider.py +222 -0
  132. ortim-0.8.0/tests/test_orchestrator_module_scope.py +259 -0
  133. ortim-0.8.0/tests/test_prior_outputs.py +163 -0
  134. ortim-0.8.0/tests/test_prior_outputs_injection.py +143 -0
  135. ortim-0.8.0/tests/test_reviewer_chain.py +601 -0
  136. ortim-0.8.0/tests/test_schema_gate.py +256 -0
  137. ortim-0.8.0/tests/test_scope_cli.py +189 -0
  138. ortim-0.8.0/tests/test_scope_manifest.py +131 -0
  139. ortim-0.8.0/tests/test_sensitive_patterns.py +162 -0
  140. ortim-0.8.0/tests/test_skill_community.py +194 -0
  141. ortim-0.8.0/tests/test_skill_docker_resolver.py +277 -0
  142. ortim-0.8.0/tests/test_skill_injection.py +184 -0
  143. ortim-0.8.0/tests/test_skills_loader.py +220 -0
  144. ortim-0.8.0/tests/test_skills_resolver.py +349 -0
  145. ortim-0.8.0/tests/test_state_machine.py +305 -0
  146. ortim-0.8.0/tests/test_task_dag.py +193 -0
  147. ortim-0.8.0/tests/test_task_dag_phase.py +87 -0
  148. ortim-0.8.0/tests/test_tenant_passthrough.py +127 -0
  149. ortim-0.8.0/tests/test_test_runner.py +218 -0
  150. ortim-0.8.0/tests/test_tier_scorer_hints.py +136 -0
  151. ortim-0.8.0/tests/test_user_stack_hints.py +152 -0
  152. ortim-0.8.0/tests/test_worker_skill_enforcement.py +327 -0
ortim-0.8.0/LICENSE ADDED
@@ -0,0 +1,96 @@
1
+ # Functional Source License, Version 1.1, Apache 2.0 Future License
2
+
3
+ ## Abbreviation
4
+
5
+ FSL-1.1-Apache-2.0
6
+
7
+ ## Notice
8
+
9
+ Copyright 2026 ortim.dev
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly display
28
+ and redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or
34
+ service that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software
39
+ that exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee
52
+ using the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to
59
+ the infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software,
68
+ you must include a copy of or a link to these Terms and Conditions and not
69
+ remove any copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, INCLUDING
74
+ WITHOUT LIMITATION ANY WARRANTIES OF MERCHANTABILITY, NON-INFRINGEMENT,
75
+ FITNESS FOR A PARTICULAR PURPOSE OR TITLE.
76
+
77
+ LICENSOR WILL NOT BE LIABLE TO YOU FOR ANY DAMAGES ARISING OUT OF THESE TERMS
78
+ OR THE USE OR NATURE OF THE SOFTWARE, UNDER ANY KIND OF LEGAL CLAIM.
79
+
80
+ ### Trademarks
81
+
82
+ Except for displaying the License Details and identifying us as the origin of
83
+ the Software, you have no right under these Terms and Conditions to use our
84
+ trademarks, trade names, service marks or product names.
85
+
86
+ ## Grant of Future License
87
+
88
+ We hereby irrevocably grant you an additional license to use the Software
89
+ under the Apache License, Version 2.0 that is effective on the second
90
+ anniversary of the date we make the Software available. On or after that
91
+ date, you may use the Software under the Apache License, Version 2.0, in
92
+ which case the following will apply:
93
+
94
+ Licensor hereby grants you a license to the Software under the Apache
95
+ License, Version 2.0, a copy of which is available at
96
+ https://www.apache.org/licenses/LICENSE-2.0.
@@ -0,0 +1,47 @@
1
+ # Ortim — Commercial License
2
+
3
+ Copyright 2026 ortim.dev — All Rights Reserved.
4
+
5
+ This file applies **only** to source files marked with the SPDX identifier
6
+ `LicenseRef-Commercial`, which currently live under the `enterprise/`
7
+ directory. All other source files in this repository are licensed under
8
+ FSL-1.1-Apache-2.0 (see `LICENSE`).
9
+
10
+ ## 1. Scope
11
+
12
+ The Commercial Software is offered under a separate commercial agreement
13
+ between ortim.dev and the Licensee. Without such an agreement, the
14
+ Commercial Software may not be used, copied, modified, merged, published,
15
+ distributed, sublicensed, or sold.
16
+
17
+ ## 2. Permitted Use Without Agreement
18
+
19
+ In the absence of a commercial agreement, the source code under
20
+ `enterprise/` is provided **for evaluation and reference only**. No
21
+ production use, no redistribution, no derivative works.
22
+
23
+ ## 3. Obtaining a Commercial Agreement
24
+
25
+ For pricing, terms, and a commercial license agreement covering one or more
26
+ of the following, contact `licensing@ortim.dev` (or the address listed at
27
+ `https://ortim.dev/contact`):
28
+
29
+ - Multi-tenant orchestrator deployment
30
+ - SSO / SAML integration
31
+ - Long-term audit retention with off-site export (S3, GCS, Azure Blob)
32
+ - SLA-backed support tier (response time guarantees, priority bug fixes)
33
+ - Custom Golden Path tiers and reviewer chains
34
+ - White-label / OEM redistribution rights
35
+
36
+ ## 4. No Warranty
37
+
38
+ THE COMMERCIAL SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY
39
+ KIND. ORTIM.DEV WILL NOT BE LIABLE FOR ANY DAMAGES ARISING OUT OF THE USE OR
40
+ NATURE OF THE COMMERCIAL SOFTWARE, UNDER ANY KIND OF LEGAL CLAIM, EXCEPT AS
41
+ EXPLICITLY SET OUT IN A SIGNED COMMERCIAL AGREEMENT.
42
+
43
+ ## 5. Trademarks
44
+
45
+ "Ortim" and the ortim.dev domain are trademarks of ortim.dev. Use of these
46
+ marks beyond identifying ortim.dev as the origin of the Commercial Software
47
+ requires a separate trademark agreement.
ortim-0.8.0/NOTICE ADDED
@@ -0,0 +1,29 @@
1
+ Ortim
2
+ Copyright 2026 ortim.dev
3
+
4
+ This product is dual-licensed:
5
+
6
+ * Source files under `runtime/`, `agents/`, `docs/`, `tests/`, `scripts/`,
7
+ `fixtures/`, and the repository root (excluding `enterprise/`) are
8
+ licensed under the Functional Source License, Version 1.1, Apache 2.0
9
+ Future License (FSL-1.1-Apache-2.0). See LICENSE.
10
+
11
+ * Source files under `enterprise/` are licensed under a Commercial
12
+ License. See LICENSE.commercial.
13
+
14
+ Each source file declares its license via an SPDX identifier in its header.
15
+
16
+ This product includes software developed by third parties:
17
+
18
+ * anthropic (Anthropic, Inc.) — MIT
19
+ * pydantic (Pydantic Services, Inc.) — MIT
20
+ * typer (Sebastián Ramírez) — MIT
21
+ * rich (Will McGugan) — MIT
22
+ * python-dotenv (Saurabh Kumar) — BSD-3-Clause
23
+ * pathspec (Caleb P. Burns) — MPL-2.0 [planned dependency, M1]
24
+
25
+ Full third-party license texts are available at the source repositories of
26
+ each dependency. Inclusion in this NOTICE does not imply that the listed
27
+ projects endorse Ortim.
28
+
29
+ For commercial licensing inquiries: licensing@ortim.dev
ortim-0.8.0/PKG-INFO ADDED
@@ -0,0 +1,462 @@
1
+ Metadata-Version: 2.4
2
+ Name: ortim
3
+ Version: 0.8.0
4
+ Summary: Ortim — agentic dev pipeline with deterministic architecture, audit, and gated execution
5
+ Author: ortim.dev
6
+ License: FSL-1.1-Apache-2.0
7
+ Project-URL: Homepage, https://ortim.dev
8
+ Project-URL: Source, https://ortim.dev
9
+ Keywords: llm,agents,code-generation,ai-pipeline,orchestration
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Topic :: Software Development :: Build Tools
19
+ Requires-Python: >=3.11
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ License-File: LICENSE.commercial
23
+ License-File: NOTICE
24
+ Requires-Dist: anthropic>=0.39.0
25
+ Requires-Dist: pydantic>=2.0
26
+ Requires-Dist: typer>=0.12.0
27
+ Requires-Dist: rich>=13.0
28
+ Requires-Dist: python-dotenv>=1.0
29
+ Requires-Dist: pathspec>=0.12
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest>=8.0; extra == "dev"
32
+ Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
33
+ Requires-Dist: ruff>=0.6; extra == "dev"
34
+ Requires-Dist: mypy>=1.10; extra == "dev"
35
+ Dynamic: license-file
36
+
37
+ # Ortim
38
+
39
+ > Yapay zeka destekli, sıkı kurallı, çok-ajanlı yazılım geliştirme platformu.
40
+
41
+ **Lisans:** FSL-1.1-Apache-2.0 (core) + Commercial (enterprise/). Bkz. `LICENSE` ve `LICENSE.commercial`.
42
+
43
+ 7-katmanlı orchestrator + 12 ajan + document-driven flow (PRD → RFC → Task) + Golden Paths (T0–T6 web, M0–M2 mobile, D0–D1 desktop) + 7 HITL gate.
44
+
45
+ Felsefe: **markdown bilgiyi söyler, runtime kuralı zorlar**. LLM "atlamak" istese bile state machine, deterministic tier scorer ve DAG validator engeller.
46
+
47
+ Detaylı spec: **[Ortim_Architecture.md](./Ortim_Architecture.md)**
48
+
49
+ CLI komutu: `ortim` (canonical) — `ai-factory` alias geriye uyumluluk için korunur.
50
+
51
+ ## Status: v0.8 (post M3.1 v1 production-ready + Item 48 ship)
52
+
53
+ > **2026-05-15 update:** **`ortim extend` end-to-end validated** — DONE projeye yeni feature ekleyebilen iteratif pipeline (M3.1 v1 = M3.1.0 foundation + M3.1.1 executor wiring + Item 48 AC-aggregation discipline). Iki proof-point: (1) planning chain — TR tagging brief, 4 task üretildi (saw-tooth module-drift correction by Architect, scope/continuity/ID-collision validators, M4 cross-task export visibility hepsi green); (2) execution chain — 3/4 task otomatik (T-007 schema first-attempt DONE; T-008 tagging CRUD 2nd-attempt DONE via Item 15a sandbox feedback; T-009 task-module ext AWAITING_HITL with valid L1 boundary + criterion-mismatch findings; T-010 not started). T-009 HITL **bug değil**, reviewer'ın iş tanımı. Test sayım: **404**; sıfır kalıcı regresyon. Açık actionable backlog: 8 (0× P2, 8× P3). M3.1 planning + happy-path execution production-ready; G-1/G-2 surveillance items added. **M5 RAG ertelendi** (M5-design.md §13.3 Option α). Detaylı: [`docs/backlog.md`](./docs/backlog.md), `tespit.md` "Execution-stage proof-point" bölümü.
54
+
55
+ | Bileşen | Durum |
56
+ |---|---|
57
+ | **Foundation (v0.4–v0.6d)** | |
58
+ | State machine + project lifecycle + 7 HITL gate'i (G1–G7) | OK |
59
+ | Babel TR↔EN intent + Memory loader (L1 / glossary / template / agent prompts) | OK |
60
+ | Worker + Reviewer chain (Code soft + Security/Test hard veto + Perf soft) | OK |
61
+ | Git branch isolation + `git worktree` paralel + serileştirilmiş merge | OK |
62
+ | Test runner (per-task scope, vitest/pytest/flutter), hooks (`pre_commit` + `pre_deploy`) | OK |
63
+ | Multi-LLM (Anthropic + DeepSeek) + per-role routing + per-provider budget | OK |
64
+ | Audit JSONL hash chain + thread-safe + budget tracker | OK |
65
+ | Golden Paths scorer T0–T6 + tier docs + RFC template §1–§16 | OK |
66
+ | **M1 — Brownfield desteği (2026-05-08)** | |
67
+ | Codebase reader + framework detection + `bootstrap_brownfield` | OK |
68
+ | Mobile (M0–M2 Flutter) + Desktop (D0–D1 Tauri) tier'ları | OK |
69
+ | `ortim new --from-existing` / `inspect` / `rescan` / `baseline` komutları | OK |
70
+ | **M1.5 — Workspace bootstrap (2026-05-08)** | |
71
+ | `ortim/architecture/bootstrap.py` — per-tier root template + auto-retry loop | OK |
72
+ | Windows console UTF-8 reconfigure (cp1254 crash fix) | OK |
73
+ | `_NPM_DEP_REGISTRY` (`react`/`vite`/`zod`/`idb`/`dexie`/`localforage`/...) + `_FRAMEWORK_PACKAGES` map | OK |
74
+ | Test peer auto-pull (`@testing-library/react`, `fake-indexeddb`) | OK |
75
+ | Silent-drop visibility — unknown `key_library` → stderr WARNING | OK |
76
+ | **Phase 0 — Foundation hardening (2026-05-08)** | |
77
+ | Reviewer rubric (per-criterion verdict + L1 ayrım + `unverifiable` 2-mode) | OK |
78
+ | Orchestrator binary acceptance criteria (Hard Rule 10 ban-list) | OK |
79
+ | Test runner auto-detect (`.ortim.env` from tier+app_class) | OK |
80
+ | Reviewer length validator (retry-with-correction) + sandbox feedback in `prior_reasons` | OK |
81
+ | **M2 — Conversational Intake (2026-05-13)** | |
82
+ | Dialog states `INTAKE_DIALOG` / `STACK_DIALOG` / `PRD_DIALOG` + `ortim discuss`/`refine`/`lock`/`show` | OK |
83
+ | Split analysts: `IntentAnalyst` / `StackAnalyst` / `PRDAnalyst` | OK |
84
+ | `LockedStack` artifact — single source of truth for downstream layers | OK |
85
+ | **M3 — Skills system (2026-05-13)** | |
86
+ | `skills/<scope>/<name>.md` frontmatter + resolver + per-task injection | OK |
87
+ | 6 seed skills (typescript-module-boundaries, sql-mock-patterns, react-dependency-injection, react-ui-test-text-matching, ...) | OK |
88
+ | **M4 — Cross-task export visibility (2026-05-13)** | |
89
+ | Worker sees prior DONE task'ların public export'larını; import shape inference | OK |
90
+ | **M3.1 — `ortim extend` iteratif geliştirme (2026-05-15)** | |
91
+ | EXTEND_DIALOG / EXTEND_PRD / EXTEND_RFC state machine + G1/G2 cycle N HITL gates | OK |
92
+ | `ExtenderAgent.draft_delta_prd` / `draft_delta_rfc` + BLOCKED-STACK escape hatch | OK |
93
+ | Idempotent `delta_writer.append_delta_section` (cycle = de-dupe key) | OK |
94
+ | `Orchestrator.generate_dag(prior_dag=...)` + ID collision / continuity / scope-union validators | OK |
95
+ | Extend-cycle AC-aggregation guidance (10-AC → 3-5 task target) | OK (Item 48) |
96
+ | `ortim extend <id> "<brief>"` + `ortim extensions <id>` CLI | OK |
97
+ | **Operational hardening (Items 22–24, 40, 42–48)** | |
98
+ | LLM transient retry (503/429 exponential backoff) | OK (Item 22) |
99
+ | Provider fail-loud (critical roles emit stderr WARNING on global fallback) | OK (Item 23) |
100
+ | `unverifiable_reason` two-mode (`criterion_design` vs `test_infrastructure`) | OK (Item 24) |
101
+ | Architect §4 key_libraries discipline (post-draft subset validator + retry) | OK (Item 40) |
102
+ | Architect Call 1 derivation rules (single-user → small/solo/low; few-shot) — 5/5 deterministic | OK (Item 45) |
103
+ | Orchestrator DAG-RFC module match (Hard Rule 13 + validator) | OK (Item 42) |
104
+ | Reviewer stack-citation discipline (`stack.json.key_libraries` verbatim) | OK (Item 43) |
105
+ | StackAnalyst browser-only intent detection (Hono/Express/Fastify/Koa forbidden) | OK (BaaS-drift) |
106
+ | `_INDEXEDDB_PEERS` auto-pull `fake-indexeddb` for jsdom shim | OK (Item 47b) |
107
+ | Orchestrator extend-cycle AC-aggregation discipline | OK (Item 48) |
108
+ | **Deferred** | |
109
+ | M5 RAG (Obsidian) + MCP | Ertelendi (M5-design.md §13.3 Option α) |
110
+ | Drift detector + GC + migration agent | Future (M3.1.2 — multi-cycle continuity'den sonra) |
111
+ | G-1 M4 export visibility vs barrel-import (extend mode) | Surveillance — 2 more occurrences |
112
+ | G-2 `test_infrastructure_unavailable` mode coarseness | Surveillance — 2 more occurrences |
113
+
114
+ ## Kurulum
115
+
116
+ Gereksinimler: **Python 3.11+**, **Anthropic API key** (`run` komutu için; `score-tier` ve state komutları key gerektirmez).
117
+
118
+ ```powershell
119
+ cd C:\Flutter\projects\ai-factory
120
+
121
+ python -m venv .venv
122
+ .\.venv\Scripts\Activate.ps1
123
+
124
+ pip install -e .
125
+
126
+ Copy-Item .env.example .env
127
+ # .env dosyasını düzenle, ANTHROPIC_API_KEY ekle
128
+ ```
129
+
130
+ ## Hızlı Başlangıç
131
+
132
+ ```powershell
133
+ # 1. Yeni proje aç (Türkçe brief)
134
+ ortim new "Bir görev yönetim uygulaması istiyorum" --name todo-app
135
+ # → workspaces/<id>/state.json oluşur, state = intake
136
+
137
+ # 2. Babel + Analyst + Architect + Orchestrator pipeline'ı çalıştır
138
+ ortim run <project-id>
139
+ # → intent.json → PRD.md → HITL Gate G1
140
+
141
+ # 3. PRD'yi gözden geçir (workspaces/<id>/PRD.md), sonra onayla
142
+ ortim advance <project-id> prd_approved --note "reviewed"
143
+
144
+ # 4. Architect + Orchestrator devam etsin
145
+ ortim run <project-id>
146
+ # → golden_path_inputs.json → tier seçimi → RFC.md → HITL Gate G2
147
+
148
+ # 5. RFC'yi onayla
149
+ ortim advance <project-id> rfc_approved --note "reviewed"
150
+
151
+ # 6. TaskDAG üretsin
152
+ ortim run <project-id>
153
+ # → task_dag.json + tasks/T-*.md (her atomic task için)
154
+
155
+ # 7. Task DAG'ı incele
156
+ ortim tasks <project-id>
157
+
158
+ # 8. Token + maliyet raporu
159
+ ortim budget <project-id>
160
+ ```
161
+
162
+ ## CLI Referansı
163
+
164
+ | Komut | Amaç |
165
+ |---|---|
166
+ | `ortim doctor [--json]` | Environment health check: Python sürümü, API key'ler, runtime binaries (node/git/flutter/cargo/go), agent prompts, skill dir. Exit 0 clean / 2 recommended eksik / 3 required eksik. |
167
+ | `ortim demo [--brief "..."] [--execute]` | End-to-end planning walkthrough: brief → PRD → RFC → DAG. G1/G2 auto-approve, dialog-mode-off scoped. ~$0.02-0.05 cost on DeepSeek. `--execute` ile T-001'i de koştur. |
168
+ | `ortim new <brief> --name <ad>` | Yeni proje aç |
169
+ | `ortim run <id> [--step babel\|analyst\|architect\|orchestrator\|auto]` | Mevcut state'e göre uygun ajanı koştur |
170
+ | `ortim status <id>` | Proje detayı + history |
171
+ | `ortim list-projects` | Tüm projeler |
172
+ | `ortim tasks <id>` | TaskDAG + paralel batch'ler |
173
+ | `ortim execute <id> <task-id> [--max-attempts N]` | Tek task'ı Worker → tests → Reviewer pipeline'ından geçir |
174
+ | `ortim run-all <id> [--max-attempts N] [--continue-on-fail] [--parallel] [--max-workers N]` | DAG'ı topolojik batch'lerde koştur (default sıralı; `--parallel` ile worktree'li thread pool) |
175
+ | `ortim budget [<id>]` | Token + USD raporu (audit log üzerinden) |
176
+ | `ortim retro <id> [--per-task] [--category <name>] [--json]` | Retrospective rollup: per-category token+USD, per-task attempt counts (worker / sandbox / reviewer reject), skill triggers, HITL escalations, task wall-time p50/p95 |
177
+ | `ortim drift-check <id> [--json]` | Multi-cycle integrity check: module scope (D1), ID continuity (D2), ID collision (D3), status↔audit reconciliation (D4). Exit 0 clean / 2 warning / 3 error. |
178
+ | `ortim states` | Tüm state'ler ve izinli geçişler |
179
+ | `ortim advance <id> <target> [--note]` | Manuel state ilerletme (HITL onayları + acil durum) |
180
+ | `ortim score-tier [...]` | Verilen input'larla tier seçim algoritmasını koştur (API key gerekmez) |
181
+ | `ortim extend <id> "<brief>"` | DONE projeye yeni feature delta'sı: Babel → ExtenderAgent → delta PRD; G1 (cycle N) açılır |
182
+ | `ortim extensions <id>` | Projenin extend cycle geçmişi (PRD.md'den okur) |
183
+
184
+ ## State Machine ve HITL Gate'ler
185
+
186
+ ```
187
+ intake → babel_processing → prd_drafting → prd_awaiting_approval → prd_approved
188
+ ↑ G1 ↓
189
+ → rfc_drafting → rfc_awaiting_approval → rfc_approved → tasks_generating
190
+ ↑ G2 ↓
191
+ → tasks_ready → executing → done
192
+ ↘ failed / paused (her noktadan)
193
+ ```
194
+
195
+ - Her transition `ortim/orchestrator/state_machine.py:TRANSITIONS` içinde explicit. Atlamak imkansız (`InvalidTransition` raise).
196
+ - **G1 (PRD)** ve **G2 (RFC)** zorunlu insan onayı. CLI `prd_awaiting_approval` veya `rfc_awaiting_approval`'da durur, kullanıcı `advance ... prd_approved` çağırmadan ilerlemez.
197
+ - G3–G7 (schema, external, security, deploy, budget) iter 5+ ile gelecek.
198
+
199
+ ## Mimari Akış
200
+
201
+ ```
202
+ [TR brief]
203
+
204
+ Babel (intent.json + TR round-trip)
205
+
206
+ Analyst (PRD.md, [NEEDS-INPUT] eksikler işaretlenir)
207
+ ↓ G1
208
+ Architect (1) GoldenPathInputs JSON (LLM)
209
+ (2) tier seçimi (deterministic — score_tier ayrıca CLI'dan)
210
+ (3) RFC.md (LLM, tier KİLİT)
211
+ ↓ G2
212
+ Orchestrator (TaskDAG: id formatı T-*, deps, ≤20K token/task,
213
+ cycle + missing-dep validation, 3x retry)
214
+
215
+ Worker + Reviewer (iter 5)
216
+ ```
217
+
218
+ Önemli boundary'ler:
219
+ - **Tier seçimini LLM yapmaz.** Architect agent PRD'den input çıkarır; `ortim/architecture/golden_paths.py` kural-temelli skor hesaplar. T4 (Modular Monolith) hiç bloklanmayan default.
220
+ - **Analyst teknik karar veremez.** Sistem promptu yasaklar; PRD template'i tech-stack alanı içermez.
221
+ - **Orchestrator'un DAG'ını runtime validate eder.** LLM cycle veya eksik dependency üretirse retry; 3 hata = `failed`.
222
+
223
+ ## Klasör Yapısı
224
+
225
+ ```
226
+ ortim/ # repo dizini (canonical brand: Ortim)
227
+ ├── Ortim_Architecture.md Master spec
228
+ ├── LICENSE FSL-1.1-Apache-2.0 (core)
229
+ ├── LICENSE.commercial Commercial (enterprise/)
230
+ ├── NOTICE Third-party attribution
231
+ ├── enterprise/ Commercial-licensed tier (M5+ kapsamı, M1'de boş iskelet)
232
+ ├── README.md Bu dosya
233
+ ├── pyproject.toml Paket + ruff + mypy + pytest config
234
+ ├── .env.example Anthropic key + bütçe + audit path
235
+ ├── docs/
236
+ │ ├── principles/core.md L1 immutable kurallar
237
+ │ ├── golden-paths/ T0–T6 (şu an: index + T4 detaylı)
238
+ │ ├── glossary/tr-en.md Babel sözlüğü
239
+ │ └── templates/ PRD / RFC / Task template'leri
240
+ ├── agents/ Ajan system promptları (babel, analyst, architect, orchestrator)
241
+ ├── ortim/
242
+ │ ├── main.py CLI entry (typer + rich)
243
+ │ ├── orchestrator/
244
+ │ │ ├── state_machine.py States + TRANSITIONS + HITL_GATES
245
+ │ │ ├── project.py Project model + persist + transition + history
246
+ │ │ └── task_dag.py TaskSpec + TaskDAG + Kahn validation + topological_batches
247
+ │ ├── babel/intent.py StructuredIntent + extract + round_trip
248
+ │ ├── memory/loader.py Markdown concat (principles, glossary, templates, agent prompts)
249
+ │ ├── architecture/
250
+ │ │ └── golden_paths.py Tier enum + GoldenPathInputs + 7 scorer + select_tier
251
+ │ ├── agents/ Analyst / Architect / Orchestrator agent classes
252
+ │ ├── llm/client.py Anthropic wrapper (system+user, token usage döndürür)
253
+ │ ├── audit/logger.py JSONL append-only event log
254
+ │ ├── budget/tracker.py Audit log → token & cost raporu
255
+ │ ├── concurrency/lock.py mkdir-atomic file lock (LockTimeout, stale recovery)
256
+ │ └── executor/ (iter 5)
257
+ ├── workspaces/ Per-project state (gitignored: state.json, intent.json, PRD.md, RFC.md, tasks/, task_dag.json)
258
+ └── tests/ state_machine, memory_loader, golden_paths, budget_tracker, task_dag, concurrency_lock, executor, audit_logger
259
+ ```
260
+
261
+ ## Yol Haritası
262
+
263
+ ### İter 5a + 5b (TAMAMLANDI) — Worker, sandbox, git, test runner, batch executor
264
+
265
+ 5a'da boundary'ler izole edildi (sandbox + soft-veto reviewer); 5b'de yetenekler genişletildi.
266
+
267
+ - **`ortim/executor/sandbox.py`** — `normalize_relative` (abs/`..`/Win drive reject), `check_in_scope` (prefix match, sibling/lookalike reject), `check_extension` (kaynak kod + config + docs + bilinen basename whitelist; binaries reject), `resolve_in_workspace` (symlink escape reject)
268
+ - **`ortim/executor/worker.py`** — `WorkerAgent` (LLM + sandbox-validated `WorkerOutput`); reject ettiğinde retry'da prior reviewer reasons'ı yeni prompt'a inject eder
269
+ - **`ortim/executor/reviewer.py`** — `CodeReviewerAgent` (soft veto; test result görür, fail varsa hard reject)
270
+ - **`ortim/executor/status.py`** — `task_status.json` sidecar (PENDING/IN_PROGRESS/DONE/FAILED/AWAITING_HITL + attempts + last verdict)
271
+ - **`ortim/executor/git_ops.py`** — subprocess wrapper: `ensure_repo` (init + main + seed commit), `start_task_branch`, `commit_changes`, `merge_task_to_main`, `abandon_task_branch`. Env-driven via `ORTIM_GIT_ENABLED=auto|true|false`.
272
+ - **`ortim/executor/test_runner.py`** — `ORTIM_TEST_CMD` set edilirse subprocess'le çalışır (timeout, exit code, stdout/stderr tail). Auto-detect yok — kullanıcı açık seçim yapar.
273
+ - **`ortim/executor/runner.py`** — `execute_task()` çekirdek pipeline: Worker → write files → run tests → Reviewer → commit/abandon. CLI thin wrapper.
274
+ - **CLI:** `execute <id> <task-id>` (tek task), `run-all <id>` (DAG'ı topolojik batch'lerde sıralı koştur)
275
+ - **Smoke test:** 30/30 (`tests/test_executor.py`, LLM-free; git lifecycle dahil)
276
+ - **Agent prompts:** `agents/worker.md`, `agents/reviewer.md` v0.5b kuralları (file whitelist, test contract)
277
+
278
+ ### İter 5c (TAMAMLANDI) — Paralel batch execution + worktree
279
+
280
+ 5b'de tek-tek seri çalışan executor, 5c'de batch içindeki bağımsız task'lar için paralelleşti.
281
+
282
+ - **`ortim/executor/git_ops.py`** — `add_worktree(workspace, task_id)` fresh `task/<id>` branch'i `<workspace>/.worktrees/<task_id>` altına bağlar; `remove_worktree` + `merge_task_to_main` worktree-aware (merge sonrası worktree silinir, sonra `branch -D`). `add_worktree` idempotent — eski worktree/branch kalıntılarını otomatik temizler.
283
+ - **`ortim/executor/runner.py`** — `execute_task(..., use_worktree=True)` Worker write + test + reviewer'ı worktree dizininde koşturur; commit worktree'de yapılır, `ExecutionResult.needs_merge=True` döner. Caller (yalnız `run-all --parallel`) merge'i seri biçimde yapar. Sequential mod (`use_worktree=False`) eskisi gibi: worker direkt ana repo'da `task/<id>` checkout eder ve inline merge eder.
284
+ - **`ortim/main.py:run-all`** — `--parallel` / `--sequential` (default: sequential), `--max-workers N` (default: 4). Paralel modda: `ThreadPoolExecutor` ile batch içi paralel exec; `merge_lock` ile merge serileştirilir; `status_lock` ile `task_status.json` save serileştirilir; merge conflict → task `AWAITING_HITL`. Workspace bazlı `file_lock(workspace/.exec)` aynı projede iki `run-all`'ı engeller.
285
+ - **`ortim/concurrency/lock.py`** — `mkdir`-atomic file_lock şimdi aktif kullanımda (`run-all` exec lock + paralel test'ler), stale-lock recovery (>2x timeout) korunuyor.
286
+ - **`ortim/audit/logger.py`** — `threading.Lock` ile per-instance write serializasyonu eklendi; paralel Worker'lar JSONL satırlarını bozmaz.
287
+ - **Batch-level metrikler** — her batch sonunda `executor_batch_metrics` audit event: `wall_seconds`, `sum_task_seconds`, `speedup`, `merge_wait_seconds`, `task_count`, `mode`, `max_workers`. Konsolda paralel batch için "batch süresi Xs, hızlanma xN" satırı.
288
+ - **Smoke test:** 88/88 (`tests/test_executor.py` 33, `test_concurrency_lock.py` 5, `test_audit_logger.py` 2 — concurrent JSONL integrity dahil; diğer suite'ler değişmedi)
289
+
290
+ ### İter 6a (TAMAMLANDI) — Multi-LLM provider abstraction + DeepSeek
291
+
292
+ LLM çağrıları artık provider-agnostic. DeepSeek'in Anthropic-uyumlu endpoint'i (`https://api.deepseek.com/anthropic`) `anthropic` SDK ile çalışır — sadece `base_url` farklı.
293
+
294
+ - **`ortim/llm/providers.py`** (yeni) — `ProviderConfig` registry: `anthropic`, `deepseek`. `pricing_for(provider, model)`, `resolve_provider(name)`.
295
+ - **`ortim/llm/client.py`** — provider seçimi `resolve_provider`'dan; `Anthropic(api_key, base_url)`. `LLMResponse.provider` field'ı + `audit_fields()` helper'ı (`tokens` + `provider` + `model` döner).
296
+ - **`ortim/llm/router.py`** (yeni) — `client_for(role)`: `<ROLE>_PROVIDER`/`<ROLE>_MODEL` env override → `LLM_PROVIDER`/`DEFAULT_MODEL` → provider default.
297
+ - **Agent başına LLM** — `main.py`'da Babel/Analyst/Architect/Orchestrator/Worker/Reviewer her biri kendi `client_for(role)` çağrısıyla başlar; pahalı kararlar Claude'da, ucuz işler DeepSeek'te tutulabilir.
298
+ - **`ortim/budget/tracker.py`** — per-provider pricing. `BudgetReport.per_provider: dict[str, ProviderBreakdown]`. CLI: `ortim budget --by-provider`.
299
+ - **Audit log** — her LLM çağrısı satırı `provider` + `model` taşır; eski satırlar geriye uyumlu (default: anthropic).
300
+ - **Smoke test:** 19 yeni test (`test_llm_providers.py` 9, `test_llm_router.py` 6, `test_budget_multi_provider.py` 4); regression yok, tüm suite 107/107.
301
+
302
+ ### İter 6b (TAMAMLANDI) — Multi-reviewer (hard veto)
303
+
304
+ CodeReviewer (soft veto, functional correctness) üstüne 3 yeni reviewer:
305
+
306
+ - **`agents/security_reviewer.md` + `ortim/executor/security_reviewer.py`** — `SecurityReviewerAgent` (hard veto). Threat catalogue: injection (SQL/shell/eval), hard-coded secrets, authn/authz bypass, insecure crypto (MD5/ECB), path traversal, SSRF, CSRF, sensitive data in logs, known-CVE deps. Severity high/medium → reject; low → suggestion.
307
+ - **`agents/test_reviewer.md` + `ortim/executor/test_reviewer.py`** — `TestReviewerAgent` (hard veto). AC × test eşleştirme zorunlu (`ac_coverage: [{ac, test}]` döner); test runner failure → otomatik reject; happy-path-only → reject.
308
+ - **`agents/perf_reviewer.md` + `ortim/executor/perf_reviewer.py`** — `PerfReviewerAgent` (soft veto). N+1, missing index, unbounded loop, sync I/O, bundle bloat, missing pagination. Bulgular `last_review_suggestions`'e `[perf] ...` etiketiyle düşer; merge'i blok etmez.
309
+ - **`ortim/executor/runner.py:ReviewerChain`** — opsiyonel `(security, test, perf)`; her biri bağımsız None olabilir. Pipeline: CodeReviewer + tests OK → Security → (OK ise) Test → (her durumda) Perf. Hard veto yakaladığında: **retry budget'ı atlanır, task doğrudan `AWAITING_HITL`** (security/test gap'i aynı Worker'ı yeniden çağırarak çözülmez).
310
+ - **`ExecutionResult.verdicts`** ve **`blocked_by`** — her reviewer'ın çıktısı saklanır; hard veto veren reviewer'ın adı `blocked_by`'da.
311
+ - **`ORTIM_HARD_REVIEWERS=on`** env flag'i; default `off` (geriye uyumlu — pre-6b davranış). API key eksik bir reviewer için degrade-warn (chain'in geri kalanı çalışmaya devam).
312
+ - **CLI:** `ortim execute` ve `run-all` çıktısında `BLOCKED` etiketi + `[security]/[test]/[perf]` etiketli reasons.
313
+ - **Smoke test:** 7 yeni test (`test_reviewer_chain.py`); `FakeLLM` ile gerçek API çağrısız: legacy chain=None davranışı, security hard veto → AWAITING_HITL, test hard veto sonrası, perf soft-only, verdict parse'ları. Tüm suite 114/114.
314
+
315
+ ### İter 6c (TAMAMLANDI) — HITL G3–G7 + hooks
316
+
317
+ - **Project-level gate state'leri:** `SCHEMA_AWAITING_APPROVAL` (G3), `BUDGET_AWAITING_APPROVAL` (G7), `DEPLOY_AWAITING_APPROVAL` (G6) — `ortim/orchestrator/state_machine.py` `TRANSITIONS` ve `HITL_GATES` güncellemeleri.
318
+ - **Task-level gate'ler:** G4 (external integration) ve G5 (security severity high/medium) doğrudan task → `AWAITING_HITL` ile yönetilir; faz 6b'deki SecurityReviewer hard veto bunu yapıyordu.
319
+ - **`ortim/orchestrator/gate_detector.py`** (yeni) — saf fonksiyonlar:
320
+ - `detect_schema_tasks(dag)` → `SchemaGateEvidence` (DDL/migration regex + path hint'leri).
321
+ - `detect_external_calls(worker_output)` → `ExternalGateEvidence` (boto3/httpx/requests/stripe/twilio import + non-local URL).
322
+ - `detect_security_severity(verdict)` → `SecurityGateEvidence` (duck-typed verdict kabul eder, circular import'tan kaçınır).
323
+ - `detect_budget_breach(tracker, project_id, cap_usd)` → `BudgetGateEvidence` (overage % dahil).
324
+ - **`ortim/hooks/registry.py`** (yeni) — `run_hook("pre_commit"|"pre_deploy", cwd, audit, ...)`. Komut env'leri: `ORTIM_LINT_CMD`, `ORTIM_FORMAT_CHECK_CMD`, `ORTIM_DEPLOY_CMD`. Chain'de ilk fail short-circuit; her hook event'i audit'a `hook_event` olarak düşer (`exit_code`, `duration_seconds`, `stderr_tail`). `ORTIM_HOOKS_ENABLED=false` ile global disable.
325
+ - **Pre-commit entegrasyonu** — `runner.py:execute_task` Reviewer chain onayladıktan SONRA `commit_changes` ÖNCESİ `pre_commit` hook'u çağırır. Hook fail ise: branch abandon, last_review_reasons'a `[pre_commit] hook failed (exit X); stderr tail: ...` push, task PENDING (retry budget tüketir → AWAITING_HITL).
326
+ - **CLI:** `ortim gates <project-id>` — açık project gate'leri + advisory schema/budget gate raporu.
327
+ - **Smoke test:** 20 yeni test (`test_gate_detector.py` 13, `test_hooks.py` 7); regression yok, suite 134/134.
328
+
329
+ ### İter 6d (TAMAMLANDI) — RFC template §11–§16 + 6 yeni tier doc
330
+
331
+ - **`docs/templates/RFC.template.md`** — yeni bölümler:
332
+ §11 Deployment Strategy (rollout pattern, health checks, rollback prosedürü), §12 Observability Baseline (RED/USE metrikler, log alanları, alerting kuralları), §13 Security Posture (secret yönetimi, authn/authz, audit trail, threat model, dep audit), §14 Test Strategy (pyramid dağılımı, coverage floor, mutation score, contract test'ler, perf budget), §15 Disaster Recovery (RTO/RPO, backup, failover prosedürü, DR drill cadence), §16 Runbook Sketch (oncall senaryoları + escalation).
333
+ - **`agents/architect.md`** — Call 2 boundary'lerine eklendi: §11–§16 doldurma zorunlu, eksikler `**[NEEDS-INPUT]**: <soru>` formatında işaretlenmeli; her bölüm için somut quality bar (numeric thresholds, command-level rollback adımları, vb.).
334
+ - **6 yeni tier dokümanı** — `docs/golden-paths/T{0,1,2,3,5,6}-*.md`, her biri ~80–110 satır, tutarlı format: When to use / When NOT / Architecture / Canonical Tech Stack / Cross-cutting / Blocker conditions / Migration path / Notes. T4 dışında hiç detayı olmayan 6 tier artık Architect'in RFC üretiminde gerçek rehbere sahip.
335
+ - **`docs/templates/Task.template.md`** — yeni "Integration / Staging" bölümü (staging smoke check, feature flag, backwards-compat).
336
+ - **`docs/golden-paths/index.md`** — 6 yeni doc'a referans güncellemesi (eski "stubs in iter 4+" satırı kaldırıldı).
337
+
338
+ ### M1 — Brownfield (2026-05-08, TAMAMLANDI)
339
+ - `ortim/codebase/{reader,frameworks,baseline,schema}.py` — gitignore-aware walk, AST/regex export extraction, framework detection
340
+ - Mobile (M0–M2 Flutter) + Desktop (D0–D1 Tauri) tier'ları
341
+ - `ortim new --from-existing` + `inspect` / `rescan` / `baseline` CLI
342
+
343
+ ### M1.5 — Bootstrap layer (2026-05-08, TAMAMLANDI)
344
+ - `ortim/architecture/bootstrap.py` — per-tier root template (T2/web: `package.json` + `tsconfig.json` + `vite.config.ts` + `setupTests.ts` + `.gitignore`); idempotent, mevcut dosyalara dokunmaz
345
+ - Auto-retry loop (sequential branch); `prior_reasons` sandbox feedback enjeksiyonu
346
+ - Windows UTF-8 console reconfigure (cp1254 crash fix)
347
+
348
+ ### Phase 0 — Foundation hardening (2026-05-08, TAMAMLANDI)
349
+ - Reviewer rubric (per-criterion verdict + `unverifiable` two-mode: `criterion_design` vs `test_infrastructure`)
350
+ - Orchestrator Hard Rule 10 — binary acceptance criteria ban-list
351
+ - `.ortim.env` test-cmd auto-write from tier+app_class
352
+
353
+ ### M2 — Conversational Intake (2026-05-13, TAMAMLANDI)
354
+ - Dialog states `INTAKE_DIALOG` / `STACK_DIALOG` / `PRD_DIALOG`
355
+ - `ortim discuss <id>` / `refine <id> "<feedback>"` / `lock <id>` / `show <id>`
356
+ - Split analysts: `IntentAnalyst` (intent.md) + `StackAnalyst` (LockedStack JSON) + `PRDAnalyst` (PRD.md)
357
+
358
+ ### M3 — Skills system (2026-05-13, TAMAMLANDI)
359
+ - `skills/<scope>/<name>.md` frontmatter (`name`, `description`, `audience`, `triggers`)
360
+ - Resolver: tier > app_class > language > keyword spesifiklik sırasıyla; per-call char budget
361
+ - 6 seed skill (typescript-module-boundaries, typescript-imports-from-locked-stack, typescript-sql-mock-patterns, react-component-patterns, react-dependency-injection, react-ui-test-text-matching)
362
+
363
+ ### M4 — Cross-task export visibility (2026-05-13, TAMAMLANDI)
364
+ - Worker prompt'una önceki DONE task'ların `index.ts` / `__init__.py` export'larından AST-extracted signature listesi enjekte edilir
365
+ - Cross-task interface mismatch (önceden T-009 sınıfı failure) sınıfını yapısal olarak kapatır
366
+
367
+ ### M3.1 — `ortim extend` iteratif geliştirme (2026-05-15, TAMAMLANDI)
368
+ - **M3.1.0 foundation** — state machine: 7 yeni state (DONE → EXTEND_DIALOG → EXTEND_PRD_DIALOG/APPROVAL/APPROVED → EXTEND_RFC_DRAFTING/APPROVAL/APPROVED → TASKS_GENERATING) + 2 yeni HITL gate (G1/G2 cycle N); `ortim/extend/{schema.py,extender_agent.py,delta_writer.py}`; idempotent delta section append (cycle = de-dupe key); BLOCKED-STACK escape hatch; +45 test
369
+ - **M3.1.1 executor wiring** — `Orchestrator.generate_dag(prior_dag=...)` + 3 validator: ID collision, continuity (`> prior_max`), scope-union membership (parent §7 ∪ `### Module Breakdown (delta)` H3); `ortim run` extend dispatch (EXTEND_PRD_APPROVED → EXTEND_RFC + EXTEND_RFC_APPROVED → TASKS_READY); DAG merge persistence + `extensions: list[DagDelta]` field; +17 test
370
+ - **Item 48 — extend-cycle AC-aggregation discipline** — `agents/orchestrator.md` `## Extend Cycle Task Granularity` section: aggregation by `(module_scope × behavioral cluster)`, 10-AC delta → 3-5 task anchor, trace-back rule (every task → delta RFC Module Breakdown row OR delta AC); runtime context block references the section by name; +2 test. Empirical (same TR brief, fresh v3 clone): 11 ACs → 4 tasks vs pre-fix 10 ACs → 10 tasks; **~60% reduction**
371
+ - **End-to-end proof-point** — `proofpoint48` workspace: planning chain clean (delta PRD + delta RFC + delta DAG validators all silent); execution chain 3/4 task otomatik (T-007 schema first-attempt; T-008 sandbox-feedback retry; T-009 valid HITL escalation with L1 + criterion findings)
372
+ - CLI: `ortim extend <id> "<brief>"` + `ortim extensions <id>`
373
+
374
+ ### Operational hardening (2026-05-08 → 2026-05-14, TAMAMLANDI)
375
+ - Item 22 — LLM transient retry (503/429 exponential backoff)
376
+ - Item 23 — Provider fail-loud (critical role + global fallback → stderr WARNING)
377
+ - Item 24 — `unverifiable_reason` two-mode schema separation
378
+ - Item 40 — Architect §4 `key_libraries` discipline (post-draft subset validator + retry-with-correction)
379
+ - Item 41/41' — Bootstrap `_FRAMEWORK_PACKAGES` map (React + Vite / Vue + Vite / Next / Hono / Express deps + testing-library quartet + jsdom)
380
+ - Item 42 — Orchestrator DAG-RFC module match (Hard Rule 13 + RFC §7 parser + scope subset validator)
381
+ - Item 43 — Reviewer stack-citation discipline (`stack.json.key_libraries` verbatim quote)
382
+ - Item 44 — `skills/react/dependency-injection.md` (Pattern A: props down; Pattern B: Context; anti-patterns)
383
+ - Item 45 — Architect Call 1 derivation rules (single-user → `small/solo/low`; few-shot examples). Empirically validated: 5/5 deterministic on v4 PRD via `scripts/item_45_empirical.py`.
384
+ - Item 46 — Bootstrap honors `locked_stack.primary_framework` over heuristic tier (T4 + React stack → vite.config writers fire)
385
+ - Item 47 — `_NPM_DEP_REGISTRY` browser-persistence coverage (`idb`, `dexie`, `localforage`) + silent-drop stderr WARNING
386
+ - Item 47b — `_INDEXEDDB_PEERS` auto-pull `fake-indexeddb` for jsdom shim
387
+ - BaaS-drift — `agents/stack_analyst.md` Browser-only intent detection (Hono/Express/Fastify/Koa forbidden when ≥2 browser-only + 0 backend signals)
388
+ - UI-text-match — `skills/react/ui-test-text-matching.md` (UI ↔ test assertion symmetry)
389
+
390
+ ### Ertelenenler
391
+ - **M5 RAG (Obsidian) + MCP** — M5'in birincil değer önerisi olan Item 45 prompt fix ile kapandı; M5 "platform foundation" pozisyonuna geçti. Tam analiz: [`M5-design.md`](./M5-design.md) §13.
392
+ - **M3.1.2 — Drift detector** — workspace'in `DONE` ile `extend` arasında manuel edit edilmesi durumu. Multi-cycle continuity hata raporu beklemede.
393
+ - **G-1 — M4 export visibility vs barrel-import discipline (extend mode)** — `proofpoint48` T-009'da Worker barrel import yerine internal path kullandı; 2 daha aynı sınıf gözlemden sonra item açılır.
394
+ - **G-2 — `test_infrastructure_unavailable` mode coarseness** — Worker test quality issue'ları (örn. yanlış kullanılmış `expect(...).rejects`) mod-olarak infrastructure failure görünüyor; `worker_test_quality_failure` mode'u ayrılabilir. Aynı sınıftan 2 daha gözlem bekleniyor.
395
+
396
+ ## Geliştirme
397
+
398
+ ```powershell
399
+ # Lint + format check
400
+ ruff check .
401
+
402
+ # Type check (strict)
403
+ mypy ortim
404
+
405
+ # Test (smoke + ileride birim)
406
+ pytest
407
+
408
+ # State machine sanity (stdlib-only, deps yokken bile)
409
+ python tests\test_state_machine.py
410
+ ```
411
+
412
+ Code patterns:
413
+ - LLM çağrıları → `LLMClient.call(system, user, temperature, max_tokens)` — token usage döner, audit'a `tokens={"in":..,"out":..}` field'ıyla yaz.
414
+ - Yeni state ekliyorsan: `ProjectState`, `TRANSITIONS` ve gerekirse `HITL_GATES`'i güncelle, `tests/test_state_machine.py`'ye geçişi ekle.
415
+ - Yeni ajan: `agents/<name>.md` (system prompt) + `ortim/agents/<name>.py` (class) + `MemoryLoader.load_agent_prompt("<name>")` zaten çalışır.
416
+ - LLM çıktısı parse edeceksen `ortim/babel/intent.py:_strip_code_fences` reuse et.
417
+
418
+ ## Sorun Giderme
419
+
420
+ | Belirti | Sebep / Çözüm |
421
+ |---|---|
422
+ | `ANTHROPIC_API_KEY not set` | `.env` dosyası yok veya boş. `Copy-Item .env.example .env` sonra düzenle. |
423
+ | `Cannot transition X -> Y. Allowed: [...]` | LLM/CLI yanlış sıraya girmiş; state machine doğru çalışıyor. `ortim states` ile geçerli geçişleri gör. |
424
+ | `Orchestrator failed to produce a valid DAG after 3 attempts` | RFC çok belirsiz ya da LLM cycle/missing-dep üretmeye devam ediyor. Audit log'da `orchestrator_dag_validation_failed` kayıtları sebebi söyler. RFC'yi netleştir, `ortim advance <id> rfc_drafting` ile geri al. |
425
+ | `estimated_tokens=X exceeds 20K cap` | LLM tek bir task'ı çok büyük tahminliyor. Orchestrator promptunda task'ın bölünmesini iste, RFC'yi daha küçük slice'lara böl. |
426
+ | `intent.json missing` / `PRD.md missing` | Önceki state atlanmış. `ortim status <id>` ile state'i kontrol et, eksik adımı `--step` ile manuel koştur. |
427
+ | `LockTimeout` | Aynı workspace'de paralel komut. Beklemekte; ya da çökmüş eski lock (>60s sonra otomatik temizlenir). |
428
+
429
+ ## Paralel Çalıştırma
430
+
431
+ ```powershell
432
+ # Sıralı (default): tek tek, ana repo `task/<id>` checkout
433
+ ortim run-all <project-id>
434
+
435
+ # Paralel: batch içindeki bağımsız task'lar `git worktree` ile izole, ThreadPool ile koşar
436
+ ortim run-all <project-id> --parallel --max-workers 4
437
+ ```
438
+
439
+ Paralel mod gereksinimleri:
440
+ - `git` PATH'te olmalı, `ORTIM_GIT_ENABLED=false` set edilmemeli
441
+ - Aynı workspace'te ikinci `run-all` engellenir (workspace exec lock)
442
+ - Worktree'ler `<workspace>/.worktrees/<task_id>/` altında; task DONE → merge sonrası otomatik silinir, REJECTED → cleanup'ta silinir
443
+ - Merge conflict → task `AWAITING_HITL`, `task_status.json`'a `last_error: merge: ...` yazılır
444
+
445
+ Audit'a her batch için `executor_batch_metrics` event'i düşer (wall/sum süre, speedup, merge wait, mode). `ortim/audit/decisions.jsonl` üzerinden batch maliyetleri analiz edilebilir.
446
+
447
+ ## Sonraki Adım
448
+
449
+ **2026-05-15 update — M3.1 v1 production-ready, end-to-end validated:**
450
+
451
+ Tek oturumda ship + iki proof-point + execution-stage validation:
452
+ - **Planning chain** (Item 48 sonrası): TR tagging brief → delta PRD (Architect saw-tooth module-drift correction) → delta RFC (`### Module Breakdown (delta)` H3 doğru format) → delta DAG **4 task** (vs pre-fix 10) — scope/continuity/ID-collision validators all silent
453
+ - **Execution chain** (`run-all proofpoint48`): T-007 schema first-attempt DONE; T-008 tagging CRUD 2nd-attempt DONE (Item 15a sandbox feedback fired); T-009 task ext valid HITL escalation (L1 boundary + criterion mismatch + 2× test_infrastructure_unavailable Item 24 mode); T-010 not started post-T-009 halt. T-009 HITL **doğru sistem davranışı**, reviewer'ın iş tanımı
454
+ - Day spend: ~$0.16; pytest 339 → **404** (+65 with M3.1.0 + M3.1.1 + Item 48); G-1/G-2 surveillance items added to DEFERRED
455
+
456
+ Sıradaki sprint adayları (öncelik sırasıyla):
457
+ 1. **PyPI publish hazırlığı + landing page** (SQ-1 + SQ-3): `name="ortim"` rezerv, ilk satışa açık sürüm tagging, ortim.dev iskeleti. ~1 hafta. **Foundation artık satılabilir state'te** — M3.1 dahil iteratif geliştirme demosu mümkün.
458
+ 2. **Enterprise tier MVP scoping** (SQ-2): multi-tenant orchestrator, SSO, audit retention, SLA. Geniş kapsamlı; önce strateji belgesi.
459
+ 3. **G-1 / G-2 surveillance** — pattern surface ederse 2-3 run sonra item açılır; proaktif fix henüz gerekmiyor.
460
+ 4. **M3.1.2 drift detector** — multi-cycle continuity gerçek user reportu beklemede.
461
+
462
+ Öncelik kararı için: `docs/backlog.md` canonical view, `tespit.md` "Execution-stage proof-point" bölümü, `M5-design.md` §13 mapping, `docs/item-template.md` yeni item şablonu.