From ab192c48a8474f16bc34e6af95965eaa4668d389 Mon Sep 17 00:00:00 2001 From: Himanshu Dongre Date: Mon, 13 Apr 2026 00:28:16 +0530 Subject: [PATCH] Fix REPO_STRUCTURE accuracy and add runtime freshness rule to skill pack --- AGENTS.md | 8 ++++++++ REPO_STRUCTURE.md | 20 +++++++++++++++----- cli/smriti_cli/skill_pack/template.md | 8 ++++++++ 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 173b8ad..25b9700 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -224,6 +224,14 @@ are a client of it. You do not own it. tool loop creates environment-variable inheritance issues that cause silent mock fallback on all LLM-backed endpoints. The human starts the backend; you use it. +- **Runtime freshness after code changes.** If backend code has + been merged to main since the backend was last started (e.g., + new API routes, schema changes, config fixes), the backend + must be restarted before agents can rely on the new endpoints. + Check `git log --oneline -5` against the running server's + behavior. If a new endpoint returns 404 or the behavior does + not match the merged code, tell the human: "The backend may + need a restart to pick up recent changes on main." ### 3.6 Work claims: declare intent before working diff --git a/REPO_STRUCTURE.md b/REPO_STRUCTURE.md index 76ed691..20a9306 100644 --- a/REPO_STRUCTURE.md +++ b/REPO_STRUCTURE.md @@ -50,7 +50,13 @@ smriti/ │ │ │ └── openrouter_adapter.py │ │ └── services/ │ │ ├── extractor.py Transcript → structured extraction -│ │ └── pack_generator.py Context pack rendering (V1 legacy) +│ │ ├── embedding.py Embedding generation (pgvector) +│ │ ├── parser.py Transcript parsing utilities +│ │ ├── pack_generator.py Context pack rendering (V1 legacy) +│ │ └── llm/ +│ │ ├── base.py LLM provider base class +│ │ ├── mock_provider.py Deterministic mock for testing +│ │ └── openai_provider.py OpenAI chat completions │ ├── config/ │ │ ├── providers.example.yaml Template — copy to providers.yaml │ │ └── providers.yaml Your keys (gitignored, not committed) @@ -63,8 +69,12 @@ smriti/ │ │ │ ├── test_claims.py │ │ │ ├── test_checkpoint_extract.py │ │ │ └── test_delete_endpoints.py -│ │ └── unit/ Unit tests (2 tests) -│ │ └── test_config_loader.py +│ │ └── unit/ Unit tests (97 tests) +│ │ ├── test_config_loader.py +│ │ ├── test_extractor.py +│ │ ├── test_golden_outputs.py +│ │ ├── test_pack_generator.py +│ │ └── test_parser.py │ └── pyproject.toml Python dependencies (includes python-dotenv) │ ├── frontend/ @@ -148,6 +158,6 @@ make migration Create a new migration (usage: make migration msg="...") | Suite | Count | Location | |---|---|---| | Backend integration | 177 | `backend/tests/integration/` | -| Backend unit | 2 | `backend/tests/unit/` | +| Backend unit | 97 | `backend/tests/unit/` | | CLI + MCP | 70 | `cli/tests/` | -| **Total** | **249** | | +| **Total** | **344** | | diff --git a/cli/smriti_cli/skill_pack/template.md b/cli/smriti_cli/skill_pack/template.md index 5a83784..8a9a786 100644 --- a/cli/smriti_cli/skill_pack/template.md +++ b/cli/smriti_cli/skill_pack/template.md @@ -224,6 +224,14 @@ are a client of it. You do not own it. tool loop creates environment-variable inheritance issues that cause silent mock fallback on all LLM-backed endpoints. The human starts the backend; you use it. +- **Runtime freshness after code changes.** If backend code has + been merged to main since the backend was last started (e.g., + new API routes, schema changes, config fixes), the backend + must be restarted before agents can rely on the new endpoints. + Check `git log --oneline -5` against the running server's + behavior. If a new endpoint returns 404 or the behavior does + not match the merged code, tell the human: "The backend may + need a restart to pick up recent changes on main." ### 3.6 Work claims: declare intent before working