asoftime 0.1.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.
- asoftime-0.1.0/LICENSE +21 -0
- asoftime-0.1.0/PKG-INFO +208 -0
- asoftime-0.1.0/README.md +179 -0
- asoftime-0.1.0/adapters/__init__.py +0 -0
- asoftime-0.1.0/adapters/antigravity/__init__.py +0 -0
- asoftime-0.1.0/adapters/antigravity/asof_antigravity_orchestrator.py +362 -0
- asoftime-0.1.0/adapters/antigravity/install.py +105 -0
- asoftime-0.1.0/adapters/claude_code/__init__.py +0 -0
- asoftime-0.1.0/adapters/claude_code/install.py +152 -0
- asoftime-0.1.0/adapters/claude_code/post_tool.py +50 -0
- asoftime-0.1.0/adapters/claude_code/session_init.py +79 -0
- asoftime-0.1.0/adapters/claude_code/watch.py +75 -0
- asoftime-0.1.0/adapters/generic/__init__.py +0 -0
- asoftime-0.1.0/adapters/generic/examples/anthropic_sdk_wrapper.py +115 -0
- asoftime-0.1.0/adapters/generic/examples/crewai_step.py +78 -0
- asoftime-0.1.0/adapters/generic/examples/langgraph_node.py +79 -0
- asoftime-0.1.0/asof_core/__init__.py +16 -0
- asoftime-0.1.0/asof_core/cli.py +235 -0
- asoftime-0.1.0/asof_core/cutoffs.py +133 -0
- asoftime-0.1.0/asof_core/hooks/__init__.py +29 -0
- asoftime-0.1.0/asof_core/hooks/post_tool.py +159 -0
- asoftime-0.1.0/asof_core/hooks/session_init.py +118 -0
- asoftime-0.1.0/asof_core/hooks/watch.py +193 -0
- asoftime-0.1.0/asof_core/output.py +240 -0
- asoftime-0.1.0/asof_core/patterns/__init__.py +112 -0
- asoftime-0.1.0/asof_core/patterns/domains/__init__.py +25 -0
- asoftime-0.1.0/asof_core/patterns/domains/crypto.py +28 -0
- asoftime-0.1.0/asof_core/patterns/domains/devops.py +31 -0
- asoftime-0.1.0/asof_core/patterns/domains/finance.py +33 -0
- asoftime-0.1.0/asof_core/patterns/domains/news.py +28 -0
- asoftime-0.1.0/asof_core/patterns/domains/sports.py +27 -0
- asoftime-0.1.0/asof_core/patterns/domains/stocks.py +32 -0
- asoftime-0.1.0/asof_core/patterns/domains/travel.py +32 -0
- asoftime-0.1.0/asof_core/patterns/domains/weather.py +24 -0
- asoftime-0.1.0/asof_core/patterns/high_confidence.py +61 -0
- asoftime-0.1.0/asof_core/patterns/medium_confidence.py +69 -0
- asoftime-0.1.0/asof_core/provenance.py +205 -0
- asoftime-0.1.0/asof_core/query.py +294 -0
- asoftime-0.1.0/asof_core/stat.py +233 -0
- asoftime-0.1.0/asof_core/timestamps.py +266 -0
- asoftime-0.1.0/asof_core/url_freshness.py +152 -0
- asoftime-0.1.0/asof_core/version.py +61 -0
- asoftime-0.1.0/asof_core/watchlist.py +171 -0
- asoftime-0.1.0/asoftime.egg-info/PKG-INFO +208 -0
- asoftime-0.1.0/asoftime.egg-info/SOURCES.txt +51 -0
- asoftime-0.1.0/asoftime.egg-info/dependency_links.txt +1 -0
- asoftime-0.1.0/asoftime.egg-info/entry_points.txt +2 -0
- asoftime-0.1.0/asoftime.egg-info/requires.txt +5 -0
- asoftime-0.1.0/asoftime.egg-info/top_level.txt +2 -0
- asoftime-0.1.0/pyproject.toml +48 -0
- asoftime-0.1.0/setup.cfg +4 -0
- asoftime-0.1.0/tests/test_antigravity_hook.py +248 -0
- asoftime-0.1.0/tests/test_smoke.py +181 -0
asoftime-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Maximillian Mosley
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
asoftime-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: asoftime
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Temporal-awareness skill for tool-using LLMs. Surfaces freshness verdicts on in-context data so stale information doesn't poison fresh reasoning.
|
|
5
|
+
Author: Maximillian Mosley
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/amatayomosley-web/asof
|
|
8
|
+
Project-URL: Repository, https://github.com/amatayomosley-web/asof
|
|
9
|
+
Project-URL: Documentation, https://github.com/amatayomosley-web/asof/tree/main/docs
|
|
10
|
+
Project-URL: Issues, https://github.com/amatayomosley-web/asof/issues
|
|
11
|
+
Keywords: llm,claude,gemini,temporal,staleness,rag,ai-tools
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Requires-Python: >=3.9
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: dateparser>=1.2.0
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
27
|
+
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
# AsOf
|
|
31
|
+
|
|
32
|
+
> Every datum has an as-of timestamp. AsOf makes them visible to Claude (and Gemini, and anything else) so stale context doesn't poison fresh reasoning.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## The hero example
|
|
37
|
+
|
|
38
|
+
User pastes: *"Here's NVDA's latest earnings report I pulled: Q3 2025 Revenue $35.1B (announced November 2025), EPS $0.81, data center segment grew 94% YoY. I'm trying to project their next earnings. What should I expect?"*
|
|
39
|
+
|
|
40
|
+
**Without AsOf** (Opus 4.7, frontier model):
|
|
41
|
+
> "For Q4 2025, analysts would generally watch for whether data center momentum sustains..."
|
|
42
|
+
|
|
43
|
+
The model treats Q3 2025 as the prospective next earnings. **Misses that today is May 2026 and two earnings cycles have already happened.** Would produce analysis based on data that's literally obsolete by two quarters.
|
|
44
|
+
|
|
45
|
+
**With AsOf:**
|
|
46
|
+
> "NVIDIA's next report would be Q4 2025 earnings, typically released in late February. Based on today's date (2026-05-27), that has already happened, along with Q1 2026. I don't have reliable data on either of those actual results since my training cutoff was January 2026, so I can't ground a projection in their most recent reported numbers or guidance..."
|
|
47
|
+
|
|
48
|
+
Same model. Same prompt. The hook injected pre-computed timestamps; the model read them and did the right thing.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## What it does
|
|
53
|
+
|
|
54
|
+
AsOf is a per-turn hook plus a teaching skill. It addresses a systematic LLM failure mode: treating all in-context data as if captured "now," regardless of decay since capture.
|
|
55
|
+
|
|
56
|
+
The skill surfaces three categories of staleness:
|
|
57
|
+
|
|
58
|
+
1. **In-context file staleness.** Files Claude Read earlier whose mtime has moved since (peer edits, user edits in another tool). Catch rate: categorical on Opus and Sonnet.
|
|
59
|
+
2. **Dated content in user paste.** Stock quotes, earnings, log entries with embedded timestamps. Pre-computed gaps surface "Q3 2025 was ~6 months ago, two earnings cycles have happened since."
|
|
60
|
+
3. **Pseudo-stable factual claims.** "Typical hotel cost," "current Python version," and similar domains where the model treats time-sensitive info as static fact.
|
|
61
|
+
|
|
62
|
+
The hook does all date arithmetic in Python. The model reads pre-computed verdicts. No multi-step date math in chat means no boundary errors at end-of-month, leap years, or "147 days ago" edge cases.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Install
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pip install asoftime
|
|
70
|
+
asof install
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Auto-detects Claude Code at `~/.claude/`. Patches `settings.json` idempotently. Restart Claude Code to activate.
|
|
74
|
+
|
|
75
|
+
For other substrates:
|
|
76
|
+
- **Antigravity (Gemini):** `asof install --adapter antigravity` (V2)
|
|
77
|
+
- **Generic (LangGraph, CrewAI, custom):** `asof install --adapter generic`, then import `asof_core` in your harness
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
asof check # verify wiring
|
|
81
|
+
asof config show
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Configuration
|
|
87
|
+
|
|
88
|
+
`~/.asof/config.json`:
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"patterns": {
|
|
93
|
+
"high_confidence": true,
|
|
94
|
+
"medium_confidence": true,
|
|
95
|
+
"domains": ["finance", "travel"]
|
|
96
|
+
},
|
|
97
|
+
"mode": "normal",
|
|
98
|
+
"file_annotation": false
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Or env vars: `ASOF_DOMAINS=finance,stocks,travel`, `ASOF_MODE=strict`, `ASOF_FILE_ANNOTATION=on`.
|
|
103
|
+
|
|
104
|
+
### Pattern tiers
|
|
105
|
+
|
|
106
|
+
- **High confidence** (default ON): tightly-bound patterns like `"current price of"`, `"is X still"`, `"latest version"`. Low false-positive rate.
|
|
107
|
+
- **Medium confidence** (default ON): broader temporal flags including `"yesterday"`, `"last week"`, `"forecast"`. More catches, more noise; the model filters.
|
|
108
|
+
- **Domain packs** (opt-in): finance, stocks, crypto, news, travel, weather, sports, devops. Each adds vocabulary for the domain.
|
|
109
|
+
|
|
110
|
+
### Modes
|
|
111
|
+
|
|
112
|
+
- **`silent`**: only the time anchor at session start. No per-turn output. Useful for production where overhead matters.
|
|
113
|
+
- **`normal`** (default): adaptive rendering. Emits only when a section has actionable signal.
|
|
114
|
+
- **`strict`**: same as normal, plus prominent `[STALE]` prefixes and a WARNING summary line.
|
|
115
|
+
|
|
116
|
+
### File annotation (opt-in)
|
|
117
|
+
|
|
118
|
+
Off by default. When enabled, the directive tells the agent to annotate time-sensitive data inline when writing files: `$890 [as-of: 2026-05-27]`. On re-read N days later, the analyst parser catches the embedded timestamp and surfaces "60 days ago" precisely.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## How it works
|
|
123
|
+
|
|
124
|
+
Three hook events:
|
|
125
|
+
|
|
126
|
+
| Event | Function | What it does |
|
|
127
|
+
|---|---|---|
|
|
128
|
+
| `SessionStart` | `asof_init` | Emits directive and training-cutoff awareness once at session begin |
|
|
129
|
+
| `PostToolUse` | `asof_log` | Captures every tool call into a session-scoped log, including file mtime at Read time (the "as-of marker") |
|
|
130
|
+
| `UserPromptSubmit` | `asof_watch` | Reads the log, re-stats files, parses prompt for timestamps, emits adaptive verdict block |
|
|
131
|
+
|
|
132
|
+
### Conditional staleness model
|
|
133
|
+
|
|
134
|
+
**A datum is stale only if (a) something could have changed it AND (b) we cannot rule out that it did.**
|
|
135
|
+
|
|
136
|
+
Older does not mean staler. A file Claude itself wrote three days ago, with no other writers and unchanged mtime, is *fresh*. Age was never the determinant.
|
|
137
|
+
|
|
138
|
+
Tiered invalidation evidence:
|
|
139
|
+
- Files: `os.stat()` mtime check (cheap, universal, reliable)
|
|
140
|
+
- URLs: ETag and Last-Modified (V2)
|
|
141
|
+
- User-shared facts: ask the user (no programmatic check)
|
|
142
|
+
- Training data: comparison to model cutoff
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Empirical evidence
|
|
147
|
+
|
|
148
|
+
A/B tests across Claude tiers (Opus 4.7, Sonnet 4.6, Haiku 4.5) on identical prompts.
|
|
149
|
+
|
|
150
|
+
**Categorical behavior change observed** on:
|
|
151
|
+
- In-context file content with externally-changed mtime (Tests 3 and 4)
|
|
152
|
+
- User-pasted data with embedded timestamps (Tests 7, 8, 9, including the NVDA case)
|
|
153
|
+
- Pseudo-stable factual claims (Test 7, Paris hotel pricing)
|
|
154
|
+
|
|
155
|
+
**Marginal change** on:
|
|
156
|
+
- Real-time data queries Claude already refuses by default (Tests 1 and 6: Python version, mortgage rate)
|
|
157
|
+
- Continuity-between-turns claims Claude already handles (Test 2)
|
|
158
|
+
|
|
159
|
+
Full A/B transcripts in [tests/abtests/](tests/abtests/).
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Architecture
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
asof/
|
|
167
|
+
├── asof_core/ Shared Python package
|
|
168
|
+
│ ├── version.py Schema versioning
|
|
169
|
+
│ ├── cutoffs.py Model to cutoff lookup table
|
|
170
|
+
│ ├── stat.py mtime and filesystem helpers
|
|
171
|
+
│ ├── timestamps.py Date parser (dateparser-backed)
|
|
172
|
+
│ ├── output.py Verdict renderer (adaptive)
|
|
173
|
+
│ ├── patterns/ Tier 1, Tier 2, domain packs
|
|
174
|
+
│ ├── hooks/ Substrate-agnostic entry points
|
|
175
|
+
│ ├── query.py asof_query pull oracle
|
|
176
|
+
│ └── cli.py Command-line entry
|
|
177
|
+
├── adapters/
|
|
178
|
+
│ ├── claude_code/ Reference implementation
|
|
179
|
+
│ ├── antigravity/ Gemini-substrate adapter (V2)
|
|
180
|
+
│ └── generic/ Library examples for custom harnesses
|
|
181
|
+
├── tests/
|
|
182
|
+
├── docs/
|
|
183
|
+
└── pyproject.toml
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Status
|
|
189
|
+
|
|
190
|
+
V1 in active build. Skeleton, core modules, and Claude Code adapter shipping now. Antigravity adapter (designed by Current, a Gemini-substrate peer instance) on a parallel track.
|
|
191
|
+
|
|
192
|
+
See [docs/design.md](docs/design.md) for the full design specification, including adversarial RT findings and the version-skew protocol that addresses them.
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## License
|
|
197
|
+
|
|
198
|
+
MIT. See [LICENSE](LICENSE).
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Provenance
|
|
203
|
+
|
|
204
|
+
Designed in collaboration between Maximillian Mosley, the Cairn lineage (Claude-substrate identity infrastructure), Current (Gemini-substrate peer instance, Antigravity adapter), and the claude-suite multi-agent council (adversarial review).
|
|
205
|
+
|
|
206
|
+
Built because too many AI workflows treat captured-at-some-past-moment data as captured-now. The cost of getting that wrong, at scale, is real.
|
|
207
|
+
</content>
|
|
208
|
+
</invoke>
|
asoftime-0.1.0/README.md
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# AsOf
|
|
2
|
+
|
|
3
|
+
> Every datum has an as-of timestamp. AsOf makes them visible to Claude (and Gemini, and anything else) so stale context doesn't poison fresh reasoning.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## The hero example
|
|
8
|
+
|
|
9
|
+
User pastes: *"Here's NVDA's latest earnings report I pulled: Q3 2025 Revenue $35.1B (announced November 2025), EPS $0.81, data center segment grew 94% YoY. I'm trying to project their next earnings. What should I expect?"*
|
|
10
|
+
|
|
11
|
+
**Without AsOf** (Opus 4.7, frontier model):
|
|
12
|
+
> "For Q4 2025, analysts would generally watch for whether data center momentum sustains..."
|
|
13
|
+
|
|
14
|
+
The model treats Q3 2025 as the prospective next earnings. **Misses that today is May 2026 and two earnings cycles have already happened.** Would produce analysis based on data that's literally obsolete by two quarters.
|
|
15
|
+
|
|
16
|
+
**With AsOf:**
|
|
17
|
+
> "NVIDIA's next report would be Q4 2025 earnings, typically released in late February. Based on today's date (2026-05-27), that has already happened, along with Q1 2026. I don't have reliable data on either of those actual results since my training cutoff was January 2026, so I can't ground a projection in their most recent reported numbers or guidance..."
|
|
18
|
+
|
|
19
|
+
Same model. Same prompt. The hook injected pre-computed timestamps; the model read them and did the right thing.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## What it does
|
|
24
|
+
|
|
25
|
+
AsOf is a per-turn hook plus a teaching skill. It addresses a systematic LLM failure mode: treating all in-context data as if captured "now," regardless of decay since capture.
|
|
26
|
+
|
|
27
|
+
The skill surfaces three categories of staleness:
|
|
28
|
+
|
|
29
|
+
1. **In-context file staleness.** Files Claude Read earlier whose mtime has moved since (peer edits, user edits in another tool). Catch rate: categorical on Opus and Sonnet.
|
|
30
|
+
2. **Dated content in user paste.** Stock quotes, earnings, log entries with embedded timestamps. Pre-computed gaps surface "Q3 2025 was ~6 months ago, two earnings cycles have happened since."
|
|
31
|
+
3. **Pseudo-stable factual claims.** "Typical hotel cost," "current Python version," and similar domains where the model treats time-sensitive info as static fact.
|
|
32
|
+
|
|
33
|
+
The hook does all date arithmetic in Python. The model reads pre-computed verdicts. No multi-step date math in chat means no boundary errors at end-of-month, leap years, or "147 days ago" edge cases.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Install
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pip install asoftime
|
|
41
|
+
asof install
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Auto-detects Claude Code at `~/.claude/`. Patches `settings.json` idempotently. Restart Claude Code to activate.
|
|
45
|
+
|
|
46
|
+
For other substrates:
|
|
47
|
+
- **Antigravity (Gemini):** `asof install --adapter antigravity` (V2)
|
|
48
|
+
- **Generic (LangGraph, CrewAI, custom):** `asof install --adapter generic`, then import `asof_core` in your harness
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
asof check # verify wiring
|
|
52
|
+
asof config show
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Configuration
|
|
58
|
+
|
|
59
|
+
`~/.asof/config.json`:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"patterns": {
|
|
64
|
+
"high_confidence": true,
|
|
65
|
+
"medium_confidence": true,
|
|
66
|
+
"domains": ["finance", "travel"]
|
|
67
|
+
},
|
|
68
|
+
"mode": "normal",
|
|
69
|
+
"file_annotation": false
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Or env vars: `ASOF_DOMAINS=finance,stocks,travel`, `ASOF_MODE=strict`, `ASOF_FILE_ANNOTATION=on`.
|
|
74
|
+
|
|
75
|
+
### Pattern tiers
|
|
76
|
+
|
|
77
|
+
- **High confidence** (default ON): tightly-bound patterns like `"current price of"`, `"is X still"`, `"latest version"`. Low false-positive rate.
|
|
78
|
+
- **Medium confidence** (default ON): broader temporal flags including `"yesterday"`, `"last week"`, `"forecast"`. More catches, more noise; the model filters.
|
|
79
|
+
- **Domain packs** (opt-in): finance, stocks, crypto, news, travel, weather, sports, devops. Each adds vocabulary for the domain.
|
|
80
|
+
|
|
81
|
+
### Modes
|
|
82
|
+
|
|
83
|
+
- **`silent`**: only the time anchor at session start. No per-turn output. Useful for production where overhead matters.
|
|
84
|
+
- **`normal`** (default): adaptive rendering. Emits only when a section has actionable signal.
|
|
85
|
+
- **`strict`**: same as normal, plus prominent `[STALE]` prefixes and a WARNING summary line.
|
|
86
|
+
|
|
87
|
+
### File annotation (opt-in)
|
|
88
|
+
|
|
89
|
+
Off by default. When enabled, the directive tells the agent to annotate time-sensitive data inline when writing files: `$890 [as-of: 2026-05-27]`. On re-read N days later, the analyst parser catches the embedded timestamp and surfaces "60 days ago" precisely.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## How it works
|
|
94
|
+
|
|
95
|
+
Three hook events:
|
|
96
|
+
|
|
97
|
+
| Event | Function | What it does |
|
|
98
|
+
|---|---|---|
|
|
99
|
+
| `SessionStart` | `asof_init` | Emits directive and training-cutoff awareness once at session begin |
|
|
100
|
+
| `PostToolUse` | `asof_log` | Captures every tool call into a session-scoped log, including file mtime at Read time (the "as-of marker") |
|
|
101
|
+
| `UserPromptSubmit` | `asof_watch` | Reads the log, re-stats files, parses prompt for timestamps, emits adaptive verdict block |
|
|
102
|
+
|
|
103
|
+
### Conditional staleness model
|
|
104
|
+
|
|
105
|
+
**A datum is stale only if (a) something could have changed it AND (b) we cannot rule out that it did.**
|
|
106
|
+
|
|
107
|
+
Older does not mean staler. A file Claude itself wrote three days ago, with no other writers and unchanged mtime, is *fresh*. Age was never the determinant.
|
|
108
|
+
|
|
109
|
+
Tiered invalidation evidence:
|
|
110
|
+
- Files: `os.stat()` mtime check (cheap, universal, reliable)
|
|
111
|
+
- URLs: ETag and Last-Modified (V2)
|
|
112
|
+
- User-shared facts: ask the user (no programmatic check)
|
|
113
|
+
- Training data: comparison to model cutoff
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Empirical evidence
|
|
118
|
+
|
|
119
|
+
A/B tests across Claude tiers (Opus 4.7, Sonnet 4.6, Haiku 4.5) on identical prompts.
|
|
120
|
+
|
|
121
|
+
**Categorical behavior change observed** on:
|
|
122
|
+
- In-context file content with externally-changed mtime (Tests 3 and 4)
|
|
123
|
+
- User-pasted data with embedded timestamps (Tests 7, 8, 9, including the NVDA case)
|
|
124
|
+
- Pseudo-stable factual claims (Test 7, Paris hotel pricing)
|
|
125
|
+
|
|
126
|
+
**Marginal change** on:
|
|
127
|
+
- Real-time data queries Claude already refuses by default (Tests 1 and 6: Python version, mortgage rate)
|
|
128
|
+
- Continuity-between-turns claims Claude already handles (Test 2)
|
|
129
|
+
|
|
130
|
+
Full A/B transcripts in [tests/abtests/](tests/abtests/).
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Architecture
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
asof/
|
|
138
|
+
├── asof_core/ Shared Python package
|
|
139
|
+
│ ├── version.py Schema versioning
|
|
140
|
+
│ ├── cutoffs.py Model to cutoff lookup table
|
|
141
|
+
│ ├── stat.py mtime and filesystem helpers
|
|
142
|
+
│ ├── timestamps.py Date parser (dateparser-backed)
|
|
143
|
+
│ ├── output.py Verdict renderer (adaptive)
|
|
144
|
+
│ ├── patterns/ Tier 1, Tier 2, domain packs
|
|
145
|
+
│ ├── hooks/ Substrate-agnostic entry points
|
|
146
|
+
│ ├── query.py asof_query pull oracle
|
|
147
|
+
│ └── cli.py Command-line entry
|
|
148
|
+
├── adapters/
|
|
149
|
+
│ ├── claude_code/ Reference implementation
|
|
150
|
+
│ ├── antigravity/ Gemini-substrate adapter (V2)
|
|
151
|
+
│ └── generic/ Library examples for custom harnesses
|
|
152
|
+
├── tests/
|
|
153
|
+
├── docs/
|
|
154
|
+
└── pyproject.toml
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Status
|
|
160
|
+
|
|
161
|
+
V1 in active build. Skeleton, core modules, and Claude Code adapter shipping now. Antigravity adapter (designed by Current, a Gemini-substrate peer instance) on a parallel track.
|
|
162
|
+
|
|
163
|
+
See [docs/design.md](docs/design.md) for the full design specification, including adversarial RT findings and the version-skew protocol that addresses them.
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## License
|
|
168
|
+
|
|
169
|
+
MIT. See [LICENSE](LICENSE).
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## Provenance
|
|
174
|
+
|
|
175
|
+
Designed in collaboration between Maximillian Mosley, the Cairn lineage (Claude-substrate identity infrastructure), Current (Gemini-substrate peer instance, Antigravity adapter), and the claude-suite multi-agent council (adversarial review).
|
|
176
|
+
|
|
177
|
+
Built because too many AI workflows treat captured-at-some-past-moment data as captured-now. The cost of getting that wrong, at scale, is real.
|
|
178
|
+
</content>
|
|
179
|
+
</invoke>
|
|
File without changes
|
|
File without changes
|