fkf 5.0.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.
- fkf-5.0.0/LICENSE +21 -0
- fkf-5.0.0/PKG-INFO +210 -0
- fkf-5.0.0/README.md +183 -0
- fkf-5.0.0/THIRD_PARTY_NOTICES.md +2187 -0
- fkf-5.0.0/pyproject.toml +139 -0
- fkf-5.0.0/pyproject.toml.orig +122 -0
- fkf-5.0.0/src/fkf/__init__.py +22 -0
- fkf-5.0.0/src/fkf/__main__.py +6 -0
- fkf-5.0.0/src/fkf/assets.py +117 -0
- fkf-5.0.0/src/fkf/assets_data/demo/fkf-demo-json.sh +20 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/agent-memory-body.py +117 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/agent-memory-files.py +225 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/agent-prompt-body.py +205 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/agent-prompts.py +295 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/agent-session-trace.py +507 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/agent-sessions.py +543 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/atuin-history-json.py +186 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/chrome-bookmarks.py +166 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/chromium-pages.py +336 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/fkf-hook.py +248 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/gcloud-audit-json.py +134 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/gcloud-auth-ready.sh +10 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/gcloud-projects-json.sh +22 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/gh-runs.py +243 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/git-log-json.py +303 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/github-commits-json.py +201 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/github-events-json.py +190 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/github-generic-list-json.py +82 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/github-gists-json.sh +23 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/github-list-json.py +208 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/github-reviews-json.py +240 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/github-search-json.py +307 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/github-stars-json.sh +25 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/gmail-body.py +148 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/gmail-json.py +178 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/gws-calendar-body.py +69 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/gws-calendars-json.py +265 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/gws-chat-message-body.py +58 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/gws-chat-messages.py +182 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/gws-doc-text.sh +20 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/gws-meeting-notes-json.py +282 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/gws-page-json.py +226 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/gws-tasks.py +181 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/huggingface-repositories-json.py +84 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/jira-issues-json.py +144 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/kaggle-competitions-json.sh +16 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/kaggle-datasets-json.sh +17 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/kaggle-json.py +126 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/kaggle-kernels-json.py +141 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/kaggle-models-json.py +120 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/mise-tools-json.sh +16 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/repository-facts.py +244 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/rss-json.py +619 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/writing-index.py +285 -0
- fkf-5.0.0/src/fkf/assets_data/presets/bin/writing-source-json.sh +11 -0
- fkf-5.0.0/src/fkf/assets_data/presets/evals/queries.yaml +20 -0
- fkf-5.0.0/src/fkf/assets_data/presets/minimal.yaml +17 -0
- fkf-5.0.0/src/fkf/assets_data/presets/personal.yaml +923 -0
- fkf-5.0.0/src/fkf/assets_data/presets/team.yaml +121 -0
- fkf-5.0.0/src/fkf/assets_data/skills/daily-brief/SKILL.md +41 -0
- fkf-5.0.0/src/fkf/assets_data/skills/fkf-learn/SKILL.md +97 -0
- fkf-5.0.0/src/fkf/assets_data/skills/fkf-learn/references/skill-evolution.md +15 -0
- fkf-5.0.0/src/fkf/assets_data/skills/fkf-use/SKILL.md +82 -0
- fkf-5.0.0/src/fkf/assets_data/skills/fkf-use/references/retrieval-feedback.md +22 -0
- fkf-5.0.0/src/fkf/assets_data/skills/fkf-use/references/source-and-graph.md +57 -0
- fkf-5.0.0/src/fkf/auth.py +62 -0
- fkf-5.0.0/src/fkf/base.py +204 -0
- fkf-5.0.0/src/fkf/bodies.py +794 -0
- fkf-5.0.0/src/fkf/build.py +273 -0
- fkf-5.0.0/src/fkf/cli.py +96 -0
- fkf-5.0.0/src/fkf/cli_ask.py +417 -0
- fkf-5.0.0/src/fkf/cli_browse.py +372 -0
- fkf-5.0.0/src/fkf/cli_integrate.py +225 -0
- fkf-5.0.0/src/fkf/cli_learn.py +189 -0
- fkf-5.0.0/src/fkf/cli_mcp.py +97 -0
- fkf-5.0.0/src/fkf/cli_operate.py +420 -0
- fkf-5.0.0/src/fkf/cli_setup.py +148 -0
- fkf-5.0.0/src/fkf/cli_support.py +258 -0
- fkf-5.0.0/src/fkf/cli_temporal.py +183 -0
- fkf-5.0.0/src/fkf/collection.py +84 -0
- fkf-5.0.0/src/fkf/config.py +1114 -0
- fkf-5.0.0/src/fkf/config_view.py +171 -0
- fkf-5.0.0/src/fkf/context.py +2620 -0
- fkf-5.0.0/src/fkf/day.py +1357 -0
- fkf-5.0.0/src/fkf/documents.py +910 -0
- fkf-5.0.0/src/fkf/errors.py +91 -0
- fkf-5.0.0/src/fkf/eval.py +381 -0
- fkf-5.0.0/src/fkf/fields.py +775 -0
- fkf-5.0.0/src/fkf/find.py +1000 -0
- fkf-5.0.0/src/fkf/graph.py +2393 -0
- fkf-5.0.0/src/fkf/harness.py +1091 -0
- fkf-5.0.0/src/fkf/helpers.py +173 -0
- fkf-5.0.0/src/fkf/init.py +1437 -0
- fkf-5.0.0/src/fkf/io.py +109 -0
- fkf-5.0.0/src/fkf/jsoncodec.py +247 -0
- fkf-5.0.0/src/fkf/learn.py +1113 -0
- fkf-5.0.0/src/fkf/learned.py +166 -0
- fkf-5.0.0/src/fkf/lexical.py +3452 -0
- fkf-5.0.0/src/fkf/listings.py +259 -0
- fkf-5.0.0/src/fkf/locking.py +335 -0
- fkf-5.0.0/src/fkf/logging_config.py +64 -0
- fkf-5.0.0/src/fkf/markdown.py +731 -0
- fkf-5.0.0/src/fkf/marked_block.py +132 -0
- fkf-5.0.0/src/fkf/mcp_paging.py +294 -0
- fkf-5.0.0/src/fkf/mcp_server.py +1334 -0
- fkf-5.0.0/src/fkf/new.py +253 -0
- fkf-5.0.0/src/fkf/output.py +127 -0
- fkf-5.0.0/src/fkf/pages.py +349 -0
- fkf-5.0.0/src/fkf/process.py +620 -0
- fkf-5.0.0/src/fkf/py.typed +0 -0
- fkf-5.0.0/src/fkf/query.py +234 -0
- fkf-5.0.0/src/fkf/read.py +484 -0
- fkf-5.0.0/src/fkf/scan.py +21 -0
- fkf-5.0.0/src/fkf/schedule.py +515 -0
- fkf-5.0.0/src/fkf/schema.py +494 -0
- fkf-5.0.0/src/fkf/selector.py +171 -0
- fkf-5.0.0/src/fkf/source_runtime.py +411 -0
- fkf-5.0.0/src/fkf/source_tests.py +142 -0
- fkf-5.0.0/src/fkf/status.py +1335 -0
- fkf-5.0.0/src/fkf/store.py +496 -0
- fkf-5.0.0/src/fkf/sync.py +1063 -0
- fkf-5.0.0/src/fkf/timeutil.py +305 -0
- fkf-5.0.0/src/fkf/trust.py +574 -0
- fkf-5.0.0/src/fkf/trust_service.py +237 -0
- fkf-5.0.0/src/fkf/uri.py +355 -0
- fkf-5.0.0/src/fkf/validation.py +487 -0
- fkf-5.0.0/src/fkf/verify.py +65 -0
- fkf-5.0.0/src/fkf/wiki_index.py +167 -0
fkf-5.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Médéric Hurier (Fmind)
|
|
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.
|
fkf-5.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fkf
|
|
3
|
+
Version: 5.0.0
|
|
4
|
+
Summary: Local, offline evidence retrieval for coding agents
|
|
5
|
+
Keywords: agents,knowledge,mcp,retrieval
|
|
6
|
+
Author: Médéric Hurier
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
License-File: THIRD_PARTY_NOTICES.md
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Operating System :: MacOS
|
|
13
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Classifier: Typing :: Typed
|
|
17
|
+
Requires-Dist: markdown-it-py>=4.2.0,<5
|
|
18
|
+
Requires-Dist: mcp>=2.1.1,<3
|
|
19
|
+
Requires-Dist: pydantic>=2.13.5,<3
|
|
20
|
+
Requires-Dist: pyyaml>=6.0.3,<7
|
|
21
|
+
Requires-Dist: typer>=0.27.2,<1
|
|
22
|
+
Requires-Python: >=3.14
|
|
23
|
+
Project-URL: Documentation, https://fmind.github.io/fkf/
|
|
24
|
+
Project-URL: Issues, https://github.com/fmind/fkf/issues
|
|
25
|
+
Project-URL: Repository, https://github.com/fmind/fkf
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
# fkf — Fmind Knowledge Framework
|
|
29
|
+
|
|
30
|
+
[](https://github.com/fmind/fkf/actions/workflows/ci.yml) [](https://github.com/fmind/fkf/releases/latest) [](https://www.python.org/) [](LICENSE)
|
|
31
|
+
|
|
32
|
+
**Your coding agent knows your repository. It does not know the meeting that set the constraint, the review that rejected the approach, or the ticket that explains why the code looks like that.**
|
|
33
|
+
|
|
34
|
+
`fkf` collects that work history into a git repository you own — plain JSON and Markdown, gathered by the provider CLIs you already trust — and hands your agent a small, budgeted, reproducible slice of it on demand.
|
|
35
|
+
|
|
36
|
+
One command. No account, daemon, database, or telemetry. Stored reads are offline.
|
|
37
|
+
|
|
38
|
+
## See it in 30 seconds
|
|
39
|
+
|
|
40
|
+
No credentials, no network, no configuration:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
fkf init ~/demo --demo 30
|
|
44
|
+
fkf --format text context "retrieval boundary" --budget 1024 --explain --base ~/demo
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The demo base is synthetic, but it is a real base: 30 days of events across six sources, a wiki, project pages, and a graph. This abridged result shortens URIs, fields, and receipt values:
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
350 wiki wiki/retrieval-boundary.md Retrieval boundary · tags=decision,retrieval
|
|
51
|
+
why=exact-identifier:+100(retrieval boundary),term:+100(retrieval …),exact-phrase:+50
|
|
52
|
+
182 record events/…/git-commits.json#… Design retrieval boundary (LG-77)
|
|
53
|
+
182 record events/…/google-calendar-events.json#… Document retrieval boundary (GW-1203)
|
|
54
|
+
182 record events/…/google-gmail-emails.json#… Fix retrieval boundary (FK-412)
|
|
55
|
+
182 record events/…/jira-issues.json#FK-418-4 Revert retrieval boundary (FK-418)
|
|
56
|
+
... 3 more selected items ...
|
|
57
|
+
80 wiki wiki/index.md Wiki · navigation-page:-50(curated navigation ranks below concept pages)
|
|
58
|
+
receipt pack for "retrieval boundary" · 9/736 selected · <1024 text tokens · floor 10
|
|
59
|
+
window <30 days> · as_of <today> · digest <hex> · ranking v7 · dropped 717
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
One decision, scattered across a commit, a calendar invite, an email, and a Jira issue, pulled back together under a token budget.
|
|
63
|
+
|
|
64
|
+
Three things make that pack usable by an agent rather than merely interesting:
|
|
65
|
+
|
|
66
|
+
1. **It fits.** You set the budget; `context` selects the strongest evidence and stops. No pack silently blows past the window.
|
|
67
|
+
1. **It explains itself.** Every line carries the score and the reason it was chosen — and the receipt records what was dropped, so a wrong answer is debuggable instead of mysterious.
|
|
68
|
+
1. **It is reproducible.** Ranking is deterministic, and indexed and fallback reads return the same semantic answer. The receipt records the effective inputs, semantic digest, selection boundaries, and execution path. There are no embeddings or model calls in the read path.
|
|
69
|
+
|
|
70
|
+
Then look around the base with `fkf find`, `fkf graph repo:github.com/fmind/fkf --in`, and `fkf list projects --status active`. Delete `~/demo` when you are done.
|
|
71
|
+
|
|
72
|
+
## Install
|
|
73
|
+
|
|
74
|
+
FKF is a Python 3.14 package. Install its stable `fkf` launcher with [uv](https://docs.astral.sh/uv/):
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
uv tool install fkf
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Use `uvx fkf ...` for a one-shot command without a persistent installation. Harness and schedule integration intentionally require a stable installed launcher because their configuration must keep working after the invoking process exits.
|
|
81
|
+
|
|
82
|
+
Upgrade an installed tool through the package manager:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
uv tool upgrade fkf
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Wheel and source distributions are published to PyPI and attached to the [matching GitHub release](https://github.com/fmind/fkf/releases/latest) with build-provenance attestations.
|
|
89
|
+
|
|
90
|
+
FKF supports Linux and macOS. WSL2 works when the base stays on its Linux filesystem; native Windows is out of scope because cancellation uses POSIX process groups.
|
|
91
|
+
|
|
92
|
+
<details>
|
|
93
|
+
<summary>Install from source</summary>
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
mise trust -y
|
|
97
|
+
mise install --locked
|
|
98
|
+
mise run install
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
To exercise the checkout without installing its launcher, run commands as `uv run fkf ...`.
|
|
102
|
+
|
|
103
|
+
</details>
|
|
104
|
+
|
|
105
|
+
## Connect your own work
|
|
106
|
+
|
|
107
|
+
Start with one real source. The personal preset ships a reviewed GitHub Search helper — it needs `python3` and `gh` on your `PATH`, and `gh` owns the login:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
gh auth status
|
|
111
|
+
fkf init ~/brain --preset personal
|
|
112
|
+
$EDITOR ~/brain/fkf.yaml # sources.github-pull-requests.enabled: true
|
|
113
|
+
fkf config helpers --refresh --base ~/brain
|
|
114
|
+
fkf trust --all --base ~/brain
|
|
115
|
+
fkf status --base ~/brain # confirms every requirement is on PATH
|
|
116
|
+
fkf sync github-pull-requests --days 30 --base ~/brain
|
|
117
|
+
fkf context "repo:github.com/OWNER/REPOSITORY" --since 30d --explain --base ~/brain
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Set `FKF_BASE=~/brain`, or run from inside the base, to drop `--base`.
|
|
121
|
+
|
|
122
|
+
`fkf init` creates the five layers, `fkf.yaml`, managed git rules, the helpers your enabled sources need under `bin/`, and three agent skills under `.agents/skills/`. It contacts no provider and asks for no token. Browser, mail, and shell-history sources stay disabled until you turn them on.
|
|
123
|
+
|
|
124
|
+
From there, `fkf sync` is safe to re-run: existing event documents are skipped, due index snapshots refresh, the graph follows document writes, and the lexical cache rebuilds only when searchable bytes change. `fkf brief` gives you the daily loop — yesterday's digest, today's calendar, assigned work, failing CI, stale or login-blocked sources.
|
|
125
|
+
|
|
126
|
+
## The model
|
|
127
|
+
|
|
128
|
+
Four ideas cover most of FKF.
|
|
129
|
+
|
|
130
|
+
**A base is a folder.** One git repository, five readable layers. `ls`, `rg`, and `jq` still work.
|
|
131
|
+
|
|
132
|
+
```text
|
|
133
|
+
events/YYYY-MM-DD/ one complete JSON document per event source
|
|
134
|
+
index/ current point-in-time source documents
|
|
135
|
+
tasks/ authored execution evidence and learned items
|
|
136
|
+
projects/ active, paused, or completed efforts
|
|
137
|
+
wiki/ reusable decisions, patterns, tools, and insights
|
|
138
|
+
graph.tsv rebuildable relation cache at the base root
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**A source is a command.** A source runs a reviewed command that prints one JSON document, and the named CLI owns its login. Adding GitHub, Google Workspace, Jira, or a local database needs no framework adapter — just YAML and, when the glue gets real, a small reviewed helper under the base's `bin/`:
|
|
142
|
+
|
|
143
|
+
```yaml
|
|
144
|
+
sources:
|
|
145
|
+
github-pull-requests:
|
|
146
|
+
enabled: true
|
|
147
|
+
layer: events
|
|
148
|
+
requires: [github-search-json.py, python3, gh]
|
|
149
|
+
window: true
|
|
150
|
+
run: [github-search-json.py, prs, assignee, "{{start}}", "{{end}}"]
|
|
151
|
+
fields:
|
|
152
|
+
id: .url
|
|
153
|
+
time: .updatedAt
|
|
154
|
+
title: .title
|
|
155
|
+
repo: .repository.nameWithOwner
|
|
156
|
+
repository: .repository_uri # relation: builds a graph edge
|
|
157
|
+
owner: [".assignee_uris[]"]
|
|
158
|
+
body: [gh, pr, view, "{{id}}", --repo, "{{repo}}", --json, "body,comments"]
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**Relations are explicit URIs.** Records and pages link to file URIs or to entities such as `repo:github.com/fmind/fkf`. `graph.tsv` is built from declared relation fields and authored links — FKF never guesses a relationship from prose.
|
|
162
|
+
|
|
163
|
+
**Retrieval is bounded and reproducible.** `find` returns every lexical match; `context` selects under a budget and explains itself. By default, records are stored as metadata plus a link and bodies stay at the provider. The opt-in `cache` and `sync` body policies keep ignored, manifest-verified local copies after an explicit read or evidence sync.
|
|
164
|
+
|
|
165
|
+
Full detail: [sources](https://fmind.github.io/fkf/docs/sources/), [URIs and the graph](https://fmind.github.io/fkf/docs/uris-graph/), [context packs](https://fmind.github.io/fkf/docs/context/), [configuration schema](https://fmind.github.io/fkf/docs/schema/).
|
|
166
|
+
|
|
167
|
+
## Use it from your coding agent
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
fkf harness install --all --dry-run --base ~/brain
|
|
171
|
+
fkf harness install --all --base ~/brain
|
|
172
|
+
fkf harness install claude codex gemini kiro --workspace ~/fmind --base ~/brain
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
The first command shows exactly what FKF would manage. The second registers read-only MCP under the base-scoped key `fkf-<name>` in all ten adapters. The third opts the four adapters with verified passive output into automatic context for one physical workspace. FKF does not create global links to a base's skills. If you manage client configuration yourself, the primitive is `fkf mcp serve --base ~/brain`.
|
|
176
|
+
|
|
177
|
+
The MCP server is read-only and bounded: `context`, `find`, `day`, `timeline`, `list`, `read`, and `graph`. It cannot write, run a shell, or fetch bodies. The agent asks for a pack when it needs one. Ordinary lookups use `context` and a cited `read`; configuration inspection and task traces belong to setup or meaningful work. The bundled `fkf-use`, `fkf-learn`, and `daily-brief` skills teach it how. See the [harness guide](https://fmind.github.io/fkf/docs/harnesses/).
|
|
178
|
+
|
|
179
|
+
## Trust and privacy
|
|
180
|
+
|
|
181
|
+
- **FKF reads no credential** and expands no secret environment variable. Provider credentials stay with the provider CLI.
|
|
182
|
+
- **Collected content is untrusted data** — evidence, never instructions. A stored value never becomes shell syntax or an executable name.
|
|
183
|
+
- **`fkf trust` hashes the executable plan**: the effective `auth:`, `run:`, `test:`, and `body:` argv plus every file under the base's `bin/` and `tests/`. A meaningful change requires review again. It detects change; it is not a sandbox.
|
|
184
|
+
- **Stored reads are offline, including `brief`.** `read --body` is the explicit read-time fetch; `sync` may prefetch bodies under the opt-in `bodies: sync` policy. Explicit `status --live` runs only bounded trusted `auth:` probes.
|
|
185
|
+
- **FKF encrypts nothing and provides no backup.** Protect the disk and the remote. Whether event and index documents enter git history is your choice at `init`, recorded in `.gitignore`.
|
|
186
|
+
|
|
187
|
+
Details and the full threat boundary: [privacy and trust](https://fmind.github.io/fkf/docs/privacy/).
|
|
188
|
+
|
|
189
|
+
## Scope
|
|
190
|
+
|
|
191
|
+
FKF is intentionally small. Do not use it if you need semantic search, a dashboard, a hosted service, native Windows, or a local cache your organization's data policy forbids. Your editor, shell, and coding agent remain the interface.
|
|
192
|
+
|
|
193
|
+
Configuration and stored documents each carry `fkf: 1`. Evidence-envelope additions stay compatible within that marker, so old evidence stays readable without re-fetching provider history.
|
|
194
|
+
|
|
195
|
+
## Development
|
|
196
|
+
|
|
197
|
+
Start with [CONTRIBUTING.md](CONTRIBUTING.md), [AGENTS.md](AGENTS.md), and the [Code of Conduct](CODE_OF_CONDUCT.md). Report vulnerabilities through a [private security advisory](https://github.com/fmind/fkf/security/advisories/new), never a public issue — see [SECURITY.md](SECURITY.md).
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
mise run all # format, check, branch-coverage tests, and package build
|
|
201
|
+
mise run coverage # optional HTML branch-coverage report
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
The suite is hermetic and holds branch coverage to its ratcheted floor. Large graph observations remain opt-in test cases, never cross-machine thresholds.
|
|
205
|
+
|
|
206
|
+
Full documentation: <https://fmind.github.io/fkf/>
|
|
207
|
+
|
|
208
|
+
## License
|
|
209
|
+
|
|
210
|
+
MIT. See [LICENSE](LICENSE).
|
fkf-5.0.0/README.md
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# fkf — Fmind Knowledge Framework
|
|
2
|
+
|
|
3
|
+
[](https://github.com/fmind/fkf/actions/workflows/ci.yml) [](https://github.com/fmind/fkf/releases/latest) [](https://www.python.org/) [](LICENSE)
|
|
4
|
+
|
|
5
|
+
**Your coding agent knows your repository. It does not know the meeting that set the constraint, the review that rejected the approach, or the ticket that explains why the code looks like that.**
|
|
6
|
+
|
|
7
|
+
`fkf` collects that work history into a git repository you own — plain JSON and Markdown, gathered by the provider CLIs you already trust — and hands your agent a small, budgeted, reproducible slice of it on demand.
|
|
8
|
+
|
|
9
|
+
One command. No account, daemon, database, or telemetry. Stored reads are offline.
|
|
10
|
+
|
|
11
|
+
## See it in 30 seconds
|
|
12
|
+
|
|
13
|
+
No credentials, no network, no configuration:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
fkf init ~/demo --demo 30
|
|
17
|
+
fkf --format text context "retrieval boundary" --budget 1024 --explain --base ~/demo
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The demo base is synthetic, but it is a real base: 30 days of events across six sources, a wiki, project pages, and a graph. This abridged result shortens URIs, fields, and receipt values:
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
350 wiki wiki/retrieval-boundary.md Retrieval boundary · tags=decision,retrieval
|
|
24
|
+
why=exact-identifier:+100(retrieval boundary),term:+100(retrieval …),exact-phrase:+50
|
|
25
|
+
182 record events/…/git-commits.json#… Design retrieval boundary (LG-77)
|
|
26
|
+
182 record events/…/google-calendar-events.json#… Document retrieval boundary (GW-1203)
|
|
27
|
+
182 record events/…/google-gmail-emails.json#… Fix retrieval boundary (FK-412)
|
|
28
|
+
182 record events/…/jira-issues.json#FK-418-4 Revert retrieval boundary (FK-418)
|
|
29
|
+
... 3 more selected items ...
|
|
30
|
+
80 wiki wiki/index.md Wiki · navigation-page:-50(curated navigation ranks below concept pages)
|
|
31
|
+
receipt pack for "retrieval boundary" · 9/736 selected · <1024 text tokens · floor 10
|
|
32
|
+
window <30 days> · as_of <today> · digest <hex> · ranking v7 · dropped 717
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
One decision, scattered across a commit, a calendar invite, an email, and a Jira issue, pulled back together under a token budget.
|
|
36
|
+
|
|
37
|
+
Three things make that pack usable by an agent rather than merely interesting:
|
|
38
|
+
|
|
39
|
+
1. **It fits.** You set the budget; `context` selects the strongest evidence and stops. No pack silently blows past the window.
|
|
40
|
+
1. **It explains itself.** Every line carries the score and the reason it was chosen — and the receipt records what was dropped, so a wrong answer is debuggable instead of mysterious.
|
|
41
|
+
1. **It is reproducible.** Ranking is deterministic, and indexed and fallback reads return the same semantic answer. The receipt records the effective inputs, semantic digest, selection boundaries, and execution path. There are no embeddings or model calls in the read path.
|
|
42
|
+
|
|
43
|
+
Then look around the base with `fkf find`, `fkf graph repo:github.com/fmind/fkf --in`, and `fkf list projects --status active`. Delete `~/demo` when you are done.
|
|
44
|
+
|
|
45
|
+
## Install
|
|
46
|
+
|
|
47
|
+
FKF is a Python 3.14 package. Install its stable `fkf` launcher with [uv](https://docs.astral.sh/uv/):
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
uv tool install fkf
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Use `uvx fkf ...` for a one-shot command without a persistent installation. Harness and schedule integration intentionally require a stable installed launcher because their configuration must keep working after the invoking process exits.
|
|
54
|
+
|
|
55
|
+
Upgrade an installed tool through the package manager:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
uv tool upgrade fkf
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Wheel and source distributions are published to PyPI and attached to the [matching GitHub release](https://github.com/fmind/fkf/releases/latest) with build-provenance attestations.
|
|
62
|
+
|
|
63
|
+
FKF supports Linux and macOS. WSL2 works when the base stays on its Linux filesystem; native Windows is out of scope because cancellation uses POSIX process groups.
|
|
64
|
+
|
|
65
|
+
<details>
|
|
66
|
+
<summary>Install from source</summary>
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
mise trust -y
|
|
70
|
+
mise install --locked
|
|
71
|
+
mise run install
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
To exercise the checkout without installing its launcher, run commands as `uv run fkf ...`.
|
|
75
|
+
|
|
76
|
+
</details>
|
|
77
|
+
|
|
78
|
+
## Connect your own work
|
|
79
|
+
|
|
80
|
+
Start with one real source. The personal preset ships a reviewed GitHub Search helper — it needs `python3` and `gh` on your `PATH`, and `gh` owns the login:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
gh auth status
|
|
84
|
+
fkf init ~/brain --preset personal
|
|
85
|
+
$EDITOR ~/brain/fkf.yaml # sources.github-pull-requests.enabled: true
|
|
86
|
+
fkf config helpers --refresh --base ~/brain
|
|
87
|
+
fkf trust --all --base ~/brain
|
|
88
|
+
fkf status --base ~/brain # confirms every requirement is on PATH
|
|
89
|
+
fkf sync github-pull-requests --days 30 --base ~/brain
|
|
90
|
+
fkf context "repo:github.com/OWNER/REPOSITORY" --since 30d --explain --base ~/brain
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Set `FKF_BASE=~/brain`, or run from inside the base, to drop `--base`.
|
|
94
|
+
|
|
95
|
+
`fkf init` creates the five layers, `fkf.yaml`, managed git rules, the helpers your enabled sources need under `bin/`, and three agent skills under `.agents/skills/`. It contacts no provider and asks for no token. Browser, mail, and shell-history sources stay disabled until you turn them on.
|
|
96
|
+
|
|
97
|
+
From there, `fkf sync` is safe to re-run: existing event documents are skipped, due index snapshots refresh, the graph follows document writes, and the lexical cache rebuilds only when searchable bytes change. `fkf brief` gives you the daily loop — yesterday's digest, today's calendar, assigned work, failing CI, stale or login-blocked sources.
|
|
98
|
+
|
|
99
|
+
## The model
|
|
100
|
+
|
|
101
|
+
Four ideas cover most of FKF.
|
|
102
|
+
|
|
103
|
+
**A base is a folder.** One git repository, five readable layers. `ls`, `rg`, and `jq` still work.
|
|
104
|
+
|
|
105
|
+
```text
|
|
106
|
+
events/YYYY-MM-DD/ one complete JSON document per event source
|
|
107
|
+
index/ current point-in-time source documents
|
|
108
|
+
tasks/ authored execution evidence and learned items
|
|
109
|
+
projects/ active, paused, or completed efforts
|
|
110
|
+
wiki/ reusable decisions, patterns, tools, and insights
|
|
111
|
+
graph.tsv rebuildable relation cache at the base root
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**A source is a command.** A source runs a reviewed command that prints one JSON document, and the named CLI owns its login. Adding GitHub, Google Workspace, Jira, or a local database needs no framework adapter — just YAML and, when the glue gets real, a small reviewed helper under the base's `bin/`:
|
|
115
|
+
|
|
116
|
+
```yaml
|
|
117
|
+
sources:
|
|
118
|
+
github-pull-requests:
|
|
119
|
+
enabled: true
|
|
120
|
+
layer: events
|
|
121
|
+
requires: [github-search-json.py, python3, gh]
|
|
122
|
+
window: true
|
|
123
|
+
run: [github-search-json.py, prs, assignee, "{{start}}", "{{end}}"]
|
|
124
|
+
fields:
|
|
125
|
+
id: .url
|
|
126
|
+
time: .updatedAt
|
|
127
|
+
title: .title
|
|
128
|
+
repo: .repository.nameWithOwner
|
|
129
|
+
repository: .repository_uri # relation: builds a graph edge
|
|
130
|
+
owner: [".assignee_uris[]"]
|
|
131
|
+
body: [gh, pr, view, "{{id}}", --repo, "{{repo}}", --json, "body,comments"]
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**Relations are explicit URIs.** Records and pages link to file URIs or to entities such as `repo:github.com/fmind/fkf`. `graph.tsv` is built from declared relation fields and authored links — FKF never guesses a relationship from prose.
|
|
135
|
+
|
|
136
|
+
**Retrieval is bounded and reproducible.** `find` returns every lexical match; `context` selects under a budget and explains itself. By default, records are stored as metadata plus a link and bodies stay at the provider. The opt-in `cache` and `sync` body policies keep ignored, manifest-verified local copies after an explicit read or evidence sync.
|
|
137
|
+
|
|
138
|
+
Full detail: [sources](https://fmind.github.io/fkf/docs/sources/), [URIs and the graph](https://fmind.github.io/fkf/docs/uris-graph/), [context packs](https://fmind.github.io/fkf/docs/context/), [configuration schema](https://fmind.github.io/fkf/docs/schema/).
|
|
139
|
+
|
|
140
|
+
## Use it from your coding agent
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
fkf harness install --all --dry-run --base ~/brain
|
|
144
|
+
fkf harness install --all --base ~/brain
|
|
145
|
+
fkf harness install claude codex gemini kiro --workspace ~/fmind --base ~/brain
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
The first command shows exactly what FKF would manage. The second registers read-only MCP under the base-scoped key `fkf-<name>` in all ten adapters. The third opts the four adapters with verified passive output into automatic context for one physical workspace. FKF does not create global links to a base's skills. If you manage client configuration yourself, the primitive is `fkf mcp serve --base ~/brain`.
|
|
149
|
+
|
|
150
|
+
The MCP server is read-only and bounded: `context`, `find`, `day`, `timeline`, `list`, `read`, and `graph`. It cannot write, run a shell, or fetch bodies. The agent asks for a pack when it needs one. Ordinary lookups use `context` and a cited `read`; configuration inspection and task traces belong to setup or meaningful work. The bundled `fkf-use`, `fkf-learn`, and `daily-brief` skills teach it how. See the [harness guide](https://fmind.github.io/fkf/docs/harnesses/).
|
|
151
|
+
|
|
152
|
+
## Trust and privacy
|
|
153
|
+
|
|
154
|
+
- **FKF reads no credential** and expands no secret environment variable. Provider credentials stay with the provider CLI.
|
|
155
|
+
- **Collected content is untrusted data** — evidence, never instructions. A stored value never becomes shell syntax or an executable name.
|
|
156
|
+
- **`fkf trust` hashes the executable plan**: the effective `auth:`, `run:`, `test:`, and `body:` argv plus every file under the base's `bin/` and `tests/`. A meaningful change requires review again. It detects change; it is not a sandbox.
|
|
157
|
+
- **Stored reads are offline, including `brief`.** `read --body` is the explicit read-time fetch; `sync` may prefetch bodies under the opt-in `bodies: sync` policy. Explicit `status --live` runs only bounded trusted `auth:` probes.
|
|
158
|
+
- **FKF encrypts nothing and provides no backup.** Protect the disk and the remote. Whether event and index documents enter git history is your choice at `init`, recorded in `.gitignore`.
|
|
159
|
+
|
|
160
|
+
Details and the full threat boundary: [privacy and trust](https://fmind.github.io/fkf/docs/privacy/).
|
|
161
|
+
|
|
162
|
+
## Scope
|
|
163
|
+
|
|
164
|
+
FKF is intentionally small. Do not use it if you need semantic search, a dashboard, a hosted service, native Windows, or a local cache your organization's data policy forbids. Your editor, shell, and coding agent remain the interface.
|
|
165
|
+
|
|
166
|
+
Configuration and stored documents each carry `fkf: 1`. Evidence-envelope additions stay compatible within that marker, so old evidence stays readable without re-fetching provider history.
|
|
167
|
+
|
|
168
|
+
## Development
|
|
169
|
+
|
|
170
|
+
Start with [CONTRIBUTING.md](CONTRIBUTING.md), [AGENTS.md](AGENTS.md), and the [Code of Conduct](CODE_OF_CONDUCT.md). Report vulnerabilities through a [private security advisory](https://github.com/fmind/fkf/security/advisories/new), never a public issue — see [SECURITY.md](SECURITY.md).
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
mise run all # format, check, branch-coverage tests, and package build
|
|
174
|
+
mise run coverage # optional HTML branch-coverage report
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
The suite is hermetic and holds branch coverage to its ratcheted floor. Large graph observations remain opt-in test cases, never cross-machine thresholds.
|
|
178
|
+
|
|
179
|
+
Full documentation: <https://fmind.github.io/fkf/>
|
|
180
|
+
|
|
181
|
+
## License
|
|
182
|
+
|
|
183
|
+
MIT. See [LICENSE](LICENSE).
|