session-glue 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.
Files changed (32) hide show
  1. session_glue-0.1.0/.github/pull_request_template.md +19 -0
  2. session_glue-0.1.0/.gitignore +15 -0
  3. session_glue-0.1.0/CONTRIBUTING.md +36 -0
  4. session_glue-0.1.0/LICENSE +21 -0
  5. session_glue-0.1.0/PKG-INFO +219 -0
  6. session_glue-0.1.0/README.md +172 -0
  7. session_glue-0.1.0/SECURITY.md +13 -0
  8. session_glue-0.1.0/codex-skills/session-glue/SKILL.md +46 -0
  9. session_glue-0.1.0/codex-skills/session-glue/agents/openai.yaml +6 -0
  10. session_glue-0.1.0/codex-skills/session-glue/references/protocol.md +118 -0
  11. session_glue-0.1.0/pyproject.toml +56 -0
  12. session_glue-0.1.0/session_glue/__init__.py +11 -0
  13. session_glue-0.1.0/session_glue/__main__.py +8 -0
  14. session_glue-0.1.0/session_glue/cli.py +275 -0
  15. session_glue-0.1.0/session_glue/installer.py +92 -0
  16. session_glue-0.1.0/session_glue/reader.py +69 -0
  17. session_glue-0.1.0/session_glue/schema.py +404 -0
  18. session_glue-0.1.0/session_glue/validator.py +100 -0
  19. session_glue-0.1.0/session_glue/writer.py +181 -0
  20. session_glue-0.1.0/tests/fixtures/handoffs/INDEX.yaml +14 -0
  21. session_glue-0.1.0/tests/fixtures/handoffs/invalid_missing_field.md +25 -0
  22. session_glue-0.1.0/tests/fixtures/handoffs/invalid_next_action.md +27 -0
  23. session_glue-0.1.0/tests/fixtures/handoffs/valid.md +45 -0
  24. session_glue-0.1.0/tests/fixtures/installer/with_block.md +12 -0
  25. session_glue-0.1.0/tests/fixtures/installer/without_block.md +4 -0
  26. session_glue-0.1.0/tests/test_cli.py +49 -0
  27. session_glue-0.1.0/tests/test_codex_skill.py +68 -0
  28. session_glue-0.1.0/tests/test_installer.py +111 -0
  29. session_glue-0.1.0/tests/test_reader.py +108 -0
  30. session_glue-0.1.0/tests/test_schema.py +192 -0
  31. session_glue-0.1.0/tests/test_validator.py +155 -0
  32. session_glue-0.1.0/tests/test_writer.py +230 -0
@@ -0,0 +1,19 @@
1
+ ## Summary
2
+
3
+ <!-- What changed and why? -->
4
+
5
+ ## Verification
6
+
7
+ <!-- Commands run, or explain why not run. -->
8
+
9
+ ## Sensitive Information Check
10
+
11
+ - [ ] I did not include API keys, tokens, cookies, passwords, private keys, or `.env` contents.
12
+ - [ ] I did not include private customer data, private repo contents, or proprietary logs.
13
+ - [ ] I used generic paths/placeholders instead of personal local paths where possible.
14
+ - [ ] Any fixtures, screenshots, handoff examples, or logs are safe for a public repository.
15
+
16
+ ## Scope Check
17
+
18
+ - [ ] This PR stays within the linked issue scope.
19
+ - [ ] This PR does not add a daemon, MCP dependency, embeddings, database, watcher, product UI, telemetry, or cloud sync unless maintainers explicitly approved a scope change.
@@ -0,0 +1,15 @@
1
+ .DS_Store
2
+ .env
3
+ .env.*
4
+ *.local
5
+ .venv/
6
+ __pycache__/
7
+ *.py[cod]
8
+ .pytest_cache/
9
+ .ruff_cache/
10
+ *.log
11
+ dist/
12
+ build/
13
+ *.egg-info/
14
+ .agent-history/
15
+ /docs/
@@ -0,0 +1,36 @@
1
+ # Contributing
2
+
3
+ Session Glue is intended to be an open-source project. Keep all project content safe to publish.
4
+
5
+ ## Sensitive Information Policy
6
+
7
+ Do not include:
8
+
9
+ - API keys, access tokens, cookies, session IDs, passwords, or private keys
10
+ - `.env` file contents
11
+ - production credentials or secret-dependent command output
12
+ - private customer data, private repo contents, or proprietary logs
13
+ - personal local paths when a generic path is enough
14
+ - screenshots that reveal secrets, account identifiers, dashboards, or private chats
15
+
16
+ Use placeholders instead:
17
+
18
+ - `/path/to/project`
19
+ - `<API_KEY>`
20
+ - `<TOKEN>`
21
+ - `<PRIVATE_REPO>`
22
+ - `<REDACTED>`
23
+
24
+ ## Pull Request Expectations
25
+
26
+ Before opening a PR:
27
+
28
+ - run the relevant tests
29
+ - keep scope tied to one issue when practical
30
+ - update docs when behavior changes
31
+ - check that new fixtures and examples contain no real credentials or private data
32
+ - avoid adding daemons, MCP dependencies, embeddings, databases, watchers, product UI, telemetry, or cloud sync unless maintainers explicitly approve a scope change first
33
+
34
+ ## Issues And Comments
35
+
36
+ GitHub issues and PR comments are public once the repository is public. Do not paste raw agent transcripts, local handoff files, logs, or screenshots unless they have been checked for sensitive content.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 realproject7
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.
@@ -0,0 +1,219 @@
1
+ Metadata-Version: 2.4
2
+ Name: session-glue
3
+ Version: 0.1.0
4
+ Summary: A zero-daemon, repo-local session-continuity protocol and CLI for coding agents.
5
+ Project-URL: Homepage, https://github.com/realproject7/session-glue
6
+ Project-URL: Repository, https://github.com/realproject7/session-glue
7
+ Author: Session Glue
8
+ License: MIT License
9
+
10
+ Copyright (c) 2026 realproject7
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ License-File: LICENSE
30
+ Keywords: agent,claude,cli,codex,continuity,handoff,memory,session
31
+ Classifier: Development Status :: 3 - Alpha
32
+ Classifier: Environment :: Console
33
+ Classifier: Intended Audience :: Developers
34
+ Classifier: License :: OSI Approved :: MIT License
35
+ Classifier: Programming Language :: Python :: 3
36
+ Classifier: Programming Language :: Python :: 3.10
37
+ Classifier: Programming Language :: Python :: 3.11
38
+ Classifier: Programming Language :: Python :: 3.12
39
+ Classifier: Programming Language :: Python :: 3.13
40
+ Classifier: Topic :: Software Development :: Libraries
41
+ Classifier: Topic :: Utilities
42
+ Requires-Python: >=3.10
43
+ Provides-Extra: dev
44
+ Requires-Dist: pytest>=7; extra == 'dev'
45
+ Requires-Dist: ruff>=0.4; extra == 'dev'
46
+ Description-Content-Type: text/markdown
47
+
48
+ # Session Glue
49
+
50
+ Session Glue is a lightweight session-continuity protocol and CLI for coding agents.
51
+
52
+ Its goal is simple: when an agent session gets too long, create a compact local handoff that lets the next session resume without dragging the full chat history forward.
53
+
54
+ ## Status
55
+
56
+ Pre-MVP founding repository.
57
+
58
+ ## Product Boundary
59
+
60
+ Session Glue v1 is intentionally small:
61
+
62
+ - repo-local `.agent-history/` handoffs
63
+ - markdown handoff files with YAML frontmatter
64
+ - `LATEST.md`, archived session files, `INDEX.yaml`, and `RESUME_PROMPT.txt`
65
+ - lightweight Python CLI
66
+ - no daemon
67
+ - no MCP dependency
68
+ - no embeddings
69
+ - no vector database
70
+ - no file watcher
71
+ - no product UI
72
+
73
+ ## Planned CLI
74
+
75
+ Primary executable:
76
+
77
+ ```bash
78
+ glue
79
+ ```
80
+
81
+ Fallback executable:
82
+
83
+ ```bash
84
+ session-glue
85
+ ```
86
+
87
+ Planned commands:
88
+
89
+ ```bash
90
+ glue create
91
+ glue validate
92
+ glue status
93
+ glue resume-prompt
94
+ glue install codex --dry-run
95
+ glue install claude --dry-run
96
+ glue install cursor --dry-run
97
+ glue install gemini --dry-run
98
+ ```
99
+
100
+ ### `glue create`
101
+
102
+ `glue create` archives an agent-composed handoff into the repository-local
103
+ `.agent-history/` directory. The agent writes the handoff document (YAML
104
+ frontmatter plus a narrative body — see the fixtures under
105
+ `tests/fixtures/handoffs/`); the CLI persists it:
106
+
107
+ ```bash
108
+ glue create --input handoff.md # or pipe via stdin: glue create < handoff.md
109
+ glue create --input handoff.md --repo-root /path/to/project
110
+ ```
111
+
112
+ It creates or updates:
113
+
114
+ - `.agent-history/sessions/<session>.md` — the archived session
115
+ - `.agent-history/LATEST.md` — a copy of the newest handoff
116
+ - `.agent-history/RESUME_PROMPT.txt` — the copy-paste resume prompt
117
+ - `.agent-history/INDEX.yaml` — compact metadata and a session list
118
+
119
+ The handoff is validated first: a missing required field or a resume-mechanic
120
+ `next_todo_items[0]` is rejected before anything is written. `glue create` never
121
+ accesses the network or the OS clipboard.
122
+
123
+ ### `glue validate`
124
+
125
+ `glue validate` checks that an existing `.agent-history/` is internally
126
+ consistent:
127
+
128
+ ```bash
129
+ glue validate # validate ./.agent-history/
130
+ glue validate --repo-root /path/to/project
131
+ glue validate --sessions # also validate archived session files
132
+ ```
133
+
134
+ It verifies that `LATEST.md` has valid frontmatter, that its `next_todo_items[0]`
135
+ is a productive action (not a resume mechanic such as "paste the prompt" or
136
+ "read `LATEST.md`"), that `RESUME_PROMPT.txt` exists, and that
137
+ `INDEX.yaml.first_next_action` matches `LATEST.md`'s `next_todo_items[0]`. It
138
+ exits non-zero and prints each problem when validation fails. Like the rest of
139
+ the CLI, it never touches the network or an LLM.
140
+
141
+ ### `glue status` and `glue resume-prompt`
142
+
143
+ Two compact, read-only commands for orienting a new session:
144
+
145
+ ```bash
146
+ glue status # latest session metadata + a cheap validation summary
147
+ glue resume-prompt # print .agent-history/RESUME_PROMPT.txt exactly
148
+ ```
149
+
150
+ `glue status` reads `INDEX.yaml` and prints the latest session id, latest file,
151
+ current branch, head commit, and first next action, plus a one-line validation
152
+ summary. It deliberately does **not** print the full session narrative, so it
153
+ orients you without recreating context bloat, and it handles a missing
154
+ `.agent-history/` gracefully. `glue resume-prompt` prints the exact contents of
155
+ `.agent-history/RESUME_PROMPT.txt`. Both are strictly read-only.
156
+
157
+ ### `glue install <agent> --dry-run`
158
+
159
+ `glue install` shows the managed instruction block Session Glue would add to a
160
+ coding agent's global instruction file, so agents know how to respond to
161
+ `/glue`, `/freeze`, `/handoff`, and `/checkpoint`:
162
+
163
+ ```bash
164
+ glue install codex --dry-run
165
+ glue install claude --dry-run
166
+ glue install cursor --dry-run
167
+ glue install gemini --dry-run
168
+ glue install all --dry-run
169
+ ```
170
+
171
+ It prints the target path and the proposed block (delimited by stable
172
+ `<!-- BEGIN/END SESSION GLUE (managed) -->` markers so a future updater can
173
+ replace it idempotently). **Only `--dry-run` is supported** — it never modifies
174
+ your home directory, and real installation is intentionally not implemented
175
+ (operator-gated). Running `glue install <agent>` without `--dry-run` exits with
176
+ an error.
177
+
178
+ ## Development
179
+
180
+ Keep the MVP small. Do not add daemons, background sync, retrieval services, or UI surfaces unless the project scope explicitly changes first.
181
+
182
+ Session Glue targets Python 3.10+ and has **no required runtime dependencies** — the CLI is built on the standard library so it can be installed and trusted immediately.
183
+
184
+ ### Local install
185
+
186
+ Create and activate a virtual environment, then install the package in editable mode with the development extras:
187
+
188
+ ```bash
189
+ python -m venv .venv
190
+ source .venv/bin/activate # Windows: .venv\Scripts\activate
191
+ python -m pip install -e ".[dev]"
192
+ ```
193
+
194
+ ### Verify the CLI
195
+
196
+ ```bash
197
+ glue --help
198
+ glue --version
199
+ session-glue --help # fallback executable
200
+ python -m session_glue --help # module invocation
201
+ ```
202
+
203
+ ### Run the tests
204
+
205
+ ```bash
206
+ pytest
207
+ ```
208
+
209
+ ### Lint (optional)
210
+
211
+ ```bash
212
+ ruff check .
213
+ ```
214
+
215
+ ## Contributing
216
+
217
+ Read [`CONTRIBUTING.md`](CONTRIBUTING.md) before opening issues or pull requests. All public content must avoid credentials, private logs, `.env` contents, and personal local paths.
218
+
219
+ For vulnerability reports, see [`SECURITY.md`](SECURITY.md).
@@ -0,0 +1,172 @@
1
+ # Session Glue
2
+
3
+ Session Glue is a lightweight session-continuity protocol and CLI for coding agents.
4
+
5
+ Its goal is simple: when an agent session gets too long, create a compact local handoff that lets the next session resume without dragging the full chat history forward.
6
+
7
+ ## Status
8
+
9
+ Pre-MVP founding repository.
10
+
11
+ ## Product Boundary
12
+
13
+ Session Glue v1 is intentionally small:
14
+
15
+ - repo-local `.agent-history/` handoffs
16
+ - markdown handoff files with YAML frontmatter
17
+ - `LATEST.md`, archived session files, `INDEX.yaml`, and `RESUME_PROMPT.txt`
18
+ - lightweight Python CLI
19
+ - no daemon
20
+ - no MCP dependency
21
+ - no embeddings
22
+ - no vector database
23
+ - no file watcher
24
+ - no product UI
25
+
26
+ ## Planned CLI
27
+
28
+ Primary executable:
29
+
30
+ ```bash
31
+ glue
32
+ ```
33
+
34
+ Fallback executable:
35
+
36
+ ```bash
37
+ session-glue
38
+ ```
39
+
40
+ Planned commands:
41
+
42
+ ```bash
43
+ glue create
44
+ glue validate
45
+ glue status
46
+ glue resume-prompt
47
+ glue install codex --dry-run
48
+ glue install claude --dry-run
49
+ glue install cursor --dry-run
50
+ glue install gemini --dry-run
51
+ ```
52
+
53
+ ### `glue create`
54
+
55
+ `glue create` archives an agent-composed handoff into the repository-local
56
+ `.agent-history/` directory. The agent writes the handoff document (YAML
57
+ frontmatter plus a narrative body — see the fixtures under
58
+ `tests/fixtures/handoffs/`); the CLI persists it:
59
+
60
+ ```bash
61
+ glue create --input handoff.md # or pipe via stdin: glue create < handoff.md
62
+ glue create --input handoff.md --repo-root /path/to/project
63
+ ```
64
+
65
+ It creates or updates:
66
+
67
+ - `.agent-history/sessions/<session>.md` — the archived session
68
+ - `.agent-history/LATEST.md` — a copy of the newest handoff
69
+ - `.agent-history/RESUME_PROMPT.txt` — the copy-paste resume prompt
70
+ - `.agent-history/INDEX.yaml` — compact metadata and a session list
71
+
72
+ The handoff is validated first: a missing required field or a resume-mechanic
73
+ `next_todo_items[0]` is rejected before anything is written. `glue create` never
74
+ accesses the network or the OS clipboard.
75
+
76
+ ### `glue validate`
77
+
78
+ `glue validate` checks that an existing `.agent-history/` is internally
79
+ consistent:
80
+
81
+ ```bash
82
+ glue validate # validate ./.agent-history/
83
+ glue validate --repo-root /path/to/project
84
+ glue validate --sessions # also validate archived session files
85
+ ```
86
+
87
+ It verifies that `LATEST.md` has valid frontmatter, that its `next_todo_items[0]`
88
+ is a productive action (not a resume mechanic such as "paste the prompt" or
89
+ "read `LATEST.md`"), that `RESUME_PROMPT.txt` exists, and that
90
+ `INDEX.yaml.first_next_action` matches `LATEST.md`'s `next_todo_items[0]`. It
91
+ exits non-zero and prints each problem when validation fails. Like the rest of
92
+ the CLI, it never touches the network or an LLM.
93
+
94
+ ### `glue status` and `glue resume-prompt`
95
+
96
+ Two compact, read-only commands for orienting a new session:
97
+
98
+ ```bash
99
+ glue status # latest session metadata + a cheap validation summary
100
+ glue resume-prompt # print .agent-history/RESUME_PROMPT.txt exactly
101
+ ```
102
+
103
+ `glue status` reads `INDEX.yaml` and prints the latest session id, latest file,
104
+ current branch, head commit, and first next action, plus a one-line validation
105
+ summary. It deliberately does **not** print the full session narrative, so it
106
+ orients you without recreating context bloat, and it handles a missing
107
+ `.agent-history/` gracefully. `glue resume-prompt` prints the exact contents of
108
+ `.agent-history/RESUME_PROMPT.txt`. Both are strictly read-only.
109
+
110
+ ### `glue install <agent> --dry-run`
111
+
112
+ `glue install` shows the managed instruction block Session Glue would add to a
113
+ coding agent's global instruction file, so agents know how to respond to
114
+ `/glue`, `/freeze`, `/handoff`, and `/checkpoint`:
115
+
116
+ ```bash
117
+ glue install codex --dry-run
118
+ glue install claude --dry-run
119
+ glue install cursor --dry-run
120
+ glue install gemini --dry-run
121
+ glue install all --dry-run
122
+ ```
123
+
124
+ It prints the target path and the proposed block (delimited by stable
125
+ `<!-- BEGIN/END SESSION GLUE (managed) -->` markers so a future updater can
126
+ replace it idempotently). **Only `--dry-run` is supported** — it never modifies
127
+ your home directory, and real installation is intentionally not implemented
128
+ (operator-gated). Running `glue install <agent>` without `--dry-run` exits with
129
+ an error.
130
+
131
+ ## Development
132
+
133
+ Keep the MVP small. Do not add daemons, background sync, retrieval services, or UI surfaces unless the project scope explicitly changes first.
134
+
135
+ Session Glue targets Python 3.10+ and has **no required runtime dependencies** — the CLI is built on the standard library so it can be installed and trusted immediately.
136
+
137
+ ### Local install
138
+
139
+ Create and activate a virtual environment, then install the package in editable mode with the development extras:
140
+
141
+ ```bash
142
+ python -m venv .venv
143
+ source .venv/bin/activate # Windows: .venv\Scripts\activate
144
+ python -m pip install -e ".[dev]"
145
+ ```
146
+
147
+ ### Verify the CLI
148
+
149
+ ```bash
150
+ glue --help
151
+ glue --version
152
+ session-glue --help # fallback executable
153
+ python -m session_glue --help # module invocation
154
+ ```
155
+
156
+ ### Run the tests
157
+
158
+ ```bash
159
+ pytest
160
+ ```
161
+
162
+ ### Lint (optional)
163
+
164
+ ```bash
165
+ ruff check .
166
+ ```
167
+
168
+ ## Contributing
169
+
170
+ Read [`CONTRIBUTING.md`](CONTRIBUTING.md) before opening issues or pull requests. All public content must avoid credentials, private logs, `.env` contents, and personal local paths.
171
+
172
+ For vulnerability reports, see [`SECURITY.md`](SECURITY.md).
@@ -0,0 +1,13 @@
1
+ # Security Policy
2
+
3
+ ## Reporting A Vulnerability
4
+
5
+ Please report security issues privately to the repository owner instead of opening a public issue.
6
+
7
+ Do not include live credentials in reports. Redact tokens, cookies, keys, and customer data.
8
+
9
+ ## Handoff Data Warning
10
+
11
+ Session Glue writes local handoff files that may describe implementation details. Projects should decide whether `.agent-history/` belongs in git.
12
+
13
+ The default repository `.gitignore` excludes `.agent-history/` so handoffs stay local unless a project intentionally changes that policy.
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: session-glue
3
+ description: >-
4
+ Use when the operator asks to glue, freeze, hand off, checkpoint, or resume a
5
+ coding-agent session, including /glue, /freeze, /handoff, /checkpoint,
6
+ "세션 붙여줘", "세션 얼려줘", or "create a Session Glue handoff".
7
+ ---
8
+
9
+ # Session Glue
10
+
11
+ Session Glue creates a compact repo-local handoff for restarting a long coding
12
+ agent session without carrying the whole chat forward.
13
+
14
+ ## Glue A Session
15
+
16
+ When the operator asks to glue, freeze, hand off, checkpoint, or prepare a new
17
+ session:
18
+
19
+ 1. Stop the active task at a clean boundary.
20
+ 2. Compose a high-density handoff markdown document for the next agent.
21
+ 3. Prefer the installed CLI:
22
+
23
+ ```bash
24
+ glue create --repo-root . --input <handoff.md>
25
+ ```
26
+
27
+ 4. If `glue` is unavailable, read `references/protocol.md` and write the same
28
+ `.agent-history/` files directly with the fallback protocol.
29
+ 5. Run `glue validate --repo-root .` when the CLI is available.
30
+ 6. Print the exact contents of `.agent-history/RESUME_PROMPT.txt` in a fenced
31
+ code block so the operator can paste it into the next session.
32
+
33
+ Do not request OS clipboard access. Do not add MCP, a daemon, a watcher, a
34
+ database, or an external service.
35
+
36
+ ## Resume A Session
37
+
38
+ When the operator asks to resume or pastes a Session Glue resume prompt:
39
+
40
+ 1. Read `.agent-history/LATEST.md` first.
41
+ 2. Run `git status --short` and report drift from the handoff.
42
+ 3. Inspect active context files from the handoff before broad repo search.
43
+ 4. Continue from the first productive `next_todo_items` entry.
44
+
45
+ Use `glue status --repo-root .` for a compact orientation and
46
+ `glue resume-prompt --repo-root .` to print the canonical prompt exactly.
@@ -0,0 +1,6 @@
1
+ interface:
2
+ display_name: "Session Glue"
3
+ short_description: "Create and resume compact agent handoffs."
4
+ default_prompt: "Use $session-glue to create a compact handoff for this coding session."
5
+ policy:
6
+ allow_implicit_invocation: true
@@ -0,0 +1,118 @@
1
+ # Session Glue Fallback Protocol
2
+
3
+ Use this only when the `glue` CLI is unavailable. The CLI is canonical.
4
+
5
+ ## File Layout
6
+
7
+ Write all files under the current repository root:
8
+
9
+ ```text
10
+ .agent-history/
11
+ LATEST.md
12
+ RESUME_PROMPT.txt
13
+ INDEX.yaml
14
+ sessions/
15
+ <session_id>.md
16
+ ```
17
+
18
+ Never write outside `.agent-history/`. Refuse to follow symlinks that would
19
+ redirect these writes outside the repository.
20
+
21
+ ## Handoff Markdown
22
+
23
+ `LATEST.md` and `sessions/<session_id>.md` must contain the same markdown
24
+ document. Start with YAML frontmatter using these required fields:
25
+
26
+ ```yaml
27
+ session_id: 2026-07-01-1200-short-slug
28
+ session_date: 2026-07-01
29
+ generated_at: 2026-07-01T12:00:00Z
30
+ schema_version: 1
31
+ project_root: /path/to/project
32
+ repo_root: /path/to/project
33
+ current_branch: main
34
+ head_commit: abc1234
35
+ agent: codex
36
+ status: IN_PROGRESS
37
+ active_context_files:
38
+ - path/to/file.py
39
+ completed_tasks:
40
+ - Concrete completed work item.
41
+ next_todo_items:
42
+ - First productive action after the next agent reads the handoff.
43
+ known_issues:
44
+ - Known blocker or risk.
45
+ ```
46
+
47
+ The first entry, next_todo_items[0], must be productive work, not resume mechanics. Do not use
48
+ phrases such as "paste the prompt", "start a new session", "read LATEST.md",
49
+ "inspect the handoff", or "verify the new agent reads the handoff".
50
+
51
+ Below the frontmatter, include these sections:
52
+
53
+ - `# Resume Prompt`
54
+ - `# What We Did`
55
+ - `# Current State`
56
+ - `# Decisions Made`
57
+ - `# Failed Attempts / Dead Ends`
58
+ - `# Next-Agent Instructions`
59
+ - `# Commands And Validation`
60
+ - `# Risks And Constraints`
61
+
62
+ ## RESUME_PROMPT.txt
63
+
64
+ Write a short paste-ready prompt:
65
+
66
+ ```text
67
+ Continue the previous coding session.
68
+
69
+ Project root: /path/to/project
70
+ First, read: .agent-history/LATEST.md
71
+ Prompt artifact: .agent-history/RESUME_PROMPT.txt
72
+ Then follow the Resume Prompt and continue from the first next_todo_items entry.
73
+
74
+ First productive next action (next_todo_items[0]):
75
+ <next_todo_items[0]>
76
+
77
+ Before editing, run git status --short and report any drift from the handoff.
78
+ Do not scan the whole repository unless the handoff is stale or insufficient.
79
+ ```
80
+
81
+ After writing the files, print the exact prompt in a fenced code block.
82
+
83
+ ## Dogfood Harness Guidance
84
+
85
+ When testing Session Glue with a fresh agent, keep two roles separate:
86
+
87
+ - The outer observer starts fresh-agent trials and records behavior.
88
+ - The trial subject only resumes from the handoff and reports what it did.
89
+
90
+ Do not make the trial subject's first productive action "run a fresh agent
91
+ trial" or "start another agent". That can create a meta-loop where the resumed
92
+ agent launches another resumed agent instead of being the test subject.
93
+
94
+ ## INDEX.yaml
95
+
96
+ Write compact metadata only. Do not duplicate the narrative:
97
+
98
+ ```yaml
99
+ schema_version: 1
100
+ latest_session: 2026-07-01-1200-short-slug
101
+ latest_file: sessions/2026-07-01-1200-short-slug.md
102
+ repo_root: /path/to/project
103
+ current_branch: main
104
+ head_commit: abc1234
105
+ first_next_action: First productive action after the next agent reads the handoff.
106
+ sessions:
107
+ - session_id: 2026-07-01-1200-short-slug
108
+ file: sessions/2026-07-01-1200-short-slug.md
109
+ session_date: 2026-07-01
110
+ generated_at: 2026-07-01T12:00:00Z
111
+ agent: codex
112
+ project_root: /path/to/project
113
+ repo_root: /path/to/project
114
+ current_branch: main
115
+ head_commit: abc1234
116
+ status: IN_PROGRESS
117
+ first_next_action: First productive action after the next agent reads the handoff.
118
+ ```