copilot-session-usage 0.2.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 (115) hide show
  1. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/CHANGELOG.md +4 -0
  2. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/PKG-INFO +2 -1
  3. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/README.md +1 -0
  4. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/justfile +1 -2
  5. copilot_session_usage-0.3.0/knowledge/_schema/Concept.schema.yaml +41 -0
  6. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/knowledge/_schema/Experiment.schema.yaml +14 -3
  7. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/knowledge/_schema/Finding.schema.yaml +16 -4
  8. copilot_session_usage-0.3.0/knowledge/_schema/Hypothesis.schema.yaml +45 -0
  9. copilot_session_usage-0.3.0/knowledge/_schema/Outcome.schema.yaml +40 -0
  10. copilot_session_usage-0.3.0/knowledge/_schema/Playbook.schema.yaml +41 -0
  11. copilot_session_usage-0.3.0/knowledge/_schema/Principle.schema.yaml +37 -0
  12. copilot_session_usage-0.3.0/knowledge/_schema/Reference.schema.yaml +34 -0
  13. copilot_session_usage-0.3.0/knowledge/_schema/Structure.schema.yaml +45 -0
  14. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/knowledge/concepts/index.md +4 -1
  15. copilot_session_usage-0.3.0/knowledge/experiments/index.md +8 -0
  16. copilot_session_usage-0.2.3/knowledge/findings/subagent-logs-use-runsubagent-prefix.md → copilot_session_usage-0.3.0/knowledge/findings/2026.07.02-00.00-subagent-logs-runsubagent-prefix.md +2 -1
  17. copilot_session_usage-0.2.3/knowledge/findings/title-jsonl-not-counted-as-model-turn.md → copilot_session_usage-0.3.0/knowledge/findings/2026.07.02-22.00-title-generation-not-counted-as-model-turn.md +1 -0
  18. copilot_session_usage-0.2.3/knowledge/findings/cache-write-cost-not-tracked.md → copilot_session_usage-0.3.0/knowledge/findings/2026.07.02-23.00-cache-write-approximation.md +1 -0
  19. copilot_session_usage-0.3.0/knowledge/findings/index.md +10 -0
  20. copilot_session_usage-0.3.0/knowledge/guides/index.md +10 -0
  21. copilot_session_usage-0.3.0/knowledge/ideas/index.md +8 -0
  22. copilot_session_usage-0.3.0/knowledge/index.md +17 -0
  23. copilot_session_usage-0.3.0/knowledge/log.md +3 -0
  24. copilot_session_usage-0.3.0/knowledge/principles/index.md +8 -0
  25. copilot_session_usage-0.3.0/knowledge/reference/index.md +9 -0
  26. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/knowledge/structures/cache-cost-approximation.md +4 -3
  27. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/knowledge/structures/index.md +4 -1
  28. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/knowledge/structures/subagent-cost-tracking.md +7 -4
  29. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/knowledge/structures/vscode-copilot-extension.md +3 -2
  30. copilot_session_usage-0.3.0/skills/copilot-session-usage/SKILL.md +131 -0
  31. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/uv.lock +10 -10
  32. copilot_session_usage-0.2.3/knowledge/_schema/Concept.schema.yaml +0 -20
  33. copilot_session_usage-0.2.3/knowledge/_schema/Playbook.schema.yaml +0 -19
  34. copilot_session_usage-0.2.3/knowledge/_schema/Principle.schema.yaml +0 -25
  35. copilot_session_usage-0.2.3/knowledge/_schema/Reference.schema.yaml +0 -19
  36. copilot_session_usage-0.2.3/knowledge/_schema/Structure.schema.yaml +0 -26
  37. copilot_session_usage-0.2.3/knowledge/experiments/index.md +0 -5
  38. copilot_session_usage-0.2.3/knowledge/findings/index.md +0 -7
  39. copilot_session_usage-0.2.3/knowledge/guides/index.md +0 -7
  40. copilot_session_usage-0.2.3/knowledge/ideas/index.md +0 -5
  41. copilot_session_usage-0.2.3/knowledge/index.md +0 -16
  42. copilot_session_usage-0.2.3/knowledge/log.md +0 -114
  43. copilot_session_usage-0.2.3/knowledge/principles/index.md +0 -5
  44. copilot_session_usage-0.2.3/knowledge/reference/index.md +0 -6
  45. copilot_session_usage-0.2.3/skills/copilot-session-usage/SKILL.md +0 -98
  46. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/.editorconfig +0 -0
  47. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  48. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  49. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/.github/guidelines/knowledge-base.guidelines.md +0 -0
  50. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/.github/pull_request_template.md +0 -0
  51. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/.github/skills/consolidate-knowledge-base/SKILL.md +0 -0
  52. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/.github/skills/record-finding/SKILL.md +0 -0
  53. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/.github/workflows/ci.yml +0 -0
  54. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/.github/workflows/publish.yml +0 -0
  55. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/.gitignore +0 -0
  56. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/.readthedocs.yaml +0 -0
  57. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/AGENTS.md +0 -0
  58. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/CONTRIBUTING.md +0 -0
  59. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/LICENSE +0 -0
  60. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/docs/source/_static/changelog.js +0 -0
  61. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/docs/source/_static/custom.css +0 -0
  62. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/docs/source/changelog.md +0 -0
  63. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/docs/source/conf.py +0 -0
  64. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/docs/source/explanation/how-cost-estimation-works.md +0 -0
  65. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/docs/source/explanation/index.md +0 -0
  66. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/docs/source/how-to/analyze-specific-session.md +0 -0
  67. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/docs/source/how-to/batch-and-spending.md +0 -0
  68. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/docs/source/how-to/export-json.md +0 -0
  69. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/docs/source/how-to/index.md +0 -0
  70. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/docs/source/how-to/wsl2.md +0 -0
  71. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/docs/source/index.md +0 -0
  72. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/docs/source/installation.md +0 -0
  73. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/docs/source/reference/api.md +0 -0
  74. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/docs/source/reference/cli.md +0 -0
  75. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/docs/source/reference/index.md +0 -0
  76. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/docs/source/reference/pricing.md +0 -0
  77. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/docs/source/tutorials/getting-started.md +0 -0
  78. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/docs/source/tutorials/index.md +0 -0
  79. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/knowledge/_schema/Base.schema.yaml +0 -0
  80. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/knowledge/concepts/copilot-cli.md +0 -0
  81. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/knowledge/concepts/overview.md +0 -0
  82. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/knowledge/concepts/session-cost-analysis.md +0 -0
  83. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/knowledge/concepts/threshold-based-pricing.md +0 -0
  84. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/knowledge/experiments/verify-subagent-cost-attribution.md +0 -0
  85. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/knowledge/guides/automation-scripts.md +0 -0
  86. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/knowledge/guides/cost-optimization.md +0 -0
  87. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/knowledge/guides/wsl2-setup.md +0 -0
  88. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/knowledge/ideas/multi-session-efficiency-analytics.md +0 -0
  89. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/knowledge/principles/findings-are-immutable.md +0 -0
  90. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/knowledge/reference/debug-log-format.md +0 -0
  91. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/knowledge/reference/pricing-formats.md +0 -0
  92. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/knowledge/structures/knowledge-base-information-types.md +0 -0
  93. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/knowledge/structures/session-discovery-algorithm.md +0 -0
  94. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/pyproject.toml +0 -0
  95. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/scripts/refresh_pricing.py +0 -0
  96. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/src/copilot_session_usage/__init__.py +0 -0
  97. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/src/copilot_session_usage/_internal/__init__.py +0 -0
  98. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/src/copilot_session_usage/_internal/copilot_cli.py +0 -0
  99. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/src/copilot_session_usage/_internal/core.py +0 -0
  100. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/src/copilot_session_usage/_internal/vscode.py +0 -0
  101. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/src/copilot_session_usage/api.py +0 -0
  102. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/src/copilot_session_usage/cli.py +0 -0
  103. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/src/copilot_session_usage/data/__init__.py +0 -0
  104. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/src/copilot_session_usage/data/custom-models-pricing.yml +0 -0
  105. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/src/copilot_session_usage/data/models-and-pricing.lock +0 -0
  106. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/src/copilot_session_usage/data/models-and-pricing.yml +0 -0
  107. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/tests/conftest.py +0 -0
  108. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/tests/test_api.py +0 -0
  109. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/tests/test_cli.py +0 -0
  110. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/tests/test_core.py +0 -0
  111. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/tests/test_coverage_gaps.py +0 -0
  112. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/tests/test_rendering.py +0 -0
  113. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/tests/test_vscode.py +0 -0
  114. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/tests/test_vscode_platform.py +0 -0
  115. {copilot_session_usage-0.2.3 → copilot_session_usage-0.3.0}/uv.toml +0 -0
@@ -1,5 +1,9 @@
1
1
  ## Unreleased
2
2
 
3
+ ## v0.2.3 (2026-07-03)
4
+
5
+ ## v0.2.2 (2026-07-03)
6
+
3
7
  ### Feat
4
8
 
5
9
  - accurate AIC cost computation using nanoAiu and cache_write
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: copilot-session-usage
3
- Version: 0.2.3
3
+ Version: 0.3.0
4
4
  Summary: Usage and cost analytics for GitHub Copilot and Copilot-CLI session logs
5
5
  Project-URL: Homepage, https://github.com/gsemet/copilot-session-usage
6
6
  Project-URL: Documentation, https://copilot-session-usage.readthedocs.io/en/stable/
@@ -58,6 +58,7 @@ copilot-session-usage batch 10
58
58
  - **Threshold-aware pricing** — long-context tier switching (e.g. GPT-5.4 > 272k tokens)
59
59
  - **Subagent cost attribution** — tracks `runSubagent` calls and their token usage
60
60
  - **Cross-platform** — macOS, Linux, Windows, WSL2
61
+ - **Three output formats** — `json` (default), `table`, `detailed`
61
62
  - **Three detail levels** — `minimal`, `compact`, `full`
62
63
  - **JSON and table output** — machine-readable or human-friendly
63
64
 
@@ -42,6 +42,7 @@ copilot-session-usage batch 10
42
42
  - **Threshold-aware pricing** — long-context tier switching (e.g. GPT-5.4 > 272k tokens)
43
43
  - **Subagent cost attribution** — tracks `runSubagent` calls and their token usage
44
44
  - **Cross-platform** — macOS, Linux, Windows, WSL2
45
+ - **Three output formats** — `json` (default), `table`, `detailed`
45
46
  - **Three detail levels** — `minimal`, `compact`, `full`
46
47
  - **JSON and table output** — machine-readable or human-friendly
47
48
 
@@ -100,8 +100,7 @@ knowledge-validate:
100
100
 
101
101
  # Lint (format) OKF knowledge frontmatter in-place
102
102
  knowledge-lint:
103
- uv run -- okf-schema lint --path knowledge
104
- uv run -- okf-schema index --path knowledge
103
+ uv run -- okfkb update knowledge
105
104
 
106
105
  # Check OKF knowledge frontmatter without modifying files
107
106
  knowledge-lint-check:
@@ -0,0 +1,41 @@
1
+ $schema: "http://json-schema.org/draft-07/schema#"
2
+ title: Concept
3
+ description: >-
4
+ A stable, well-understood idea that explains "what is this." Concepts are
5
+ the semantic building blocks of the knowledge base.
6
+
7
+ Use Concept when an observation or hypothesis has converged into a durable
8
+ explanation. Do NOT use Concept for raw observations (use Finding), system
9
+ composition (use Structure), or human-agreed standards (use Principle).
10
+
11
+ Mutable. Concepts are updated to reflect new understanding as Findings
12
+ accumulate. They are never deleted; if entirely invalidated, they are
13
+ marked with `status: deprecated` and linked to replacement Concepts.
14
+
15
+ Belongs to the Semantic layer. Promoted from confirmed Hypotheses or
16
+ converged Findings. Supports Structures and Principles.
17
+ allOf:
18
+ - $ref: "Base.schema.yaml"
19
+ - type: object
20
+ properties:
21
+ type:
22
+ description: Document type — must be "Concept" for concept documents.
23
+ type: string
24
+ const: Concept
25
+ status:
26
+ description: Lifecycle state of the concept.
27
+ type: string
28
+ enum: [active, deprecated]
29
+ derived_from:
30
+ description: IDs of Findings or Hypotheses that support this Concept.
31
+ type: array
32
+ items: { type: string }
33
+ related_concepts:
34
+ description: IDs of other Concept documents that deepen or contrast this idea.
35
+ type: array
36
+ items: { type: string }
37
+ prerequisites:
38
+ description: Concepts a reader should understand before engaging with this one.
39
+ type: array
40
+ items: { type: string }
41
+ required: [type]
@@ -1,9 +1,20 @@
1
1
  $schema: "http://json-schema.org/draft-07/schema#"
2
2
  title: Experiment
3
3
  description: >-
4
- A reusable, prepared procedure that can be executed one or two times to test a
5
- hypothesis. Each execution produces one Finding. The Experiment is a template;
6
- its recorded outcomes live as Finding documents.
4
+ A reusable, prepared procedure designed to test a Hypothesis and produce
5
+ empirical Findings. Each execution yields one or more Finding documents.
6
+
7
+ Use Experiment when you need a reproducible test procedure. Do NOT use
8
+ Experiment for ad-hoc observations (write a Finding directly) or for
9
+ operational workflows (use Playbook).
10
+
11
+ The Experiment template itself is mutable while in `proposed` or `active`
12
+ status. Once `retired` or `superseded`, it should not be modified.
13
+ Outcomes are recorded as separate Finding documents, not by editing the
14
+ Experiment.
15
+
16
+ Belongs to the Testing layer. Tests Hypotheses. Produces Findings. May be
17
+ superseded by improved experimental designs.
7
18
  allOf:
8
19
  - $ref: "Base.schema.yaml"
9
20
  - type: object
@@ -1,10 +1,22 @@
1
1
  $schema: "http://json-schema.org/draft-07/schema#"
2
2
  title: Finding
3
3
  description: >-
4
- An empirical, dated, falsifiable record of what an agent or human truthfully
5
- observed and believed at a point in time. The body is immutable once written;
6
- only lifecycle frontmatter (status, contradicted_by, superseded_by) may be
7
- appended later.
4
+ A raw, dated, falsifiable observation recorded by an agent or human at a
5
+ specific point in time. Findings are the atomic unit of empirical knowledge.
6
+
7
+ Use Finding when you have observed something non-trivial during debugging,
8
+ investigation, or experimentation and want to preserve that observation for
9
+ future agents. Do NOT use Finding for stable truths (use Concept), procedures
10
+ (use Playbook), or human-agreed standards (use Principle).
11
+
12
+ The body and claim are immutable once written. To correct a Finding, write a
13
+ new Finding with `contradicts` or `supersedes` pointing to the old one. The
14
+ only permitted edits to an existing Finding are lifecycle frontmatter:
15
+ `status` (active, contradicted, superseded), `contradicted_by`, and
16
+ `superseded_by`, appended by review.
17
+
18
+ Belongs to the Storage layer. Findings are promoted into Concepts or
19
+ Structures when they converge and stabilize. They may also support Principles.
8
20
  allOf:
9
21
  - $ref: "Base.schema.yaml"
10
22
  - type: object
@@ -0,0 +1,45 @@
1
+ $schema: "http://json-schema.org/draft-07/schema#"
2
+ title: Hypothesis
3
+ description: >-
4
+ A testable proposition or educated guess derived from observations, intended
5
+ to be validated or falsified through experimentation.
6
+
7
+ Use Hypothesis when you have an idea that needs testing before it can be
8
+ treated as stable knowledge. Do NOT use Hypothesis for already-confirmed
9
+ truths (use Concept or Structure) or for planned deliverables (use Outcome).
10
+
11
+ Mutable until tested. Once tested, its status becomes `confirmed` or
12
+ `falsified`. A confirmed Hypothesis is promoted to Concept or Structure
13
+ (human decision). A falsified Hypothesis remains in the knowledge base with
14
+ `status: falsified` to preserve the record of what was tried.
15
+
16
+ Belongs to the Testing layer. Derived from Findings or direct observation.
17
+ Promoted to Concept or Structure when confirmed. Produces Experiments.
18
+ allOf:
19
+ - $ref: "Base.schema.yaml"
20
+ - type: object
21
+ properties:
22
+ type:
23
+ description: Document type — must be "Hypothesis".
24
+ type: string
25
+ const: Hypothesis
26
+ derived_from:
27
+ description: IDs of Findings or Concepts that motivated this hypothesis.
28
+ type: array
29
+ items: { type: string }
30
+ status:
31
+ description: Lifecycle state of the hypothesis.
32
+ type: string
33
+ enum: [proposed, under_test, confirmed, falsified]
34
+ confirmed_by:
35
+ description: IDs of Findings that confirm this hypothesis.
36
+ type: array
37
+ items: { type: string }
38
+ falsified_by:
39
+ description: IDs of Findings that falsify this hypothesis.
40
+ type: array
41
+ items: { type: string }
42
+ promoted_to:
43
+ description: ID of the Concept or Structure this hypothesis was promoted into.
44
+ type: string
45
+ required: [type, status]
@@ -0,0 +1,40 @@
1
+ $schema: "http://json-schema.org/draft-07/schema#"
2
+ title: Outcome
3
+ description: >-
4
+ A planned deliverable, project, or artifact to be built from the knowledge
5
+ base — "what I want to build."
6
+
7
+ Use Outcome when defining a concrete goal, feature, or deliverable that
8
+ emerges from stable knowledge. Do NOT use Outcome for procedures (use
9
+ Playbook), observations (use Finding), or testable guesses (use Hypothesis).
10
+
11
+ Mutable. Tracks progress from `planned` → `in_progress` → `done` or
12
+ `cancelled`. May reference Playbooks as execution paths and Concepts/
13
+ Structures as foundational knowledge.
14
+
15
+ Belongs to the Planning layer. Derived from Concepts, Structures, and
16
+ Principles. References Playbooks for execution.
17
+ allOf:
18
+ - $ref: "Base.schema.yaml"
19
+ - type: object
20
+ properties:
21
+ type:
22
+ description: Document type — must be "Outcome".
23
+ type: string
24
+ const: Outcome
25
+ status:
26
+ description: Progress state of the outcome.
27
+ type: string
28
+ enum: [planned, in_progress, done, cancelled]
29
+ deliverable:
30
+ description: Description of the concrete artifact or result to be produced.
31
+ type: string
32
+ derived_from:
33
+ description: IDs of Concepts, Structures, or Principles that motivate this outcome.
34
+ type: array
35
+ items: { type: string }
36
+ execution_playbooks:
37
+ description: IDs of Playbooks that describe how to achieve this outcome.
38
+ type: array
39
+ items: { type: string }
40
+ required: [type, status]
@@ -0,0 +1,41 @@
1
+ $schema: "http://json-schema.org/draft-07/schema#"
2
+ title: Playbook
3
+ description: >-
4
+ A reproducible, step-by-step workflow or procedure that produces a specific
5
+ result given the current understanding of the system.
6
+
7
+ Use Playbook when documenting "how to do X" — deployment steps, debugging
8
+ procedures, setup guides. Do NOT use Playbook for one-off observations
9
+ (use Finding), system architecture (use Structure), or planned deliverables
10
+ (use Outcome).
11
+
12
+ Mutable while active. When a better workflow is found, the old Playbook is
13
+ marked `status: deprecated` or `superseded` with `superseded_by` pointing to
14
+ the replacement. Playbooks are experienced until proven false or obsolete.
15
+
16
+ Belongs to the Operational layer. References Concepts and Structures for
17
+ context. May be referenced by Outcomes as execution paths.
18
+ allOf:
19
+ - $ref: "Base.schema.yaml"
20
+ - type: object
21
+ properties:
22
+ type:
23
+ description: Document type — must be "Playbook" for playbook documents.
24
+ type: string
25
+ const: Playbook
26
+ status:
27
+ description: Lifecycle state of the playbook.
28
+ type: string
29
+ enum: [active, deprecated, superseded]
30
+ superseded_by:
31
+ description: IDs of Playbooks that replace this one.
32
+ type: array
33
+ items: { type: string }
34
+ estimated_duration:
35
+ description: Approximate time to complete the playbook (e.g., "15 min", "2 h").
36
+ type: string
37
+ tools_required:
38
+ description: CLI tools, scripts, or external utilities the reader must have installed.
39
+ type: array
40
+ items: { type: string }
41
+ required: [type]
@@ -0,0 +1,37 @@
1
+ $schema: "http://json-schema.org/draft-07/schema#"
2
+ title: Principle
3
+ description: >-
4
+ A durable, normative statement agreed upon by humans — "we always…",
5
+ "never…", "must…". Principles include rules, conventions, and governance
6
+ directives.
7
+
8
+ Use Principle when establishing a team standard, coding convention, or
9
+ architectural rule that requires human agreement. Do NOT use Principle for
10
+ observations (use Finding), explanations (use Concept), or workflows
11
+ (use Playbook).
12
+
13
+ Stable. Changed only through explicit human review. Principles are supported
14
+ by Findings but are not dictated by them. Superseded Principles retain their
15
+ record with `superseded_by` linking to the replacement.
16
+
17
+ Belongs to the Governance layer. Supported by Findings. May reference
18
+ Concepts and Structures for context.
19
+ allOf:
20
+ - $ref: "Base.schema.yaml"
21
+ - type: object
22
+ properties:
23
+ type:
24
+ description: Document type — must be "Principle".
25
+ type: string
26
+ const: Principle
27
+ rationale:
28
+ description: Why this principle exists and what it protects against.
29
+ type: string
30
+ authority:
31
+ description: Who agreed this principle (e.g. "team", "human-reviewed").
32
+ type: string
33
+ supported_by:
34
+ description: IDs of Findings that provide empirical support for this principle.
35
+ type: array
36
+ items: { type: string }
37
+ required: [type]
@@ -0,0 +1,34 @@
1
+ $schema: "http://json-schema.org/draft-07/schema#"
2
+ title: Reference
3
+ description: >-
4
+ An external source document — scientific papers, API specifications, lookup
5
+ tables, or authoritative references — mirrored or linked within the knowledge
6
+ base.
7
+
8
+ Use Reference when bringing external information into the knowledge base for
9
+ easy agent access. Do NOT use Reference for your own observations (use
10
+ Finding), interpretations (use Concept), or workflows (use Playbook). Personal
11
+ notes on a paper belong in a Finding or Concept, not in Reference.
12
+
13
+ Immutable. References mirror or link to external sources. If the upstream
14
+ changes, create a new Reference with updated `schema_version` rather than
15
+ editing the old one.
16
+
17
+ Belongs to the Lookup layer. Referenced by Concepts, Structures, Principles,
18
+ and Findings for authoritative backing.
19
+ allOf:
20
+ - $ref: "Base.schema.yaml"
21
+ - type: object
22
+ properties:
23
+ type:
24
+ description: Document type — must be "Reference" for reference documents.
25
+ type: string
26
+ const: Reference
27
+ schema_version:
28
+ description: Version of the data schema or API documented here (e.g., "v2.1").
29
+ type: string
30
+ authoritative_source:
31
+ description: URL or identifier of the canonical upstream specification this reference mirrors.
32
+ type: string
33
+ format: uri
34
+ required: [type]
@@ -0,0 +1,45 @@
1
+ $schema: "http://json-schema.org/draft-07/schema#"
2
+ title: Structure
3
+ description: >-
4
+ A description of how an object, system, or artifact is composed and how its
5
+ parts relate — the "how it works" view.
6
+
7
+ Use Structure when documenting system architecture, component relationships,
8
+ or mechanical composition. Do NOT use Structure for abstract ideas (use
9
+ Concept), operational procedures (use Playbook), or human-agreed standards
10
+ (use Principle).
11
+
12
+ Mutable. Updated as the system evolves. Like Concepts, Structures are never
13
+ deleted; obsolete Structures are marked `status: deprecated` and linked to
14
+ replacements.
15
+
16
+ Belongs to the Semantic layer. Promoted from confirmed Hypotheses or
17
+ converged Findings. Cross-cuts multiple Concepts.
18
+ allOf:
19
+ - $ref: "Base.schema.yaml"
20
+ - type: object
21
+ properties:
22
+ type:
23
+ description: Document type — must be "Structure".
24
+ type: string
25
+ const: Structure
26
+ status:
27
+ description: Lifecycle state of the structure.
28
+ type: string
29
+ enum: [active, deprecated]
30
+ derived_from:
31
+ description: IDs of Findings or Hypotheses that support this Structure.
32
+ type: array
33
+ items: { type: string }
34
+ subject:
35
+ description: The object or system whose structure is described.
36
+ type: string
37
+ parts:
38
+ description: The components, fields, or sub-parts that make up the subject.
39
+ type: array
40
+ items: { type: string }
41
+ related_concepts:
42
+ description: IDs of Concept documents that explain the ideas behind this structure.
43
+ type: array
44
+ items: { type: string }
45
+ required: [type]
@@ -1,6 +1,9 @@
1
1
  # Concept
2
2
 
3
- A core concept or explanatory document in the knowledge base.
3
+ A stable, well-understood idea that explains "what is this." Concepts are the semantic building blocks of the knowledge base.
4
+ Use Concept when an observation or hypothesis has converged into a durable explanation. Do NOT use Concept for raw observations (use Finding), system composition (use Structure), or human-agreed standards (use Principle).
5
+ Mutable. Concepts are updated to reflect new understanding as Findings accumulate. They are never deleted; if entirely invalidated, they are marked with `status: deprecated` and linked to replacement Concepts.
6
+ Belongs to the Semantic layer. Promoted from confirmed Hypotheses or converged Findings. Supports Structures and Principles.
4
7
 
5
8
  - [Copilot CLI Differences](copilot-cli.md) — How session cost tracking differs when using copilot-cli instead of the VS Code extension. [Concept]
6
9
  - [Session Cost Analysis](session-cost-analysis.md) — Process of extracting token usage metrics from Copilot debug logs and estimating monetary cost based on per-model pricing. [Concept]
@@ -0,0 +1,8 @@
1
+ # Experiment
2
+
3
+ A reusable, prepared procedure designed to test a Hypothesis and produce empirical Findings. Each execution yields one or more Finding documents.
4
+ Use Experiment when you need a reproducible test procedure. Do NOT use Experiment for ad-hoc observations (write a Finding directly) or for operational workflows (use Playbook).
5
+ The Experiment template itself is mutable while in `proposed` or `active` status. Once `retired` or `superseded`, it should not be modified. Outcomes are recorded as separate Finding documents, not by editing the Experiment.
6
+ Belongs to the Testing layer. Tests Hypotheses. Produces Findings. May be superseded by improved experimental designs.
7
+
8
+ - [Verify Subagent Cost Attribution](verify-subagent-cost-attribution.md) — Check that subagent token costs are attributed to their runSubagent call and not double-counted in the parent session total. [Experiment]
@@ -14,7 +14,8 @@ context: >-
14
14
  future extension versions, which may not remain true.
15
15
  status: active
16
16
  links: []
17
- backlinks: []
17
+ backlinks: [structures/subagent-cost-tracking.md]
18
+ okf_version: "0.1"
18
19
  ---
19
20
 
20
21
  # Subagent Logs Use runSubagent Prefix
@@ -16,6 +16,7 @@ timestamp: 2026-07-02T22:00:00Z
16
16
  links: []
17
17
  backlinks: [structures/subagent-cost-tracking.md,
18
18
  structures/vscode-copilot-extension.md]
19
+ okf_version: "0.1"
19
20
  ---
20
21
 
21
22
  # Finding: title-*.jsonl not counted as "Model Turn" by VS Code panel
@@ -15,6 +15,7 @@ context: >-
15
15
  timestamp: 2026-07-02T23:00:00Z
16
16
  links: []
17
17
  backlinks: [structures/cache-cost-approximation.md]
18
+ okf_version: "0.1"
18
19
  ---
19
20
 
20
21
  # Finding: cache_write approximated via fresh_input — now implemented
@@ -0,0 +1,10 @@
1
+ # Finding
2
+
3
+ A raw, dated, falsifiable observation recorded by an agent or human at a specific point in time. Findings are the atomic unit of empirical knowledge.
4
+ Use Finding when you have observed something non-trivial during debugging, investigation, or experimentation and want to preserve that observation for future agents. Do NOT use Finding for stable truths (use Concept), procedures (use Playbook), or human-agreed standards (use Principle).
5
+ The body and claim are immutable once written. To correct a Finding, write a new Finding with `contradicts` or `supersedes` pointing to the old one. The only permitted edits to an existing Finding are lifecycle frontmatter: `status` (active, contradicted, superseded), `contradicted_by`, and `superseded_by`, appended by review.
6
+ Belongs to the Storage layer. Findings are promoted into Concepts or Structures when they converge and stabilize. They may also support Principles.
7
+
8
+ - [cache_write approximated via fresh_input — matches AIC panel exactly](2026.07.02-23.00-cache-write-approximation.md) — VS Code JSONL logs and agent-traces.db both lack cache_creation token counts. Approximating cache_creation as fresh_input = inputTokens - cachedTokens and billing only the incremental delta (cache_write - input) / 1M produces an exact match to the VS Code AIC panel. Implemented in estimate_cost since v0.3. [Finding]
9
+ - [Subagent Logs Use runSubagent Prefix](2026.07.02-00.00-subagent-logs-runsubagent-prefix.md) — Subagent activity is recorded in separate JSONL files prefixed with "runSubagent-" inside the session debug-logs directory. [Finding]
10
+ - [title-*.jsonl adds 1 LLM call and its tokens to tool totals; VS Code panel excludes it](2026.07.02-22.00-title-generation-not-counted-as-model-turn.md) — The VS Code Agent Debug panel "Model Turns" counter excludes title-generation calls. copilot-session-usage counts them. The delta is exactly the title-*.jsonl file's token counts. [Finding]
@@ -0,0 +1,10 @@
1
+ # Playbook
2
+
3
+ A reproducible, step-by-step workflow or procedure that produces a specific result given the current understanding of the system.
4
+ Use Playbook when documenting "how to do X" — deployment steps, debugging procedures, setup guides. Do NOT use Playbook for one-off observations (use Finding), system architecture (use Structure), or planned deliverables (use Outcome).
5
+ Mutable while active. When a better workflow is found, the old Playbook is marked `status: deprecated` or `superseded` with `superseded_by` pointing to the replacement. Playbooks are experienced until proven false or obsolete.
6
+ Belongs to the Operational layer. References Concepts and Structures for context. May be referenced by Outcomes as execution paths.
7
+
8
+ - [Automation Scripts for Cost Extraction](automation-scripts.md) — Reference Python patterns for extracting and aggregating session costs from Copilot debug logs. [Playbook]
9
+ - [Cost Optimization Patterns](cost-optimization.md) — Common patterns that inflate session costs and strategies to reduce them. [Playbook]
10
+ - [WSL2 Setup Guide](wsl2-setup.md) — Configure copilot-session-usage when running VS Code on Windows with WSL2, including path resolution and troubleshooting. [Playbook]
@@ -0,0 +1,8 @@
1
+ # Concept
2
+
3
+ A stable, well-understood idea that explains "what is this." Concepts are the semantic building blocks of the knowledge base.
4
+ Use Concept when an observation or hypothesis has converged into a durable explanation. Do NOT use Concept for raw observations (use Finding), system composition (use Structure), or human-agreed standards (use Principle).
5
+ Mutable. Concepts are updated to reflect new understanding as Findings accumulate. They are never deleted; if entirely invalidated, they are marked with `status: deprecated` and linked to replacement Concepts.
6
+ Belongs to the Semantic layer. Promoted from confirmed Hypotheses or converged Findings. Supports Structures and Principles.
7
+
8
+ - [Multi-Session Efficiency Analytics — Idea Specification](multi-session-efficiency-analytics.md) — Cross-session analytics that group related VS Code Copilot sessions into coding tasks, score subagent efficiency, and surface trends in cost, latency, and behavior over time. [Concept]
@@ -0,0 +1,17 @@
1
+ ---
2
+ okf_version: "0.1"
3
+ links: []
4
+ backlinks: []
5
+ ---
6
+
7
+ # knowledge
8
+
9
+ - [concepts](./concepts/) — A stable, well-understood idea that explains "what is this." Concepts are the semantic building blocks of the knowled...
10
+ - [experiments](./experiments/) — A reusable, prepared procedure designed to test a Hypothesis and produce empirical Findings. Each execution yields on...
11
+ - [findings](./findings/) — A raw, dated, falsifiable observation recorded by an agent or human at a specific point in time. Findings are the ato...
12
+ - [guides](./guides/) — A reproducible, step-by-step workflow or procedure that produces a specific result given the current understanding of...
13
+ - [ideas](./ideas/) — A stable, well-understood idea that explains "what is this." Concepts are the semantic building blocks of the knowled...
14
+ - [principles](./principles/) — A durable, normative statement agreed upon by humans — "we always…", "never…", "must…". Principles include rules, con...
15
+ - [reference](./reference/) — An external source document — scientific papers, API specifications, lookup tables, or authoritative references — mir...
16
+ - [structures](./structures/) — A description of how an object, system, or artifact is composed and how its parts relate — the "how it works" view.
17
+ U...
@@ -0,0 +1,3 @@
1
+ # Update Log
2
+
3
+ ## 2026-07-06
@@ -0,0 +1,8 @@
1
+ # Principle
2
+
3
+ A durable, normative statement agreed upon by humans — "we always…", "never…", "must…". Principles include rules, conventions, and governance directives.
4
+ Use Principle when establishing a team standard, coding convention, or architectural rule that requires human agreement. Do NOT use Principle for observations (use Finding), explanations (use Concept), or workflows (use Playbook).
5
+ Stable. Changed only through explicit human review. Principles are supported by Findings but are not dictated by them. Superseded Principles retain their record with `superseded_by` linking to the replacement.
6
+ Belongs to the Governance layer. Supported by Findings. May reference Concepts and Structures for context.
7
+
8
+ - [Findings Are Immutable](findings-are-immutable.md) — A recorded Finding's body is never reworded or deleted — only linked. [Principle]
@@ -0,0 +1,9 @@
1
+ # Reference
2
+
3
+ An external source document — scientific papers, API specifications, lookup tables, or authoritative references — mirrored or linked within the knowledge base.
4
+ Use Reference when bringing external information into the knowledge base for easy agent access. Do NOT use Reference for your own observations (use Finding), interpretations (use Concept), or workflows (use Playbook). Personal notes on a paper belong in a Finding or Concept, not in Reference.
5
+ Immutable. References mirror or link to external sources. If the upstream changes, create a new Reference with updated `schema_version` rather than editing the old one.
6
+ Belongs to the Lookup layer. Referenced by Concepts, Structures, Principles, and Findings for authoritative backing.
7
+
8
+ - [Debug Log JSONL Format](debug-log-format.md) — Structure of Copilot debug log events, with focus on fields relevant to cost extraction. [Reference]
9
+ - [Pricing Data Formats](pricing-formats.md) — Schema and format documentation for models-and-pricing.yml, custom-models-pricing.yml, and the internal pricing dict. [Reference]
@@ -7,8 +7,9 @@ tags: [cache-write, anthropic, approximation, cost-estimation, aic]
7
7
  timestamp: 2026-07-03T00:00:00Z
8
8
  related_concepts: [concepts/session-cost-analysis.md]
9
9
  links: [concepts/session-cost-analysis.md,
10
- findings/cache-write-cost-not-tracked.md]
10
+ findings/2026.07.02-23.00-cache-write-approximation.md]
11
11
  backlinks: []
12
+ okf_version: "0.1"
12
13
  ---
13
14
 
14
15
  # Cache Cost Approximation
@@ -63,7 +64,7 @@ Verified on session `438d24a8` (Claude Sonnet 4.6, 92 calls):
63
64
  | VS Code AIC panel (590.37 AIC ÷ 100) | **$5.9037** |
64
65
 
65
66
  Exact match. Supporting Finding:
66
- [`cache-write-cost-not-tracked`](../findings/cache-write-cost-not-tracked.md).
67
+ [`2026.07.02-23.00-cache-write-approximation`](../findings/2026.07.02-23.00-cache-write-approximation.md).
67
68
 
68
69
  ## Accuracy Characteristics
69
70
 
@@ -82,5 +83,5 @@ retired.
82
83
 
83
84
  ## Related
84
85
 
85
- - [`findings/cache-write-cost-not-tracked.md`](../findings/cache-write-cost-not-tracked.md) — Supporting empirical evidence
86
+ - [`findings/2026.07.02-23.00-cache-write-approximation.md`](../findings/2026.07.02-23.00-cache-write-approximation.md) — Supporting empirical evidence
86
87
  - [`concepts/session-cost-analysis.md`](../concepts/session-cost-analysis.md) — Cost analysis overview
@@ -1,6 +1,9 @@
1
1
  # Structure
2
2
 
3
- A description of how an object, system, or artifact is composed and how its parts relate — the "how it works" view. Distinct from a Concept (an idea) and from a Playbook (a procedure to perform).
3
+ A description of how an object, system, or artifact is composed and how its parts relate — the "how it works" view.
4
+ Use Structure when documenting system architecture, component relationships, or mechanical composition. Do NOT use Structure for abstract ideas (use Concept), operational procedures (use Playbook), or human-agreed standards (use Principle).
5
+ Mutable. Updated as the system evolves. Like Concepts, Structures are never deleted; obsolete Structures are marked `status: deprecated` and linked to replacements.
6
+ Belongs to the Semantic layer. Promoted from confirmed Hypotheses or converged Findings. Cross-cuts multiple Concepts.
4
7
 
5
8
  - [Cache Cost Approximation](cache-cost-approximation.md) — How copilot-session-usage approximates Anthropic cache-write costs when VS Code debug logs do not expose cache_creation token counts. [Structure]
6
9
  - [Knowledge Base Information Types](knowledge-base-information-types.md) — The seven OKF information types used in this bundle and how they relate. [Structure]
@@ -5,10 +5,12 @@ description: How subagent costs are logged, aggregated, and correlated with
5
5
  parent sessions.
6
6
  tags: [subagents, cost-aggregation, parallel-agents, runSubagent]
7
7
  timestamp: 2026-06-30T22:00:00Z
8
- links: [findings/title-jsonl-not-counted-as-model-turn.md,
8
+ links: [findings/2026.07.02-00.00-subagent-logs-runsubagent-prefix.md,
9
+ findings/2026.07.02-22.00-title-generation-not-counted-as-model-turn.md,
9
10
  guides/automation-scripts.md, reference/debug-log-format.md]
10
11
  backlinks: [concepts/overview.md, guides/automation-scripts.md,
11
12
  guides/cost-optimization.md, reference/debug-log-format.md]
13
+ okf_version: "0.1"
12
14
  ---
13
15
 
14
16
  # Subagent Cost Tracking
@@ -35,6 +37,7 @@ runSubagent-<agent-name>-functions.runSubagent:<id>.jsonl
35
37
  Example: `runSubagent-default-functions.runSubagent:19.jsonl`
36
38
 
37
39
  The `<id>` is a sequential number assigned per `runSubagent` call in the parent session.
40
+ For details, see Finding [`2026.07.02-00.00-subagent-logs-runsubagent-prefix`](../findings/2026.07.02-00.00-subagent-logs-runsubagent-prefix.md).
38
41
 
39
42
  ## Cost Distribution Pattern
40
43
 
@@ -70,7 +73,7 @@ VS Code debug panel totals also match `main.jsonl` because the panel excludes
70
73
  well — these calls consume real tokens (typically a few hundred input +
71
74
  ~1,000 output from a cheap model) and are intentionally included in the
72
75
  tool's total. See Finding
73
- [`title-jsonl-not-counted-as-model-turn`](../findings/title-jsonl-not-counted-as-model-turn.md).
76
+ [`2026.07.02-22.00-title-generation-not-counted-as-model-turn`](../findings/2026.07.02-22.00-title-generation-not-counted-as-model-turn.md).
74
77
 
75
78
  This is common for:
76
79
 
@@ -80,7 +83,7 @@ This is common for:
80
83
 
81
84
  Example: a session titled *"Get subagent token costs"* that explores how
82
85
  cost tracking works without actually spawning subagents will show 7 files
83
- but only 2 `.jsonl` files, with `main.jsonl` containing all ~8.7M input
86
+ but only 2 `.jsonl` files (main.jsonl and title-*.jsonl), with `main.jsonl` containing all ~8.7M input
84
87
  tokens.
85
88
 
86
89
  ## Mixed-Model Files and Cost Attribution
@@ -115,7 +118,7 @@ total_cost = sum(estimate_cost(**b, model=m, pricing=pricing) for m, b in per_mo
115
118
 
116
119
  ## Correlating Subagents to Tasks
117
120
 
118
- The `child_session_ref` event in `main.jsonl` links the numeric ID to the agent name:
121
+ The `child_session_ref` event in `main.jsonl` links the numeric ID to the agent name and session ID:
119
122
 
120
123
  ```json
121
124
  {
@@ -6,10 +6,11 @@ description: How the VS Code Copilot extension stores session logs and what
6
6
  tags: [vscode, copilot-extension, paths, workspace-storage, cross-platform]
7
7
  timestamp: 2026-07-01T00:00:00Z
8
8
  links: [concepts/copilot-cli.md,
9
- findings/title-jsonl-not-counted-as-model-turn.md,
9
+ findings/2026.07.02-22.00-title-generation-not-counted-as-model-turn.md,
10
10
  reference/debug-log-format.md]
11
11
  backlinks: [concepts/copilot-cli.md, reference/debug-log-format.md,
12
12
  structures/session-discovery-algorithm.md]
13
+ okf_version: "0.1"
13
14
  ---
14
15
 
15
16
  # VS Code Copilot Extension Debug Logs
@@ -83,7 +84,7 @@ When the session ID is unknown, match by:
83
84
  > the `title-<uuid>.jsonl` file from all metrics (calls, tokens, model turns).
84
85
  > `copilot-session-usage` counts it — typically +1 call and a few hundred
85
86
  > input + ~1,000 output tokens per session, billed at the title model's rate.
86
- > See Finding [`title-jsonl-not-counted-as-model-turn`](../findings/title-jsonl-not-counted-as-model-turn.md).
87
+ > See Finding [`2026.07.02-22.00-title-generation-not-counted-as-model-turn`](../findings/2026.07.02-22.00-title-generation-not-counted-as-model-turn.md).
87
88
 
88
89
  ## Related
89
90