org-knowledge-layer 0.1.3__tar.gz → 0.3.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 (119) hide show
  1. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/.claude/settings.local.json +61 -2
  2. {org_knowledge_layer-0.1.3/src/okl/scaffold/ci → org_knowledge_layer-0.3.0/.github/workflows}/okl-verify.yml +4 -4
  3. org_knowledge_layer-0.3.0/CHANGELOG.md +58 -0
  4. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/CONTRIBUTING.md +11 -0
  5. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/PKG-INFO +158 -25
  6. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/README.md +156 -23
  7. {org_knowledge_layer-0.1.3/.github/workflows → org_knowledge_layer-0.3.0/ci}/okl-verify.yml +4 -4
  8. org_knowledge_layer-0.3.0/docs/DEPLOY.md +171 -0
  9. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/evals/REPORT.md +30 -0
  10. org_knowledge_layer-0.3.0/evals/results/ab-20260901-0133.json +441 -0
  11. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/pyproject.toml +1 -1
  12. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/cli.py +129 -17
  13. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/client.py +45 -6
  14. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/core.py +83 -5
  15. org_knowledge_layer-0.3.0/src/okl/mcp_server.py +110 -0
  16. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0/src/okl/scaffold}/ci/okl-verify.yml +4 -4
  17. org_knowledge_layer-0.3.0/src/okl/scaffold/claude/commands/seed-from-codebase.md +90 -0
  18. org_knowledge_layer-0.3.0/src/okl/scaffold/gates/check-diagram-pairs.sh +39 -0
  19. org_knowledge_layer-0.3.0/src/okl/scaffold/gates/check-links.sh +41 -0
  20. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/gates/run-gates.sh +2 -0
  21. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/service.py +44 -11
  22. org_knowledge_layer-0.3.0/tests/test_okl.py +932 -0
  23. org_knowledge_layer-0.3.0/tests/test_scaffold.py +429 -0
  24. org_knowledge_layer-0.1.3/src/okl/mcp_server.py +0 -75
  25. org_knowledge_layer-0.1.3/tests/test_okl.py +0 -365
  26. org_knowledge_layer-0.1.3/tests/test_scaffold.py +0 -168
  27. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/.claude/hooks/stop-okl-encode.sh +0 -0
  28. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/.claude/hooks/userpromptsubmit-okl-check.sh +0 -0
  29. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/.claude/settings.json +0 -0
  30. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  31. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  32. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/.github/pull_request_template.md +0 -0
  33. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/.github/workflows/ci.yml +0 -0
  34. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/.gitignore +0 -0
  35. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/AGENTS.md +0 -0
  36. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/CLAUDE.md +0 -0
  37. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/LICENSE +0 -0
  38. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/SECURITY.md +0 -0
  39. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/docs/ab-results-chart.png +0 -0
  40. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/docs/ab-results-chart.svg +0 -0
  41. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/docs/decisions/2026-07-17-flat-retrieval-until-scale.md +0 -0
  42. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/docs/decisions/2026-07-21-subject-tags-controlled-vocabulary.md +0 -0
  43. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/docs/okl-sixth-surface.excalidraw +0 -0
  44. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/docs/okl-sixth-surface.svg +0 -0
  45. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/docs/posts/01-memory-that-outlives-the-run.md +0 -0
  46. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/docs/posts/02-dont-let-a-step-grade-itself.md +0 -0
  47. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/docs/posts/03-enforcement-or-good-intentions.md +0 -0
  48. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/evals/README.md +0 -0
  49. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/evals/ab_harness.py +0 -0
  50. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/evals/results/ab-20260829-2300.json +0 -0
  51. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/evals/results/ab-20260829-2315.json +0 -0
  52. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/evals/results/ab-20260830-0003.json +0 -0
  53. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/evals/results/ab-20260830-0148.json +0 -0
  54. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/evals/results/e2e-20260830/README.md +0 -0
  55. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/evals/results/e2e-20260830/briefed-userpromptsubmit-lint.yml +0 -0
  56. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/evals/results/e2e-20260830/control-lint.yml +0 -0
  57. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/evals/results/e2e-20260830/hook.log +0 -0
  58. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/evals/results/e2e-20260830/service-record-500.log +0 -0
  59. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/evals/results/e2e-20260830/session-briefed-pretooluse.txt +0 -0
  60. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/evals/results/e2e-20260830/session-briefed-userpromptsubmit.txt +0 -0
  61. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/evals/results/e2e-20260830/session-control.txt +0 -0
  62. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/evals/tasks.jsonl +0 -0
  63. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/hooks/stop-okl-encode.sh +0 -0
  64. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/hooks/userpromptsubmit-okl-check.sh +0 -0
  65. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/seed/dotnet-canon.json +0 -0
  66. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/seed/dotnet-decisions.json +0 -0
  67. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/seed/dotnet-defects.json +0 -0
  68. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/seed/dotnet-review-surfaces.json +0 -0
  69. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/seed/frontend-canon.json +0 -0
  70. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/seed/geospatial-deeptime-defects.json +0 -0
  71. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/seed/geospatial-defects.json +0 -0
  72. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/seed/geospatial-enforcement-defects.json +0 -0
  73. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/seed/geospatial-eval-defects.json +0 -0
  74. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/seed/rag-defects.json +0 -0
  75. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/seed/react-defects.json +0 -0
  76. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/__init__.py +0 -0
  77. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/__main__.py +0 -0
  78. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/bootstrap.py +0 -0
  79. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/drift.py +0 -0
  80. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/MANIFEST.md +0 -0
  81. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/ci/method-gates.yml +0 -0
  82. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/claude/agents/architecture-reviewer.md +0 -0
  83. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/claude/commands/check-rules.md +0 -0
  84. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/claude/commands/feature-spec.md +0 -0
  85. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/claude/rules/example-area.md +0 -0
  86. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/claude/skills/RECOMMENDED-COMPANIONS.md +0 -0
  87. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/claude/skills/encoding-loop/SKILL.md +0 -0
  88. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/claude/skills/verify-before-claiming/SKILL.md +0 -0
  89. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/evals/README.md +0 -0
  90. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/evals/cases.jsonl +0 -0
  91. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/evals/run_evals.py +0 -0
  92. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/gates/check-canon-size.sh +0 -0
  93. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/gates/check-doc-orphans.sh +0 -0
  94. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/gates/check-retractions.sh +0 -0
  95. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/gates/check-tombstones.sh +0 -0
  96. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/hooks/hooks.json +0 -0
  97. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/hooks/stop-okl-encode.sh +0 -0
  98. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/hooks/userpromptsubmit-okl-check.sh +0 -0
  99. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/plugin/plugin.json +0 -0
  100. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/profiles/dotnet/README.md +0 -0
  101. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/profiles/dotnet/rules/architecture.md +0 -0
  102. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/profiles/dotnet/rules/messaging.md +0 -0
  103. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/profiles/dotnet/rules/performance-and-data.md +0 -0
  104. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/profiles/dotnet/rules/security.md +0 -0
  105. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/profiles/geospatial/README.md +0 -0
  106. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/profiles/geospatial/rules/geospatial-ml.md +0 -0
  107. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/profiles/python-rag/README.md +0 -0
  108. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/profiles/python-rag/rules/fastapi-backend.md +0 -0
  109. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/profiles/python-rag/rules/project-structure.md +0 -0
  110. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/profiles/python-rag/rules/rag-pipeline.md +0 -0
  111. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/profiles/react/README.md +0 -0
  112. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/profiles/react/rules/frontend.md +0 -0
  113. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/registries/RETRACTIONS.md +0 -0
  114. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/registries/tombstones.txt +0 -0
  115. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/root/CLAUDE.md +0 -0
  116. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold/root/METHOD.md +0 -0
  117. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/scaffold_cmd.py +0 -0
  118. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/seed.py +0 -0
  119. {org_knowledge_layer-0.1.3 → org_knowledge_layer-0.3.0}/src/okl/store.py +0 -0
@@ -97,13 +97,72 @@
97
97
  "Bash(./v12test/bin/pip install *)",
98
98
  "Bash(./v12test/bin/okl --help)",
99
99
  "Bash(./v12test/bin/python -c ' *)",
100
- "Bash(ruff check *)"
100
+ "Bash(ruff check *)",
101
+ "Bash(curl -s \"https://pypi.org/pypi/org-knowledge-layer/0.1.3/json\")",
102
+ "Bash(/tmp/v13/bin/pip show *)",
103
+ "Bash(xargs -I{} gh run view {} --log-failed)",
104
+ "Bash(grep -vE \"^$\")",
105
+ "Bash(git -c core.hooksPath=/dev/null commit -qm 'Fix the CI break the PyPI rename caused: detect by source, not by name *)",
106
+ "Bash(git -c core.hooksPath=/dev/null commit -qm 'README: say what okl is, and exactly what it keeps from drifting *)",
107
+ "Bash(sed 's|cd \"$\\(dirname \"$0\"\\)/\\\\.\\\\.\"|cd \"$\\(pwd\\)\"|' src/okl/scaffold/gates/check-links.sh)",
108
+ "Bash(bash /tmp/links.sh)",
109
+ "Bash(sed 's|cd \"$\\(dirname \"$0\"\\)/\\\\.\\\\.\"|cd \"$\\(pwd\\)\"|' src/okl/scaffold/gates/check-diagram-pairs.sh)",
110
+ "Bash(bash /tmp/dia.sh)",
111
+ "Bash(git -C /Users/joshuadell/NovaCraft log --oneline --diff-filter=A -- \".claude/skills/excalidraw-diagram/SKILL.md\")",
112
+ "Bash(git -C /Users/joshuadell/NovaCraft log --format=\"%h %ad %s\" --date=short --diff-filter=A -- \".claude/skills/excalidraw-diagram/\")",
113
+ "Bash(git -C /Users/joshuadell/NovaCraft log --oneline -- \".claude/skills/excalidraw-diagram/\")",
114
+ "Bash(git -c core.hooksPath=/dev/null commit -qm 'Be accurate about which agents get enforcement, and about what init writes *)",
115
+ "Bash(tee /tmp/briefing.txt)",
116
+ "Bash(awk '{printf \"payload: %s bytes, ~%d tokens\\\\n\",$1,$1/4}')",
117
+ "Bash(/tmp/v13/bin/okl check *)",
118
+ "Bash(/tmp/v13/bin/okl seed *)",
119
+ "Bash(python3 -m okl seed)",
120
+ "Bash(/Users/joshuadell/Dev/okl/.venv/bin/okl seed *)",
121
+ "Bash(python3 -m okl init --repo myproject --interests \"security,python-rag\")",
122
+ "Bash(echo \"=== exit=$? \\(nothing imported\\) ===\")",
123
+ "Bash(python3 -m okl seed /Users/joshuadell/Dev/okl/seed/rag-defects.json)",
124
+ "Bash(python3 -m okl seed /Users/joshuadell/Dev/okl/seed/dotnet-defects.json)",
125
+ "Bash(sqlite3 .okl/okl.db \"select count\\(*\\) from node;\")",
126
+ "Bash(python3 -m okl check --task \"add an endpoint that returns an order for the logged-in user\")",
127
+ "Bash(awk '{printf \"briefing now: %s bytes \\(~%d tokens\\), was ~4381\\\\n\",$1,$1/4}')",
128
+ "Bash(python3 -m okl bootstrap --repo myproject)",
129
+ "Bash(seed)",
130
+ "Bash(check)",
131
+ "Bash(okl bootstrap *)",
132
+ "Bash(git -c core.hooksPath=/dev/null commit -qm 'First-run experience: seeding is a choice, briefings are capped, empty states are honest *)",
133
+ "Bash(git -c core.hooksPath=/dev/null commit -q --amend -F /tmp/msg.txt)",
134
+ "Bash(git -c core.hooksPath=/dev/null commit -qm 'v0.2.0 *)",
135
+ "Bash(command -v postgres pg_ctl initdb)",
136
+ "Read(//opt/homebrew/opt/**)",
137
+ "Bash(python3 -c \"import mcp; print\\(mcp.__version__ if hasattr\\(mcp,'__version__'\\) else 'installed'\\)\")",
138
+ "Bash(python3 -m pip install -q \"psycopg[binary]>=3.1\")",
139
+ "Bash(python3 -m pip install -q \"mcp>=1.2\")",
140
+ "Bash(python3 -c \"import mcp; print\\('mcp installed'\\)\")",
141
+ "Bash(python3 -c \"import mcp, importlib.metadata as md; print\\('installed mcp version:', md.version\\('mcp'\\)\\)\")",
142
+ "Bash(python3 -c \"from mcp.server.mcpserver import MCPServer; print\\('MCPServer exists'\\); import inspect; print\\('has .tool\\(\\):', hasattr\\(MCPServer, 'tool'\\)\\); print\\('has .list_tools\\(\\):', hasattr\\(MCPServer,'list_tools'\\)\\); print\\('has .run\\(\\):', hasattr\\(MCPServer,'run'\\)\\)\")",
143
+ "Bash(python3 -m pytest -q -k \"mcp_server_builds or postgres_matches\" -v)",
144
+ "Bash(OKL_TEST_POSTGRES_URL=\"postgresql://joshuadell@/postgres?host=/tmp/oklpg&port=55432\" python3 -m pytest -q -k \"postgres_matches\" -v)",
145
+ "Bash(python3 -c \"import importlib.metadata as m; print\\(m.version\\('mcp'\\)\\)\")",
146
+ "Bash(OKL_TEST_POSTGRES_URL=\"postgresql://joshuadell@/postgres?host=/tmp/oklpg&port=55432\" python3 -m pytest -k \"postgres_matches\")",
147
+ "Bash(export OKL_TEST_POSTGRES_URL=\"postgresql://okl@/okltest?host=/tmp/oklpg&port=55432\")",
148
+ "Bash(python3 -m pytest -q -k \"postgres_matches\")",
149
+ "Bash(export OKL_DATABASE_URL=\"postgresql://okl@/okltest?host=/tmp/oklpg&port=55432\")",
150
+ "Bash(export OKL_TOKEN=\"deploy-test-secret\")",
151
+ "Bash(python3 -m uvicorn --factory okl.service:create_app --host 127.0.0.1 --port 8791)",
152
+ "Bash(echo \"started pid $!\")",
153
+ "Bash(curl -s http://127.0.0.1:8791/health)",
154
+ "Bash(OKL_TEST_POSTGRES_URL=\"postgresql://okl@/okltest?host=/tmp/oklpg&port=55432\" python3 -m pytest -q)",
155
+ "Bash(pkill -f uvicorn)",
156
+ "Bash(pg_ctl -D /tmp/oklpg/data stop -m immediate)",
157
+ "Bash(tmutil listlocalsnapshots *)",
158
+ "Bash(python3 -c \"import json,sys; print\\(', '.join\\(sorted\\(json.load\\(sys.stdin\\)['releases']\\)\\)\\)\")"
101
159
  ],
102
160
  "additionalDirectories": [
103
161
  "/Users/joshuadell/Dev/okl/e2e/scratch-briefed/.okl",
104
162
  "/Users/joshuadell/Dev/emeraldleaf-dev/src/pages",
105
163
  "/Users/joshuadell/Dev/emeraldleaf-dev/src/assets",
106
- "/Users/joshuadell/Dev/emeraldleaf-dev/src"
164
+ "/Users/joshuadell/Dev/emeraldleaf-dev/src",
165
+ "/Users/joshuadell/NovaCraft/.claude/skills/excalidraw-diagram"
107
166
  ]
108
167
  }
109
168
  }
@@ -27,13 +27,13 @@ jobs:
27
27
  with:
28
28
  python-version: "3.13"
29
29
  - name: Install okl
30
- # Consumer repos install the released package; in okl's own repo this
31
- # workflow dogfoods the working tree (pip install okl would 404 — not on PyPI yet).
30
+ # Detect by the package source, not the distribution name: the name changed once
31
+ # (PyPI rejects "okl" as confusable) and a name-based check silently broke with it.
32
32
  run: |
33
- if grep -q '^name = "okl"' pyproject.toml 2>/dev/null; then
33
+ if [ -f src/okl/cli.py ]; then
34
34
  pip install -e .
35
35
  else
36
- pip install okl
36
+ pip install org-knowledge-layer
37
37
  fi
38
38
 
39
39
  - name: Connect to the shared layer (optional — skipped when secrets are unset)
@@ -0,0 +1,58 @@
1
+ # Changelog
2
+
3
+ ## 0.3.0
4
+
5
+ Everything here came from running three things that had been written but never
6
+ executed: the MCP server, the Postgres backend, and a deployment.
7
+
8
+ ### Security
9
+
10
+ - **The service token now covers reads.** Previously `OKL_TOKEN` gated writes only, so
11
+ an unauthenticated `GET /nodes` returned the entire store — every recorded defect,
12
+ retired identifier and architecture decision. Every route now requires the token when
13
+ it is set, except `/health`, which is left open for schedulers and returns no record
14
+ content.
15
+ - **`okl connect --token` no longer commits your secret.** The token is stored in
16
+ cleartext in `.okl/config.json`, and a comment claimed the directory was gitignored
17
+ while nothing wrote a `.gitignore`. `okl init` and `okl connect` now write
18
+ `.okl/.gitignore`.
19
+ - **A rejected check no longer reports success.** A 401 surfaced as `ValueError` rather
20
+ than `OKLUnreachable`, so an unauthorized `okl check` exited 0 with a traceback — which
21
+ a pre-task hook reads as "no rules apply". It now fails closed with exit 2, as does
22
+ every other command, via a backstop in `main()`.
23
+
24
+ **Breaking:** if you run a service with `OKL_TOKEN` set, clients must upgrade too.
25
+ Clients older than 0.3.0 send no credential on `GET` requests and will get 401s from
26
+ `okl drift` and the recurrence metric. Upgrade the service and its clients together, or
27
+ unset `OKL_TOKEN` during the rollover.
28
+
29
+ ### Fixed
30
+
31
+ - `uvicorn okl.service:app` served a module-level `None`: the process started, bound the
32
+ port, passed a port-liveness check and returned 500 to every request. The app is now
33
+ built lazily in a module `__getattr__`, so the standard ASGI entrypoint works while
34
+ importing the module still does not touch the database.
35
+ - The MCP server could not start under `mcp` 2.x, which renamed `FastMCP` to
36
+ `MCPServer` — and the error handler told you to install the extra you had just
37
+ installed. Both names are tried, and the real import error is reported.
38
+ - Every MCP `okl_record` call with `scope="repo"` failed. The repo default used
39
+ `setdefault`, which cannot replace an explicit `None`, and the MCP tools pass every
40
+ field explicitly.
41
+ - MCP validation errors raised as an opaque "Error executing tool". They now return the
42
+ complaint, so an agent that invents a tag is told the vocabulary.
43
+
44
+ ### Added
45
+
46
+ - `docs/DEPLOY.md`: the shared-service deployment path, including a throwaway Postgres
47
+ for trying it locally and what each failure mode looks like. Every command in it was
48
+ run against a real Postgres and a real service.
49
+ - Tests covering the live MCP server, the ASGI entrypoint, service auth on reads, the
50
+ fail-closed 401, and the config `.gitignore`.
51
+ - The Postgres/SQLite parity test now runs in a scratch schema it creates and drops. The
52
+ first version opened with `DELETE FROM node` against whatever `OKL_TEST_POSTGRES_URL`
53
+ pointed at, which would have destroyed the store of anyone who set it to their real
54
+ service.
55
+
56
+ ## 0.2.0 and earlier
57
+
58
+ See the git history.
@@ -49,6 +49,17 @@ it is the actual contract. The parts that will fail your build if you miss them:
49
49
  cutoff that is still unfinished.
50
50
  - **Portability fixes.** Hooks, path resolution, and CI have been exercised on macOS and
51
51
  GitHub Actions and nowhere else.
52
+ - **Hook wiring for another agent.** `okl init` auto-registers hooks for Claude Code
53
+ only, so everywhere else the pre-task read is discretionary rather than enforced. The
54
+ scripts in `src/okl/scaffold/hooks/` are plain bash reading JSON on stdin and writing
55
+ the briefing to stdout; nothing in them is Claude-specific. What is missing is the
56
+ per-agent registration, plus confirming the agent fires an event before the model reads
57
+ the prompt (Codex CLI documents `userpromptsubmit`; OpenCode's plugin API appears to
58
+ cover tool events but not pre-prompt, so there it may only ever be a tool call). A PR adding `okl init --agent <name>` for the tool you actually use
59
+ daily would be the single most valuable contribution here. Bring evidence it fires: a
60
+ behavioral check against a bare control repo, not just a log line, because a hook that
61
+ fires is not a hook that is heard.
62
+
52
63
  - **A live-Postgres test.** The ranked search path for Postgres is currently asserted at
53
64
  the SQL-shape level against a fake connection; it has never run against a real server.
54
65
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: org-knowledge-layer
3
- Version: 0.1.3
3
+ Version: 0.3.0
4
4
  Summary: Org Knowledge Layer — an installable sixth surface that carries encoded engineering lessons across repos.
5
5
  Author: Joshua Dell
6
6
  License: MIT
@@ -67,6 +67,58 @@ stdlib-only with zero required dependencies.
67
67
 
68
68
  ---
69
69
 
70
+ ## What okl is
71
+
72
+ **A store of your engineering rules, and the machinery that keeps them true.**
73
+
74
+ Two things ship in the package. They are not coequal:
75
+
76
+ - **The knowledge layer** is the product. Typed records (rules, architecture decisions,
77
+ known defects, gates, tombstones, retractions) that live outside any one repo, get
78
+ retrieved into an agent's context before a task, and go stale loudly when the code
79
+ they describe moves on. Everything measured in [evals/REPORT.md](evals/REPORT.md)
80
+ measures this.
81
+ - **`okl scaffold`** is a starter kit for the in-repo discipline the store assumes: a
82
+ lean canon file, mechanical gates, registries, a review agent, and an eval harness.
83
+ It is useful on its own and it has never been measured. Use it to get a new repo to
84
+ the state where a shared store has something to attach to.
85
+
86
+ | Piece | What it is | Where it lives |
87
+ |---|---|---|
88
+ | **client** (`okl` CLI + agent tools) | `check` / `record` / `verify` / `drift` / `search` / `seed` | installed per-repo (this package) |
89
+ | **shared layer** (`okl serve`) | one small service owning the database, so many repos share one store | one place you run it |
90
+ | **scaffold** (`okl scaffold`) | the in-repo starter files: canon, gates, registries, evals | stamped into each repo, optional |
91
+
92
+ ## What it keeps from drifting, and how
93
+
94
+ Knowledge rots in a specific way: the code changes and everything written *about* the
95
+ code silently stops being true. Five mechanisms catch five different versions of that,
96
+ and it is worth knowing which one catches what, because they do not overlap.
97
+
98
+ | Drift | Caught by | How it works | Fires when |
99
+ |---|---|---|---|
100
+ | **A rule vs. the code it governs** | `okl drift --gate` | a record declares the path globs it governs; git is asked for the last commit touching them | that commit is newer than the record's last verification |
101
+ | **A retired identifier reappearing in prose** | `check-tombstones.sh` | greps tracked source, docs, comments and config for every tombstoned name | any non-allowlisted hit |
102
+ | **A withdrawn claim being restated** | `check-retractions.sh` | greps tracked docs for the exact quoted claim from the retraction registry | the quote appears outside the registry |
103
+ | **A doc nobody links to** | `check-doc-orphans.sh` | reachability check from hub files through `docs/` | a doc is unreachable, so it drifts unread |
104
+ | **A link pointing at a file that moved** | `check-links.sh` | resolves every local markdown link against `git ls-files` | the target does not exist |
105
+ | **A diagram source with no rendered image** | `check-diagram-pairs.sh` | pairs each editable source with its export; format-agnostic via `OKL_DIAGRAM_SRC_EXT`/`OUT_EXT` | reviewers would see nothing. A hand-authored image with no source is noted, never failed, and a repo with no diagram sources is a clean no-op |
106
+ | **Verification going quietly stale** | TTL + `verified_by` | records carry when they were last verified and by which observed check | past its TTL, a record is shown demoted rather than deleted |
107
+
108
+ Two honest limits on that table:
109
+
110
+ - **Diagram *content* is still a human job.** `check-diagram-pairs.sh` proves the rendered
111
+ image exists; nothing proves it matches the source it was exported from, or that either
112
+ matches the code. For that, name the diagram in a record's `--files` alongside the code
113
+ it depicts, so changing the code turns the drift gate red until someone re-verifies the
114
+ picture. This repo does exactly that with its own architecture diagram and README.
115
+ - **Comments are covered only by the identifier and claim gates.** A stale comment that
116
+ names no tombstoned identifier and restates no retracted claim will not be caught.
117
+ - **`okl drift` only watches what a record claims.** A file no record governs is not
118
+ watched by anything. Coverage is a curation decision, and the gap is invisible until
119
+ something breaks — which is why the mechanical gates above scan *everything tracked*
120
+ rather than only what is enrolled.
121
+
70
122
  ## Where this sits (2026): a crowded space, entered anyway
71
123
 
72
124
  **This is not a novel idea, and you should know that before reading further.** Agent
@@ -284,6 +336,18 @@ reading the AGENTS.md convention gets the same rules Claude Code does (byte-iden
284
336
  test-enforced). The hooks themselves are Claude Code-specific; other agents get the
285
337
  canon via AGENTS.md and the store via the MCP server (`okl mcp`).
286
338
 
339
+ That split matters: on Claude Code the pre-task read is *enforced* (fail-closed hook);
340
+ everywhere else it is *available* (a tool call or a shell command), which is
341
+ discretionary — the thing enforcement exists to avoid. The hook scripts themselves are
342
+ plain bash reading JSON on stdin, so nothing in them is Claude-specific; what is missing
343
+ for other agents is the config that registers them, and whether the agent fires an event
344
+ early enough to matter. Codex CLI documents a `userpromptsubmit` hook, which is the right
345
+ shape; Copilot, Gemini CLI and Cursor have hook systems worth checking against your
346
+ version; OpenCode's plugin API captures tool events but, as of this writing, no
347
+ pre-prompt event — so there the read stays a tool call rather than a gate. Verify against
348
+ your agent's current docs before trusting any of that. Wiring one up is a well-shaped
349
+ contribution — see [CONTRIBUTING.md](CONTRIBUTING.md).
350
+
287
351
  Hooks run in whatever environment the agent harness spawns — often without your venv or
288
352
  pipx bin dir on PATH — so both hooks resolve the `okl` binary in layers: the `OKL_BIN`
289
353
  env var, then the `okl_bin` path `init` pins into `.okl/config.json` (machine-local),
@@ -298,6 +362,7 @@ mode, good for trying it before you deploy anything.
298
362
  ```bash
299
363
  # 1. READ the relevant lessons before starting a task (the load-bearing move)
300
364
  okl check --task "add an endpoint that returns an order for the logged-in user"
365
+ # add --format actions --limit 3 for a ~240-token version (subagents, CI)
301
366
 
302
367
  # 2. RECORD a lesson after you learn it, with an actionable symptom/cause/fix
303
368
  okl record --type Defect --scope org --tags "security" \
@@ -336,6 +401,59 @@ okl metric # recurrence-after-arming: defect classes that came back in
336
401
  # where a catching check existed but wasn't turned on
337
402
  ```
338
403
 
404
+ ## Subagents and small context budgets
405
+
406
+ A full briefing costs roughly **4,400 tokens** — fine for a main session with a large
407
+ window, punishing for a subagent working in a few thousand. That asymmetry matters
408
+ because subagents are exactly where org rules get lost: a focused worker handling one
409
+ subtask has the least context and the most need for "here is the mistake this codebase
410
+ already made."
411
+
412
+ `--format actions` solves it by dropping everything except the imperative list:
413
+
414
+ ```bash
415
+ okl check --task "add an endpoint returning an order for the logged-in user" \
416
+ --format actions --limit 3
417
+ ```
418
+
419
+ ```
420
+ OKL — 3 rule(s) apply before you start:
421
+ - FIX: Missing ownership scope check is an IDOR (CWE-639) [when: an endpoint fetches an
422
+ entity by id with no owner/tenant predicate]
423
+ -> add the caller's owner id to the WHERE clause; return 404 (not 403) on no match
424
+ ...
425
+ ```
426
+
427
+ **Measured on this repo's own store:** ~240 tokens at `--limit 3`, ~390 at `--limit 5`,
428
+ ~630 at `--limit 8`, against ~2,650 for the full briefing. Cheap enough to call per subtask.
429
+
430
+ The full briefing is itself capped: `check` keeps the top `--limit` records (12 by
431
+ default) from the ranked, filtered set and says how many it trimmed. Before that cutoff
432
+ existed, one task on this store returned 20 records and ~4,400 tokens. Re-running the A/B
433
+ after adding it showed no retrieval miss — the one task that regressed still had its rule
434
+ in the briefing and the model simply did not follow it, which is a compliance problem
435
+ rather than a retrieval one. See [evals/REPORT.md](evals/REPORT.md).
436
+
437
+ What it drops: the bucketed sections, the prose bodies explaining *why* each record
438
+ exists, prior-art notes, and the stale-record footer. What it keeps is what changes
439
+ behaviour: the verb, the symptom to watch for, and the fix.
440
+
441
+ **Wiring it into a subagent.** Three ways, in order of how much enforcement you get:
442
+
443
+ 1. **The MCP tool** — `okl_check(task=..., compact=True, limit=3)`. Any subagent with
444
+ MCP access can call it. Discretionary: the agent has to choose to.
445
+ 2. **In the subagent's prompt** — have the spawning agent run `okl check --format
446
+ actions --limit 3` and paste the result into the subtask description. Not
447
+ discretionary, and it costs the parent almost nothing.
448
+ 3. **A wrapper script** that runs the check and prepends it to whatever prompt it is
449
+ handed. This is the enforced version for orchestration you control.
450
+
451
+ **A caveat worth stating.** `--limit` caps how many records the briefing draws on, and
452
+ ranking decides which survive. If a task's most relevant rule ranks fourth and you ask
453
+ for three, you will not see it, and nothing will tell you. The full briefing exists
454
+ because it does not make that trade. Use the compact form where a token budget forces
455
+ the choice, not by default.
456
+
339
457
  ## Verification: don't let a step grade itself
340
458
 
341
459
  A step reporting "I succeeded" and the work actually being done are two different facts,
@@ -371,17 +489,36 @@ folder.) Two clarifications that stop the common misreadings:
371
489
 
372
490
  ## Seed it (so the very first `check` returns something)
373
491
 
374
- An empty store returns nothing. You can hand-`record` your first lessons, or load a
375
- starter file — a JSON list of notes and links:
492
+ An empty store returns nothing, and says so — a check against an empty store reports
493
+ that it proved nothing rather than reporting "no rules apply". Three ways to fill it:
494
+
495
+ **1. See what ships, then choose.** A bare `okl seed` imports nothing; it lists the
496
+ bundled packs with their record counts and subject tags, marking the ones that match
497
+ this repo's declared interests:
376
498
 
377
499
  ```bash
378
- okl seed seed/react-defects.json # or point at a directory to load several
500
+ okl seed # list the packs, import nothing
501
+ okl seed <path>/rag-defects.json # import one
502
+ okl seed --all # import every pack (explicit on purpose)
379
503
  ```
380
504
 
381
- The bundled seed files hold real, dated lessons from a few production codebases
382
- (a .NET service, a geospatial ML pipeline, a Python search service, a React app).
383
- Treat them as examples of the format and as genuinely useful starting defects; delete
384
- what doesn't apply to you.
505
+ The packs hold real, dated records from production codebases (a .NET service, a
506
+ geospatial ML pipeline, a Python RAG service, a React app). They are org-scoped, so
507
+ importing packs for stacks you do not use fills every briefing here with noise about
508
+ frameworks you will never touch — which is why `--all` is opt-in rather than default.
509
+
510
+ **2. Generate records from this codebase.** If you use a coding agent, the scaffold
511
+ stamps a `/seed-from-codebase` command that has the agent read your repo — the guard
512
+ rails already in the code, what CI enforces, the fix commits, the existing canon — and
513
+ propose records with a `file:line` citation each. Everything it proposes is repo-scoped
514
+ and unverified by design; it writes a reviewable file and imports nothing, because a
515
+ plausible rule no file supports is worse than an empty store.
516
+
517
+ **3. `okl bootstrap`** greps git history and file names for candidates. It is the weakest
518
+ of the three and comes up empty on young repos; prefer option 2 when an agent is available.
519
+
520
+ Whichever you use, review before importing. Choosing a record's scope is the curation
521
+ step that keeps a shared layer from filling with one project's noise.
385
522
 
386
523
  ---
387
524
 
@@ -412,14 +549,8 @@ TDD, plan writing/execution, git-worktree isolation) are **not bundled** — the
412
549
  best maintained in third-party collections, so `skills/RECOMMENDED-COMPANIONS.md`
413
550
  points at those instead of vendoring someone else's work and its cross-references.
414
551
 
415
- The scaffold is independent of the knowledge store — use either half on its own.
416
-
417
- ## The two halves
418
-
419
- | Piece | What it is | Where it lives |
420
- |---|---|---|
421
- | **client** (`okl` CLI + agent tools) | `check` / `record` / `search` / `link` / `drift` / `seed` / … | installed per-repo (this package) |
422
- | **shared layer** (`okl serve`) | a small web service that owns the database, so many repos share one store | one place you run it |
552
+ The scaffold runs with no store at all; the store works in a repo that never scaffolded.
553
+ They are complementary, not a package deal.
423
554
 
424
555
  **Storage is swappable** via one environment variable — your commands never change:
425
556
 
@@ -435,17 +566,19 @@ okl serve --port 8080
435
566
 
436
567
  ```bash
437
568
  pip install "org-knowledge-layer[service]"
438
- OKL_DATABASE_URL="sqlite:///okl.db" OKL_TOKEN="a-shared-secret" okl serve
569
+ OKL_DATABASE_URL="postgresql://user:pass@host/okl" OKL_TOKEN="a-shared-secret" okl serve
439
570
  # repos then: okl connect https://your-host --token a-shared-secret
440
571
  ```
441
572
 
442
- `OKL_TOKEN` (optional) gates **writes**; **reads stay open** — `/nodes` returns the
443
- whole store to anyone who can reach the port. A mature store holds your defect history,
444
- security patterns and internal architecture, so treat it as sensitive: bind it to a
445
- private network or put authentication in front of every route before exposing it. See
446
- [SECURITY.md](SECURITY.md). Deploy the service
447
- wherever you like — it's storage-agnostic by design (a `Dockerfile` and a
448
- `fly.toml` are the obvious next commit; not included in v0).
573
+ **Set `OKL_TOKEN`.** With it, every route requires the bearer token except `/health`
574
+ (left open so schedulers can probe it). Without it, every route is open — including
575
+ `GET /nodes`, which hands the whole store to anyone who can reach the port. A mature
576
+ store is a catalogue of your known defects and internal architecture, which is a map of
577
+ where you are weak. It is a single shared secret with no per-repo scoping or rotation;
578
+ put a real authenticating proxy in front if you need more.
579
+
580
+ Full instructions, including a throwaway Postgres for trying it locally and what the
581
+ failure modes look like: **[docs/DEPLOY.md](docs/DEPLOY.md)**.
449
582
 
450
583
  ## Agent integration (MCP)
451
584