new loggers logic in constitution

This commit is contained in:
2025-12-27 06:51:28 +03:00
parent dcbf0a7d7f
commit cddc259b76
2 changed files with 12 additions and 12 deletions

View File

@@ -1,10 +1,9 @@
<!-- <!--
SYNC IMPACT REPORT SYNC IMPACT REPORT
Version: 1.1.0 (Svelte Support) Version: 1.2.0 (Configurable Belief Logs)
Changes: Changes:
- Added Svelte Component semantic markup standards. - Refined Belief State Logging principle to mandate Context Manager usage.
- Updated File Structure Standards to include `.svelte` files. - Aligned logging states with Semantic Protocol.
- Refined File Structure Standards to distinguish between Python Modules and Svelte Components.
Templates Status: Templates Status:
- .specify/templates/plan-template.md: ⚠ Pending (Needs update to include Component headers in checks). - .specify/templates/plan-template.md: ⚠ Pending (Needs update to include Component headers in checks).
- .specify/templates/spec-template.md: ✅ Aligned. - .specify/templates/spec-template.md: ✅ Aligned.
@@ -27,7 +26,7 @@ All output must strictly follow the `[DEF]` / `[/DEF]` anchor syntax with specif
Contracts are the Source of Truth. Functions and Classes must define their purpose, specifications, and constraints (`@PRE`, `@POST`, `@THROW`) in the metadata block before implementation. Implementation must strictly satisfy these contracts. Contracts are the Source of Truth. Functions and Classes must define their purpose, specifications, and constraints (`@PRE`, `@POST`, `@THROW`) in the metadata block before implementation. Implementation must strictly satisfy these contracts.
### V. Belief State Logging ### V. Belief State Logging
Logs must define the agent's internal state for debugging and coherence checks. We use a strict format: `logger.level(f"[{ANCHOR_ID}][{STATE}] {MESSAGE} context={...}")` to track transitions between `Entry`, `Validation`, `Action`, and `Coherence` states. Logs must define the agent's internal state for debugging and coherence checks. We use a strict format: `[{ANCHOR_ID}][{STATE}] {MESSAGE}`. For Python, a **Context Manager** pattern MUST be used to automatically handle `Entry`, `Exit`, and `Coherence` states, ensuring structural integrity and error capturing.
## File Structure Standards ## File Structure Standards
@@ -65,4 +64,4 @@ This Constitution establishes the "Semantic Code Generation Protocol" as the sup
- **Review**: Code reviews must verify that implementation matches the preceding contracts and that no "naked code" exists outside of semantic anchors. - **Review**: Code reviews must verify that implementation matches the preceding contracts and that no "naked code" exists outside of semantic anchors.
- **Compliance**: Failure to adhere to the `[DEF]` / `[/DEF]` structure constitutes a build failure. - **Compliance**: Failure to adhere to the `[DEF]` / `[/DEF]` structure constitutes a build failure.
**Version**: 1.1.0 | **Ratified**: 2025-12-19 | **Last Amended**: 2025-12-19 **Version**: 1.2.0 | **Ratified**: 2025-12-19 | **Last Amended**: 2025-12-27

View File

@@ -154,15 +154,16 @@ async function updateUserProfile(profileData) {
Logs delineate the agent's internal state. Logs delineate the agent's internal state.
* **Python:** `logger.info(f"[{ANCHOR_ID}][{STATE}] Msg")` * **Python:** MUST use a Context Manager (e.g., `with belief_scope("ANCHOR_ID"):`) to ensure state consistency and automatic handling of Entry/Exit/Error states.
* Manual logging (inside scope): `logger.info(f"[{ANCHOR_ID}][{STATE}] Msg")`
* **Svelte/JS:** `console.log(\`[${ANCHOR_ID}][${STATE}] Msg\`)` * **Svelte/JS:** `console.log(\`[${ANCHOR_ID}][${STATE}] Msg\`)`
**Required States:** **Required States:**
1. `Entry` (Start of block) 1. `Entry` (Start of block - Auto-logged by Context Manager)
2. `Action` (Key business logic) 2. `Action` (Key business logic - Manual log)
3. `Coherence:OK` (Logic successfully completed) 3. `Coherence:OK` (Logic successfully completed - Auto-logged by Context Manager)
4. `Coherence:Failed` (Error handling) 4. `Coherence:Failed` (Exception/Error - Auto-logged by Context Manager)
5. `Exit` (End of block) 5. `Exit` (End of block - Auto-logged by Context Manager)
--- ---