From 0d01e7bc50cb1b66f6d3e2893db218a6591aa60f Mon Sep 17 00:00:00 2001 From: catlog22 Date: Sat, 7 Mar 2026 19:34:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=9E=B6=E6=9E=84?= =?UTF-8?q?=E7=BA=A6=E6=9D=9F=E5=92=8C=E7=BC=96=E7=A0=81=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E6=96=87=E6=A1=A3=EF=BC=8C=E5=A2=9E=E5=BC=BA=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E7=9A=84=E5=AE=8C=E6=95=B4=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .ccw/specs/architecture-constraints.md | 6 ++++++ .ccw/specs/coding-conventions.md | 17 +++++++++++++++++ .npmignore | 1 + .../src/codexlens/storage/deepwiki_store.py | 9 +++++---- 4 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 .ccw/specs/architecture-constraints.md create mode 100644 .ccw/specs/coding-conventions.md diff --git a/.ccw/specs/architecture-constraints.md b/.ccw/specs/architecture-constraints.md new file mode 100644 index 00000000..e90a073b --- /dev/null +++ b/.ccw/specs/architecture-constraints.md @@ -0,0 +1,6 @@ +# Architecture Constraints + +## Schema Evolution + +- [compatibility] When enhancing existing schemas, use optional fields and additionalProperties rather than creating new schemas. Avoid breaking changes. +- [portability] Use relative paths for cross-artifact navigation to ensure portability across different environments and installations. diff --git a/.ccw/specs/coding-conventions.md b/.ccw/specs/coding-conventions.md new file mode 100644 index 00000000..a3503317 --- /dev/null +++ b/.ccw/specs/coding-conventions.md @@ -0,0 +1,17 @@ +# Coding Conventions + +## Navigation & Path Handling + +- [navigation] When creating navigation links between artifacts, always compute relative paths from the artifact's actual location, not from an assumed location. Test path resolution before committing. (learned: 2026-03-07) +- [schema] Always include schema_version field in index/registry files to enable safe evolution and migration detection. (learned: 2026-03-07) +- [error-handling] When adding version checks or validation, always continue with degraded functionality rather than failing hard. Log warnings but don't block execution. (learned: 2026-03-07) + +## Document Generation + +- [architecture] For document generation systems, adopt Layer 3→2→1 pattern (components → features → indexes) for efficient incremental updates. (learned: 2026-03-07) + +## Implementation Quality + +- [validation] Path calculation errors are subtle and hard to spot in static review. Always verify path resolution from the actual file location, not from documentation. (learned: 2026-03-07) +- [implementation] Declaring "add X to Y" in documentation is not enough - the actual logic must be implemented in the target files. (learned: 2026-03-07) +- [clarity] Explicit instructions are better than implicit ones. Vague instructions like "Update _index.md files" should be made explicit (e.g., "Update sessions/_index.md"). (learned: 2026-03-07) diff --git a/.npmignore b/.npmignore index 4d6876ec..e54135b2 100644 --- a/.npmignore +++ b/.npmignore @@ -17,6 +17,7 @@ # Workflow runtime data .workflow/ +.ccw/ # Test files test/ diff --git a/codex-lens/src/codexlens/storage/deepwiki_store.py b/codex-lens/src/codexlens/storage/deepwiki_store.py index 9fedec4b..dc7bd32b 100644 --- a/codex-lens/src/codexlens/storage/deepwiki_store.py +++ b/codex-lens/src/codexlens/storage/deepwiki_store.py @@ -1031,6 +1031,10 @@ class DeepWikiStore: Returns: Staleness score between 0.0 and 1.0. """ + # Deleted symbols are maximally stale + if is_deleted: + return 1.0 + w_t, w_c, w_s = weights # T: Time decay factor @@ -1045,10 +1049,7 @@ class DeepWikiStore: C = 1 / (1 + math.exp(-churn_raw + 3)) # sigmoid centered at 3 # M: Symbol modification factor - if is_deleted: - M = 1.0 - else: - M = min(1.0, max(0.0, proportion_changed)) + M = min(1.0, max(0.0, proportion_changed)) return min(1.0, w_t * T + w_c * C + w_s * M)