Skip to content

Commit ac7aa03

Browse files
author
chenbo
committed
Add_incremental_context_cache
1 parent 7b1f7a7 commit ac7aa03

41 files changed

Lines changed: 3220 additions & 970 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agent-context/AGENTS.generated.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ L0 operating rules. Keep this file loaded by default; load deeper context only w
2121
- Entrypoint: `src/cli/index.ts`
2222
- Entrypoint: `src/mcp/server.ts`
2323
- Anchor: `src/outputs/task-harness.ts` - 5 exports, 67 symbols
24-
- Anchor: `src/core/token-estimator.ts` - 5 exports, 9 symbols
25-
- Anchor: `src/core/context-builder.ts` - 2 exports, 11 symbols
24+
- Anchor: `src/core/token-estimator.ts` - 7 exports, 15 symbols
25+
- Anchor: `src/core/context-builder.ts` - 2 exports, 15 symbols
2626

2727
## Commands
2828
- Run: `npm run dev`

.agent-context/architecture.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ This document is generated from static repository signals. Treat it as a startin
1010

1111
## Important Modules
1212
- `outputs`: outputs contains 20 files and depends on core.
13-
- `test`: test contains 22 files and depends on analyzers, benchmarks, cli, config, core, mcp, outputs, retrievers.
14-
- `core`: core contains 15 files and depends on analyzers, config, llm.
13+
- `core`: core contains 16 files and depends on analyzers, config, llm.
14+
- `test`: test contains 23 files and depends on analyzers, benchmarks, cli, config, core, mcp, outputs, retrievers.
1515
- `retrievers`: retrievers contains 6 files and depends on core, outputs.
1616
- `analyzers`: analyzers contains 6 files and depends on core.
1717
- `benchmarks/fixtures/small-ts-app`: benchmarks/fixtures/small-ts-app contains 9 files.

.agent-context/contracts/architecture.contract.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,33 +116,33 @@
116116
"summary": "outputs contains 20 files and depends on core."
117117
},
118118
{
119-
"name": "test",
119+
"name": "core",
120120
"owns": [
121-
"test/**"
121+
"src/core/**"
122122
],
123123
"imports": [
124124
"analyzers",
125-
"benchmarks",
126-
"cli",
127125
"config",
128-
"core",
129-
"mcp",
130-
"outputs",
131-
"retrievers"
126+
"llm"
132127
],
133-
"summary": "test contains 22 files and depends on analyzers, benchmarks, cli, config, core, mcp, outputs, retrievers."
128+
"summary": "core contains 16 files and depends on analyzers, config, llm."
134129
},
135130
{
136-
"name": "core",
131+
"name": "test",
137132
"owns": [
138-
"src/core/**"
133+
"test/**"
139134
],
140135
"imports": [
141136
"analyzers",
137+
"benchmarks",
138+
"cli",
142139
"config",
143-
"llm"
140+
"core",
141+
"mcp",
142+
"outputs",
143+
"retrievers"
144144
],
145-
"summary": "core contains 15 files and depends on analyzers, config, llm."
145+
"summary": "test contains 23 files and depends on analyzers, benchmarks, cli, config, core, mcp, outputs, retrievers."
146146
},
147147
{
148148
"name": "retrievers",

.agent-context/contracts/module-boundaries.json

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,17 @@
5050
"src/outputs/writer.ts"
5151
]
5252
},
53-
"test": {
53+
"core": {
5454
"owns": [
55-
"test/**"
55+
"src/core/**"
5656
],
5757
"allowedImports": [
58-
"benchmarks/**",
5958
"benchmarks/fixtures/monorepo/packages/config/**",
6059
"benchmarks/fixtures/monorepo/packages/shared/**",
6160
"src/analyzers/**",
62-
"src/cli/**",
6361
"src/config/**",
6462
"src/core/**",
65-
"src/mcp/**",
66-
"src/outputs/**",
67-
"src/retrievers/**",
68-
"test/**"
63+
"src/llm/**"
6964
],
7065
"forbiddenImports": [
7166
"**/*.generated.*",
@@ -79,30 +74,44 @@
7974
],
8075
"observedImports": [
8176
"analyzers",
82-
"benchmarks",
83-
"cli",
8477
"config",
85-
"core",
86-
"mcp",
87-
"outputs",
88-
"retrievers"
78+
"llm"
8979
],
9080
"publicFiles": [
91-
"test/fixtures/python-package/src/app/models.py",
92-
"test/fixtures/python-package/src/app/service.py"
81+
"src/core/cache.ts",
82+
"src/core/context-builder.ts",
83+
"src/core/file-classifier.ts",
84+
"src/core/git.ts",
85+
"src/core/graph.ts",
86+
"src/core/indexer.ts",
87+
"src/core/language.ts",
88+
"src/core/path-utils.ts",
89+
"src/core/ranker.ts",
90+
"src/core/readiness.ts",
91+
"src/core/scanner.ts",
92+
"src/core/summarizer.ts",
93+
"src/core/token-estimator.ts",
94+
"src/core/token-savings.ts",
95+
"src/core/types.ts",
96+
"src/core/validator.ts"
9397
]
9498
},
95-
"core": {
99+
"test": {
96100
"owns": [
97-
"src/core/**"
101+
"test/**"
98102
],
99103
"allowedImports": [
104+
"benchmarks/**",
100105
"benchmarks/fixtures/monorepo/packages/config/**",
101106
"benchmarks/fixtures/monorepo/packages/shared/**",
102107
"src/analyzers/**",
108+
"src/cli/**",
103109
"src/config/**",
104110
"src/core/**",
105-
"src/llm/**"
111+
"src/mcp/**",
112+
"src/outputs/**",
113+
"src/retrievers/**",
114+
"test/**"
106115
],
107116
"forbiddenImports": [
108117
"**/*.generated.*",
@@ -116,25 +125,17 @@
116125
],
117126
"observedImports": [
118127
"analyzers",
128+
"benchmarks",
129+
"cli",
119130
"config",
120-
"llm"
131+
"core",
132+
"mcp",
133+
"outputs",
134+
"retrievers"
121135
],
122136
"publicFiles": [
123-
"src/core/context-builder.ts",
124-
"src/core/file-classifier.ts",
125-
"src/core/git.ts",
126-
"src/core/graph.ts",
127-
"src/core/indexer.ts",
128-
"src/core/language.ts",
129-
"src/core/path-utils.ts",
130-
"src/core/ranker.ts",
131-
"src/core/readiness.ts",
132-
"src/core/scanner.ts",
133-
"src/core/summarizer.ts",
134-
"src/core/token-estimator.ts",
135-
"src/core/token-savings.ts",
136-
"src/core/types.ts",
137-
"src/core/validator.ts"
137+
"test/fixtures/python-package/src/app/models.py",
138+
"test/fixtures/python-package/src/app/service.py"
138139
]
139140
},
140141
"retrievers": {

.agent-context/contracts/test.contract.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"test/agents-md.test.ts",
99
"test/analyzers.test.ts",
1010
"test/benchmark.test.ts",
11+
"test/cache.test.ts",
1112
"test/config.test.ts",
1213
"test/contract-validator.test.ts",
1314
"test/fixtures.test.ts",
@@ -114,8 +115,12 @@
114115
"src/mcp/server.ts": [
115116
"test/mcp.test.ts"
116117
],
118+
"src/core/cache.ts": [
119+
"test/cache.test.ts"
120+
],
117121
"src/core/context-builder.ts": [
118122
"test/agents-md.test.ts",
123+
"test/cache.test.ts",
119124
"test/contract-validator.test.ts",
120125
"test/fixtures.test.ts",
121126
"test/impact.test.ts",

.agent-context/dependency-graph.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ graph TD
6363
| test | benchmarks | 1 |
6464
| test | cli | 1 |
6565
| test | config | 3 |
66-
| test | core | 23 |
66+
| test | core | 24 |
6767
| test | mcp | 1 |
6868
| test | outputs | 11 |
6969
| test | retrievers | 1 |

0 commit comments

Comments
 (0)