session.spec

session.spec is a command for coding agents from martineserios/thebrana. It costs 0 tokens per session (312 once invoked), scanned A, original, MIT.

A session specification describes how tests should create recent timestamps for data that is automatically removed after 30 days.

In plain words
What is it for?
Use it as a test-maintenance guide for write, archive, rotation, and history-retention tests.
Why use it?
It prevents time-sensitive tests from failing when old hardcoded dates fall outside the retention window.

Command

Part of the brana plugin — 56 skills, 4 commands, 14 agents, 13 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/martineserios/thebrana/session.spec
Clone the repo
git clone --depth 1 https://github.com/martineserios/thebrana

Or install brana, the plugin that ships this one along with the rest of its 56 skills, 4 commands, 14 agents, 13 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for session.spec

README.md
[![agentmods](https://agentmods.dev/badge/commands/martineserios/thebrana/session.spec.svg)](https://agentmods.dev/commands/martineserios/thebrana/session.spec)
Your own site
<a href="https://agentmods.dev/commands/martineserios/thebrana/session.spec"><img src="https://agentmods.dev/badge/commands/martineserios/thebrana/session.spec.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 312 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00312
Opus 5 $0.00000 $0.00156
Sonnet 5 $0.00000 $0.00062
Haiku 4.5 $0.00000 $0.00031

Measured 5d ago against content hash c5d2ed0a72bb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

session.spec scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

system/cli/rust/crates/brana-cli/src/commands/session.spec.md · 36 lines

What it actually says

session.rs — test fixture spec

Task: t-1343 Related: tasks.spec.md (rotation contract)

Scope

Bug fix in tests, not in production behavior. The write_state / rotate_history / read_history contract is unchanged.

Problem

Three I/O tests (test_write_archives_previous, test_history_limit, test_rotate_drops_old_entries) used hardcoded written_at timestamps from 2026-03-31. rotate_history drops entries older than 30 days; once the wall clock advanced past 2026-04-30 those fixture timestamps started being treated as old, so the archived entries were dropped before the assertions ran.

Fix contract

Tests that exercise write_state (which calls rotate_history) MUST use written_at timestamps inside the 30-day retention window. A recent_ts(days) helper returns Utc::now() - days in RFC3339 — pass small positive offsets to stay inside the window.

sample_state() keeps its fixed 2026-03-31 timestamp; it's the shared fixture for render and validation tests where the literal value is asserted. I/O tests build their state from sample_state() and overwrite written_at with recent_ts(...).

Out of scope

  • Changing rotate_history's 30-day cutoff
  • Changing the write_state archive contract
  • Touching render/validate tests that depend on the fixed fixture timestamp
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 36 lines · 0 tokens per session scan A c5d2ed0a72bb

Subscribe to this mod's changes

session.spec is a command published in the GitHub repository martineserios/thebrana (3 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 312 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.