Generated banner for business-context-os
Generated logo for business-context-os

business-context-os

LLM wiki kit

First committed by walm00

Published in walm00/business-context-os. Publisher page

22 GitHub stars

What it is

CLEAR Context OS is the maintenance layer your second brain never had: ownership boundaries enforced mechanically, staleness surfaced on a schedule, drift propagated across linked docs, a dispatcher that learns from your clicks. One source of truth per topic. Searchable. Task-aware.
— the description by walm00

AutoGineer overview, from the brain’s own files

CLEAR Context OS is a framework designed to solve the problem of silent context degradation in AI agents. By implementing a structured methodology called CLEAR (Contextual Ownership, Linking, Elimination, Alignment, Refinement), it provides a maintenance layer that manages knowledge through automated scheduling, ownership enforcement, and drift detection. It organizes information into specific zones—such as canonical data, wiki-based derivatives, and verbatim evidence—ensuring that agents always operate on the most accurate, source-of-truth-ranked information. The system includes a dispatcher for scheduled maintenance, a local dashboard for monitoring, and integration with Claude Code to facilitate onboarding and task-aware context retrieval.

How it works

Memory model: LLM wiki

AutoGineer overview, from the brain’s own files

The system organizes information into a folder hierarchy where the path itself acts as a trust signal for the LLM. It uses a dispatcher to run scheduled maintenance jobs that check for staleness, propagate updates across linked documents, and audit content health. New information is ingested through a routing process that places content into specific zones: canonical data for facts, wiki pages for operational knowledge, and collections for legal evidence. The system learns from user interactions to suggest fixes and uses frontmatter metadata to allow agents to filter and retrieve information efficiently without full-text scanning.

Folders
FolderRoleFiles
.claudeagent-config193
.githubagent-config6
docsdocs68

The agent reads

The agent writes

Requirements

Works with: Claude Code, OpenCode

Set it up

  1. This brain runs code automatically: 5 hooks (claude-code), 1 script. Review .claude/settings.json, install.sh before opening the folder in Claude Code. No step below turns a hook on for you.

    • .claude/settings.json: bash "$CLAUDE_PROJECT_DIR/.claude/hooks/auto_save_session.sh"
    • .claude/settings.json: bash "$CLAUDE_PROJECT_DIR/.claude/hooks/precompact_save.sh"
    • .claude/settings.json: "$CLAUDE_PROJECT_DIR/.claude/bin/python3" "$CLAUDE_PROJECT_DIR/.claude/hooks/post_edit_frontmatter_check.py"
    • .claude/settings.json: "$CLAUDE_PROJECT_DIR/.claude/bin/python3" "$CLAUDE_PROJECT_DIR/.claude/hooks/post_edit_frontmatter_check.py"
    • .claude/settings.json: "$CLAUDE_PROJECT_DIR/.claude/bin/python3" "$CLAUDE_PROJECT_DIR/.claude/hooks/post_commit_context_check.py"
    • install.sh: sh install.sh
  2. Clone the repository at the commit AutoGineer scanned:

    git clone https://github.com/walm00/business-context-os.git && cd business-context-os && git checkout 463568372f31f24fa6c01121c38f989845ca7c84
  3. Claude Code reads CLAUDE.md from this folder automatically.

  4. cd business-context-os && claude

  5. AutoGineer scanned these files at commit 4635683.

  6. First committed by walm00. Published in walm00/business-context-os. Licence: MIT License.

Usage

AutoGineer overview, from the brain’s own files

  • Automating the maintenance of project documentation and SOPs.
  • Providing AI agents with a reliable, freshness-aware knowledge base.
  • Managing ownership boundaries across large, multi-topic documentation sets.
  • Syncing and auditing context across linked documents to prevent drift.
  • Generating daily digests of system health and pending maintenance tasks.
“Install BCOS from https://github.com/walm00/business-context-os and walk me through onboarding.”
Claude clones the repository, sets up the environment, and guides the user through an interactive onboarding process to configure the context architecture.
“/context bundle market-report:write”
The agent retrieves a curated, freshness-aware package of context specifically relevant to writing a market report.
“Run the audit twice a week.”
The dispatcher updates the maintenance schedule to perform an audit of the knowledge base on a bi-weekly cadence.
“/wiki run https://stripe.com/docs/api”
The system fetches the URL, summarizes the content, and creates a cited wiki entry within the knowledge base.

Documentation by walm00

<p align="center"> <h1 align="center">CLEAR Context OS</h1> <p align="center"> <strong>Knowledge that maintains itself —</strong><br> so your AI doesn't act on what was true last month. </p> <p align="center"> <a href="#install">Install</a> &nbsp;·&nbsp; <a href="#what-it-does">What it does</a> &nbsp;·&nbsp; <a href="#the-wiki-zone">Wiki zone</a> &nbsp;·&nbsp; <a href="#what-ships">What ships</a> &nbsp;·&nbsp; <a href="docs/_bcos-framework/guides/getting-started.md">Getting Started</a> </p> <p align="center"> <img src="https://img.shields.io/badge/claude_code-ready-blueviolet" alt="Claude Code"> <img src="https://img.shields.io/badge/methodology-CLEAR-green" alt="CLEAR Methodology"> <img src="https://img.shields.io/badge/install-one_command-success" alt="One-command install"> <img src="https://img.shields.io/badge/skills-17-blue" alt="17 skills"> <img src="https://img.shields.io/badge/maintenance_jobs-12-orange" alt="12 maintenance jobs"> <img src="https://img.shields.io/badge/license-MIT-lightgrey" alt="MIT"> </p> </p>


Your AI had perfect context — two weeks ago. Then your strategy shifted, three meetings redefined priorities, and the docs you wrote on Monday are wrong by Friday. CLEAR Context OS is the maintenance layer your second brain never had: ownership boundaries enforced mechanically, staleness surfaced on a schedule, drift propagated across linked docs, a dispatcher that learns from your clicks. One source of truth per topic. Searchable. Task-aware. Never silently stale.


Install

Easiest — let Claude do it. Open Claude Code in any directory and paste:

"Install BCOS from https://github.com/walm00/business-context-os and walk me through onboarding."

Claude clones the repo, picks the right install path for your platform (Windows/macOS/Linux), runs setup, and steps straight into onboarding. No prereq checks to debug — if something's missing, Claude resolves it interactively.

Or manually, two commands:

curl -fsSL https://raw.githubusercontent.com/walm00/business-context-os/main/install.sh -o /tmp/bcos-install.sh
bash /tmp/bcos-install.sh

(Requires bash, curl, and tar on PATH — fine on macOS/Linux and on Windows under WSL or Git Bash. Two steps instead of a single bash <(curl …) pipe so Claude Code's permission gate auto-approves both commands — you don't need to drop out to a terminal.)

Drop anything you already have — SOPs, brand docs, meeting notes, exports — into docs/_inbox/ (skip if you're starting fresh). Then open Claude Code in that repo and say:

"Launch BCOS onboarding."

That's the only prompt you need. Onboarding inspects your inbox, scans the rest of the repo, asks one Q&A round, and proposes the architecture for review. Works the same whether the repo is fresh or already full of context.


From zero to running

  INSTALL  →  DISCOVER  →  ALIGN  →  SCHEDULE  →  RUNNING
#StepWhat happens
1InstallOne bash line drops the framework into any repo
2DiscoverClaude scans your repo + any MCP you've connected (Drive, Notion, Slack, Gmail, your CRM — whatever's wired in) for existing context, plus anything you've dropped into docs/_inbox/
3AlignOne Q&A round — project type, key sources, ownership boundaries. Architecture drafted for your review
4SchedulePick maintenance cadence in plain English: "audit twice a week", "dispatcher at 08:30", "deep daydream off"
5RunningDaily digest. Local dashboard. /context bundle <task> ready. Context compounds from here — the system maintains itself.

Simple, guided, automatic. Claude walks you through each step — you review, you decide. Nothing deleted along the way — originals preserved or archived, never silently overwritten.


What it does

Stops context rot in three ways:

What it does
OrganizeEvery doc declares what it owns. CLEAR boundaries prevent the same fact living in 5 places.
MaintainScheduled jobs check freshness, surface stale docs, propagate updates across linked content.
Use/context search and /context bundle <task> give Claude curated, freshness-aware, source-of-truth-ranked context for the job at hand.

The folder tells the LLM what to trust. Claude reads the path before the content: docs/*.md = canonical, _planned/ = not yet real, _archive/ = history, _inbox/ = unprocessed, _collections/ = verbatim evidence, _wiki/ = explanatory. The hierarchy is the trust signal — fewer tokens spent re-deciding, no chance of treating an archived draft as today's truth.

docs/
├── *.md                  ← canonical data points (one source of truth per topic)
├── document-index.md     ← auto-generated TOC
├── current-state.md      ← what's true right now + what changed recently
├── table-of-context.md   ← high-level cluster map for orientation
├── _inbox/               ← drop zone — Claude triages on demand
├── _planned/             ← polished ideas, not yet real
├── _archive/             ← superseded — kept, not deleted
├── _collections/         ← verbatim evidence (invoices, contracts, transcripts)
│   └── <type>/_manifest.md   (each collection has a manifest)
├── _wiki/                ← derivative knowledge (how-tos, source summaries)
│   ├── pages/            ← user-authored explainers
│   ├── source-summary/   ← external captures with citation banners
│   ├── raw/              ← original artifacts (PDFs, HTML)
│   └── queue.md          ← URLs awaiting fetch
└── _bcos-framework/      ← framework docs — never user content
    ├── architecture/     ← 12 zone + system architecture docs
    ├── methodology/      ← 5 CLEAR + ownership + standards docs
    ├── patterns/         ← 8 project-type starting templates
    └── templates/        ← 15 frontmatter / schema / starter files

The wiki zone

Inspired by Karpathy's LLM Wiki approach — give the LLM a wiki of your knowledge, the way you'd brief a smart new hire.

Save anything to the wiki, from anywhere:

/wiki run https://stripe.com/docs/api          ← fetch a URL, summarize, cite
/wiki create from /Users/me/Downloads/spec.pdf ← extract a PDF, link to the binary
/wiki promote docs/_inbox/meeting-notes.md     ← turn an inbox capture into a wiki page

The wiki holds how-tos, runbooks, glossaries, source summaries, post-mortems, decision logs — derivative knowledge that explains and supports your canonical data points. Every page cites what it builds on. Stale pages surface automatically when their sources advance.

Wiki content is searchable alongside the rest of your context:

/context search "stripe billing"       ← cross-zone search, ranked by source-of-truth
/context bundle market-report:write    ← curated bundle for a specific task

The dashboard

A local cockpit at http://127.0.0.1:8091 that shows your system at a glance — no third-party services, no telemetry, no logins.

Image: BCOS dashboard cockpit — knowledge system status, things waiting on you, maintenance routine

python .claude/scripts/bcos-dashboard/run.py
SurfaceWhat you see
CockpitOne-line status (healthy / N waiting / heads-up). Per-job dot strip for every maintenance job (core BCOS + wiki zone).
Update"Run full sync" button → update.py + CLAUDE.md drift review + auto-commit + push, with a live log drawer.
Schedules (/settings/schedules)Per-job preset buttons (daily, mon_wed_fri, weekly_mon, off) + the global auto-commit toggle + auto-fix whitelist. Saves directly to schedule-config.json.
Run history (/settings/runs)Last 20 dispatcher runs with filter chips (job / verdict / trigger).
File health (/settings/files)Frontmatter / cross-reference / staleness findings with one-click fixes.

The dashboard is read-mostly: data flows from the dispatcher's diary, the schedule config, and the canonical context index. Writes (mark-done, schedule preset, auto-commit toggle, file fix) go through dedicated POST endpoints.


Requirements

  • Claude Code (desktop app, CLI, or web)

  • Python 3.8+ on PATH

  • bash (default macOS bash 3.2 is fine)


Updating

python .claude/scripts/update.py

Refreshes framework files only — skills, hooks, scripts, templates. Your docs/ and .private/ are never touched.


Maintenance

One scheduled task per repo. The dispatcher reads schedule-config.json, runs the jobs due today, writes one consolidated digest at docs/_inbox/daily-digest.md, and surfaces findings as one-click cards in the dashboard.

Image: BCOS maintenance schedule dispatcher — daily, weekly, monthly jobs flowing into the daily digest and dashboard cards

You can tune any of it in plain English:

"Run the audit twice a week." · "Move dispatcher to 08:30." · "Turn off deep daydream."

The system learns from your clicks. After three consistent uses of the same fix, the dashboard pre-selects it as a "✨ suggested" action — you accept or reject. Reversals trigger an automatic safety brake.


CLEAR — the methodology

Five principles, one rule each:

  • C — Contextual Ownership · one document owns each topic. No duplicates.

  • L — Linking · reference sources; don't copy them.

  • E — Elimination · consolidate; don't keep two versions.

  • A — Alignment · context that doesn't support decisions doesn't belong.

  • R — Refinement · structured maintenance, not ad-hoc fixes.

The whole framework is the mechanical implementation of these five rules.


What ships

Everything below installs as one repo drop-in. No third-party services, no logins, no telemetry — all state lives in your .claude/ and docs/ folders.

LayerCountExamples
Skills (chat-invokable via slash command)17clear-planner · bcos-wiki · context-routing · context-audit · context-ingest · daydream · learning · schedule-tune · lessons-consolidate · ecosystem-manager
Sub-agents (delegated bounded tasks)3wiki-fetch · explore · plus one optional
Scripts (mechanical Python)46lifecycle_sweep · run_wiki_* (5) · cmd_wiki_* (7) · auto_fix_audit · bcos_inventory · digest_sidecar · record_resolution
Hooks (auto-validation on edit)4post-edit frontmatter check · post-commit context check · pre-compact save · auto-save session
Maintenance jobs (scheduled, one dispatcher)12index-health · audit-inbox · daydream-lessons · daydream-deep · architecture-review · auto-fix-audit · lifecycle-sweep · wiki-stale-propagation · wiki-source-refresh · wiki-graveyard · wiki-coverage-audit · wiki-canonical-drift
Auto-fix IDs (silent dispatcher fixes)12missing-last-updated · eof-newline · frontmatter-field-order · wiki-mark-queue-ingested · wiki-archive-expired-post-mortem
Architecture docs12wiki-zone.md · lifecycle-routing.md · typed-events.md · context-zones.md · content-routing.md · wiki-headless-scripts.md
Methodology docs5CLEAR principles · context architecture · decision framework · document standards · ownership specification
Project patterns (starting templates by project type)8client-project · gtm · marketing · operational · product-development · product-service · internal-tool-app · internal-tool-automation
Templates (frontmatter, schema, starters)15data-point · cluster · current-state · table-of-context · wiki-schema · wiki-config · session-diary-starter

Every script and skill is documented at the source. Every job has a reference doc under .claude/skills/schedule-dispatcher/references/job-*.md. Every typed-event finding maps to a renderer in the dashboard cockpit. Adding a new check means dropping a cmd_*.py or run_*.py, registering it in one map, and the dashboard picks it up.


Contributing

Contributions welcome — open an issue or submit a PR targeting the dev branch. CI runs frontmatter, reference, and ecosystem-integration checks on every PR.

The fastest contribution path is lessons learned. As you use the system it captures insights; if you find one universal, contribute it back.


Origin

Built by Guntis Coders after two years of operating context systems in production. The CLEAR methodology emerged from a practical problem: AI context degrades silently, and no amount of one-time documentation prevents it. The solution required a system — ownership boundaries, automated maintenance, self-learning, and structured reflection.

Background: What is the Table of Contexts and why does it matter.


License

MIT

.claude/skills/schedule-dispatcher/SKILL.md


name: schedule-dispatcher description: | Single-task dispatcher for CLEAR Context OS scheduled maintenance. Runs from the daily scheduled task, reads schedule-config.json, determines which jobs are due today, runs them in sequence, appends to the diary, writes a consolidated morning digest, and surfaces any frequency-tuning suggestions.

WHEN TO USE:

  • Invoked automatically each morning by the bcos-{PROJECT} scheduled task

  • User says "run today's maintenance now" (manual dispatch)

  • User says "run the [job-name] job" (runs one job on demand, skips others) category: maintenance


Schedule Dispatcher

Purpose

One task, one report, one diary entry per job. The dispatcher replaces the previous model of 5 standalone scheduled tasks. It is invoked once per day, reads configuration, and runs whichever maintenance jobs are due.

The dispatcher never decides on its own to change frequencies or skip jobs that are due — it surfaces suggestions in the morning report and waits for the user to approve a change (via the schedule-tune skill).


Preconditions

Before doing anything, verify the working directory is a BCOS-enabled repo:

  1. Confirm .claude/quality/schedule-config.json exists

  2. Confirm docs/ exists

  3. Confirm .claude/hook_state/ exists (create if missing — used for diary)

If any are missing, stop and report: "Dispatcher invoked outside a BCOS repo, or BCOS is not fully installed. Run python .claude/scripts/update.py first."


Step 1: Read Configuration

Read .claude/quality/schedule-config.json. Validate required fields:

  • version (string)

  • jobs (object) — each entry must have enabled (bool) and schedule (string)

  • auto_fix.enabled (bool)

  • auto_fix.whitelist (array of strings)

  • digest (object) — write_file (bool) and path (string)

If the config is malformed, STOP. Emit a typed framework-config-malformed finding (schema 1.1.0+, category: "bcos-framework") with finding_attrs = {file: ".claude/quality/schedule-config.json", parse_error: "{message}" | null, missing_fields: [...] | null}. Write the minimum-shape sidecar (with this finding + overall_verdict: "red" + empty jobs[]) AND a framework-config-malformed row to .claude/hook_state/bcos-framework-issues.jsonl via the Step 7c writer pattern. Write a diary entry dispatcher.error with the validation failure. Report to the user: "schedule-config.json is malformed — fix before the dispatcher can run. Use the schedule-tune skill to repair it." Note: the chat-echo follows the error scenario template from Step 7.3, not the normal compact card.

Schema-conformance nudge (schema 1.2.0+): After successful parse, check the config against the schema 1.2.0 baseline:

  • If digest.auto_commit is false → emit a dispatcher-auto-commit-disabled framework finding (yellow, info-level — finding_attrs = {config_path: ".claude/quality/schedule-config.json"}). Surface in the daily digest's framework-issues block. The dispatcher continues — false is a valid override, just not the recommended default. Forcing function for plugin-package-checklist L7.10e adoption.

  • If any jobs.* entry has no outputs: key → record the job name for the silence-preserving check in Step 7b (do NOT emit a finding here — job-missing-outputs-declaration is emitted later only when the missing declaration actually mattered this tick).


Step 2: Determine Today's Jobs

For each entry in jobs, decide if it should run today. Compare schedule against the current local date:

schedule valueRuns when
"daily"Every day
"mon".."sun"Only on that weekday
"weekdays"Monday through Friday
"weekends"Saturday and Sunday
"1st", "15th"Only on that day-of-month
"last"Last day of the current month
"every-Nd"If N or more days since last successful diary run
A raw cron stringIf today matches the cron's DOW and DOM fields
"off"Never

If enabled is false, skip regardless of schedule.

For on-demand dispatch (user said "run the audit-inbox job"): skip this step, run only the named job.

Build an ordered list of jobs to run. Order: index-health first (always, if enabled), then the rest by config order. Put architecture-review last.


Step 2.5: Refresh the Context Index (once per run)

Before running any job, regenerate .claude/quality/context-index.json exactly once:

python .claude/scripts/context_index.py --write

Every job downstream that needs frontmatter / zone / cluster facets must call load_context_index_cached() from context_index.py rather than re-walking docs/. The cache TTL is 10 min (longer than a full dispatcher cycle), so all jobs in this run hit the same in-memory snapshot. This turns N full-tree walks per dispatcher tick into one — the difference matters for repos with hundreds of docs.

If a job has its own private parser for legacy reasons, that's fine — but new jobs and edits to existing jobs should prefer the cached helper.


Step 3: Read Recent Diary

Read up to the last 30 entries from .claude/hook_state/schedule-diary.jsonl. Build a per-job summary:

  • How many consecutive green runs?

  • Findings trend (flat / rising / falling)?

  • Last run timestamp per job?

This is used later for frequency-tuning suggestions. Do not change anything based on the diary — suggestions only.


Step 4: Run Each Job

For each job in the list:

  1. Load the job reference file from .claude/skills/schedule-dispatcher/references/job-{name}.md

  2. Follow the reference's steps (they're self-contained, the dispatcher does not interpret them further)

  3. Collect from each job:

    • verdict: one of green, amber, red, or error

    • findings_count: integer

    • auto_fixed: list of short strings describing fixes applied

    • actions_needed: list of short strings describing items requiring user judgement

    • notes: optional free-text (one short paragraph max)

  4. Append a diary entry immediately after each job completes (do not batch — if the dispatcher crashes mid-run, we want the partial history). Use the helper script — it creates .claude/hook_state/ on first run and matches the allowlisted command prefix so it never prompts:

python .claude/scripts/append_diary.py '{"ts":"2026-04-15T09:04:12","job":"index-health","verdict":"green","findings_count":0,"auto_fixed":[],"actions_needed":[],"duration_s":4}'

Do NOT use echo ... >> .claude/hook_state/schedule-diary.jsonl — raw redirects into .claude/ trigger the sensitive-file approval prompt on every append.

If a job errors, catch the error, log "verdict":"error" with "notes":"{short error message}", and continue to the next job. Do not stop the dispatcher on one job's failure.

Data-corruption surfacing. JSONL loaders (auto_fix_audit._load_rows, promote_resolutions._load_rows, _load_diary, etc.) use _jsonl_safe.safe_load_jsonl() which records dropped (malformed) lines in a _LAST_LOAD_REPORT module-global. When a job that uses these loaders completes with _LAST_LOAD_REPORT.dropped > 0, surface the report as a data-corruption-detected action item in the digest — the auditor's denominator silently shrinks otherwise. New loaders SHOULD use safe_load_jsonl rather than the legacy try/except: continue pattern; the helper signature returns (rows, report) so callers can include the finding without changing call-site shape.

Wiki jobs are first-class job references and use the same dispatcher contract:

JobReferenceNotes
wiki-stale-propagationreferences/job-wiki-stale-propagation.mdDaily metadata scan for wiki pages whose builds-on sources changed after last-reviewed.
wiki-source-refreshreferences/job-wiki-source-refresh.mdWeekly two-tier refresh check: HEAD-only quick check at stale_threshold_days/4, full refresh-must-rediscover at stale_threshold_days.
wiki-graveyardreferences/job-wiki-graveyard.mdMonthly stale/orphan/archive-candidate scan.
wiki-coverage-auditreferences/job-wiki-coverage-audit.mdQuarterly cross-zone coverage scan and permissive cluster-drift INFO reporting.

Step 4a: Cross-repo-reference preflight (node-job boundary)

Boundary contract for node jobs: a BCOS node job's world is its own repo. Its _run script paths and its _claude_step prose MUST resolve inside $CLAUDE_PROJECT_DIR. Reading or writing a sibling repo from a node dispatcher tick is a boundary violation — siblings live in their own dispatcher and their own git history; reaching across blurs ownership and produces drift the framework cannot reconcile. (The umbrella dispatcher is the only legitimate cross-sibling reader; even it must not write outside its host. See umbrella-dispatcher/SKILL.md for the asymmetric rule.)

Before running each job in Step 4, scan the job spec (the entire job-{name}.md body) for cross-repo references:

  1. ../ path segments anywhere in _run script paths, _claude_step prose, or inline shell snippets.

  2. Absolute paths that do not start with $CLAUDE_PROJECT_DIR, $HOME/.claude/, $BCOS_PY, or /tmp/ (the standard sandboxed prefixes).

  3. Known sibling-repo names. If .bcos-umbrella.json exists at the repo root, parse its siblings[].id list (or projects[].id if the umbrella ships that shape) and treat each id as a forbidden substring in _run/_claude_step. Fallback: when .bcos-umbrella.json is absent (standalone BCOS install with no umbrella), preflight reduces to the ../ + absolute-path scans — no sibling-name list to check against.

If the preflight matches any of the three rules, skip the job for this tick and emit a typed node-job-cross-repo-reference finding (category: "bcos-framework", verdict red, emitted_by: "dispatcher"):

{
  "finding_type": "node-job-cross-repo-reference",
  "finding_attrs": {
    "job": "{job_id}",
    "offending_path": "{first matched substring}",
    "location": "_run" | "_claude_step" | "spec_prose"
  }
}

Log a corresponding verdict: "error" diary entry with notes: "preflight: cross-repo reference '{offending_path}' in {location}". Continue with the next job. Step 4c routes the finding through stickiness compute and Step 7c appends it to bcos-framework-issues.jsonl — same handling shape as job-reference-missing.

Why preflight rather than runtime detection: by the time a job's _run is invoked, a cross-repo write may have already mutated sibling state. Static scan before execution is the only point where the framework can refuse cleanly without partial side effects.

Coordination with umbrella dispatcher. The umbrella's audit_node_configs.py (BCOS Phase 4) sweeps every registered sibling's schedule-config.json for this same drift class as a portfolio-level diagnostic. Both emitters use this finding_type so the Command Center can deduplicate.


Step 4b: Completion Checklist — every scheduled job MUST produce a verdict

After Step 4 completes (last job returned), verify that every job listed in Step 2's run-list produced exactly one diary entry in this dispatcher tick. This is the silent-skip guard: a job whose reference file is missing, whose runner threw before the try/except could catch it, or that was implicitly forgotten by Claude during execution must NOT disappear unnoticed.

  1. Build expected_jobs = the ordered list from Step 2 (jobs marked due today + on-demand overrides).

  2. Read back the diary entries appended during this tick (use the dispatcher's in-memory record, or the tail of .claude/hook_state/schedule-diary.jsonl filtered to the current run's ts prefix if you're running on-demand).

  3. For each job in expected_jobs, confirm a diary entry exists. If any job is missing:

    • Append a verdict: "error" diary entry for it with "notes": "job skipped silently — no completion record produced".

    • Schema 1.1.0+: emit a typed dispatcher-silent-skip finding (category: "bcos-framework", verdict red, emitted_by: "dispatcher") into the in-memory findings list — Step 4c will then route it through stickiness compute and Step 7c will append it to bcos-framework-issues.jsonl. finding_attrs = {job: "{job_id}", expected_after: "{tick_start_ts}", last_diary_ts: "{tail_ts}" | null, missing_artifact: null}. This replaces the prose action-item; the dashboard renders it as an acknowledge-only card with "Reported to BCOS" footer.

    • Set the overall dispatcher verdict to red (silent skips are critical — they mean the safety surface lied).

Do NOT proceed to Step 5 (auto-fixes) until the checklist passes. A silent skip on a destructive job (lifecycle-sweep auto-routing, wiki-archive-expired-post-mortem, etc.) would let policy violations land unannounced; better to halt and surface.

Rationale. This was added after a 2026-05-05 incident where a command-center-schedules-snapshot job silently dropped out of a tick, leaving the downstream dashboard 24h stale with no error trail. Dispatcher behavior is now: "every scheduled job either completes with a verdict or surfaces as a red error — no third path."


Step 4c: Compute Headline + Finding Stickiness

Added in schema 1.1.0. Before applying auto-fixes (Step 5) or rendering the digest (Step 7), enrich each finding emitted in Step 4 with three computed fields and produce the run's headline string. This step is the load-bearing source of the dashboard's stuck-badge UX — without it, every dispatcher tick re-emits findings as if they were fresh and the user has no signal that a problem is recurring.

Inputs: raw findings from Step 4, last 30 diary entries (already read in Step 3), the classifier in references/finding-categories.md.

Per-finding enrichment

For each Finding in the in-memory findings list:

  1. Resolve category by looking up finding_type in the classifier table in finding-categories.md. Default: repo-context if unmapped (sidecars stay backward-compat with 1.0.0 emitters). Any unmapped ID is a contract violation — emit a schema-validation-failed framework finding alongside.

  2. Compute the finding-identity tuple (finding_type, primary_attr_value, emitted_by) — the primary_attr key per finding_type is in finding-categories.md's classifier tables. For singletons (no per-instance primary key, e.g. lessons-count-high) use the string "singleton".

  3. Match against prior tick. Scan diary entries from the immediately-prior dispatcher tick (the most-recent run before today, identified by the latest ts < today's run window). If any prior finding has the same identity tuple:

    • consecutive_runs = prior.consecutive_runs + 1

    • first_seen = prior.first_seen (preserve)

  4. No match → fresh finding.

    • consecutive_runs = 1

    • first_seen = today (ISO YYYY-MM-DD)

  5. Strict reset semantics. If the identity tuple appeared 2 ticks ago but NOT in the immediately-prior tick, it's a fresh finding (consecutive_runs = 1). One missing tick resets — the dispatcher does not "remember" through gaps. Rationale: a finding that disappeared and came back is a different incident than one that never went away; treating them the same would mask intermittent flicker.

  6. Stuck severity override. When consecutive_runs >= 3, mark severity_override = "stuck" in-memory (the renderer in Step 7 picks this up; the sidecar JSON also gets a severity_override field if present).

  7. Acknowledge-only routing for framework findings. If category == "bcos-framework", force suggested_actions = ["acknowledge"]. The job may have proposed other actions; the dispatcher overrides. Framework findings never get Fix buttons.

If the diary is empty or insufficient (< 1 prior tick available), every finding gets consecutive_runs = 1, first_seen = today. The count auto-corrects on subsequent runs.

Headline computation

The headline is a single sentence rendered at the top of both the .md digest (Step 7) and the chat echo. Computed deterministically from the enriched findings + per-job verdicts:

Run shapeHeadline template
Green clean (0 findings, 0 framework)"{Nth consecutive green run.}{recovery callout if any job verdict flipped error→green this tick.}"
Green with frequency suggestions only"All {N} jobs green. {M} frequency suggestions to consider." + recovery callout if any
Amber, no stuck"{N} action items{; M auto-fixed if M>0}{; recovery callout if any}."
Amber WITH stuck (>=1 finding with consecutive_runs >= 3)"{N} stuck — oldest from {first_seen of oldest stuck finding}. Will not resolve on its own."
Red (any critical / silent-skip / framework red)"{N} critical: {top finding's display label}{; '+M other' if N>1}."
Error (>=1 job verdict='error')"{N} jobs errored: {first errored job's name}{; '+M other' if N>1}."

Recovery callout = "lifecycle-sweep recovered (3 prior errors cleared)" or similar. Computed by scanning prior 3 diary entries for the same job_id with verdict in {"error", "red"} followed by today's "green".

The headline gets a new top-level field in the sidecar JSON: headline (string), added in 1.1.0.

Output

After Step 4c completes, the in-memory findings list has all 1.1.0 fields populated:

  • category (always)

  • first_seen (always)

  • consecutive_runs (always, ≥1)

  • severity_override (only when consecutive_runs >= 3)

  • suggested_actions (forced to ["acknowledge"] for framework category)

And the run has a headline string ready for Step 7.

Step 5 (auto-fix application) then operates only on category: "repo-context" findings. Framework findings are NEVER auto-fixable — the dispatcher refuses to apply any whitelisted fix that targets a framework path.


Step 5: Apply Auto-Fixes

The job references declare which fixes they're allowed to apply automatically. The dispatcher enforces policy:

  1. Read auto_fix.whitelist from config

  2. For each auto-fix proposed by a job, verify it's on the whitelist

  3. If allowed → the job already applied it; log in diary

  4. If NOT allowed → demote it to actions_needed in the report

See references/auto-fix-whitelist.md for the full list of recognised fix IDs and what each one does.

Never attempt a fix outside the whitelist, even if a job proposes it. That path is for user review.


Step 6: Generate Frequency-Tuning Suggestions

For each job run today, check recent diary:

  • 3 consecutive green runs with 0 findings → suggest reducing frequency by one step:

    • daily → weekdays

    • weekdays → mon (or similar)

    • mon → 1st

    • Any → off is never suggested

  • Findings trending up over last 3 runs → suggest increasing frequency one step

  • Last run was error → suggest investigating, not frequency change

Suggestions are just lines in the report. Prefix each line with 📉 for "reduce frequency" or 📈 for "increase frequency" so the direction is obvious at a glance. Format:

📉 daydream-deep has been green 3 runs running. Consider running it less often — tell me "run daydream-deep only on the 1st" and I'll update config.

📈 audit-inbox findings trending up over last 3 runs. Consider running it more often — tell me "run audit-inbox daily" and I'll update config.

Do NOT change the config automatically. The user must go through schedule-tune.


Step 7: Write Consolidated Digest

Schema 1.1.0+: the digest is rendered FROM the typed-event sidecar, not authored separately. The dispatcher writes two co-located artifacts:

  • docs/_inbox/daily-digest.json — typed-event sidecar (canonical, dashboard reads this; see typed-events.md)

  • docs/_inbox/daily-digest.md — markdown renderer of the same in-memory data (humans without a dashboard read this)

Both are overwritten each run. One file, always latest. History lives in the diary.

Field parity is non-negotiable. If the .md says "3 action items" the JSON findings[] must have 3 entries with category: "repo-context". The wiring test test_digest_typed_events.py asserts this; do not let them drift.

7.1 Markdown template

Fixed structure. Conditional sections render ONLY when their counts are non-zero — a green clean run is ~5 lines, an amber run with 5 findings is ~40 lines. Markdown tables for lists of ≥2 (eyes track columns faster than bullets). Single-item sections render as a one-line bullet.

# Daily Maintenance Digest — {YYYY-MM-DD}

**{🟢 green | 🟡 amber | 🔴 red | ⚠️ error}** · {N} ran · {findings-summary} · {K} auto-fixed · {duration}

**Headline:** {computed in Step 4c}

## ⚠️ Action needed ({count_repo_context_amber_red})

| # | Job | File / Target | Issue | Stickiness |
|---|---|---|---|---|
| 1 | `{emitted_by}` | `{primary_attr}` | {one-line meaning} | {`🔁 Nth run` if consecutive_runs ≥ 3, else blank} |
| 2 | ... | ... | ... | ... |

## 🔧 Auto-fixed ({count})

- ✓ `{fix_id}` on `{target}` ({detail})
- ✓ ...

## 🔧 BCOS framework issues ({count_bcos_framework})

> **Acknowledge-only.** These are framework bugs reported for transparency. Do not attempt to fix in this repo — `update.py` would overwrite. The framework owner is responsible for these.

| # | Finding | Detail | First seen |
|---|---|---|---|
| 1 | `{finding_type}` | {primary_attr_value} | {first_seen} |

## 📊 Jobs ({N})

| Job | | Findings | Note |
|---|---|---|---|
| {job} | {🟢 green / 🟡 amber / 🔴 red / ⚠️ error} | {finding_count} | {`📉 suggest weekly` / `✅ recovered` / `🔁 stuck` as applicable} |
| ... | ... | ... | ... |

## 💡 Suggestions ({M}) — say "tune schedule"

- 📉 `{job}` {current_schedule} → {suggested_schedule} · {reason}
- 📈 ...

---
Run at {ISO timestamp} · `.claude/hook_state/schedule-diary.jsonl`
Auto-commit: {✓ committed (sha) | ✗ skipped (reason)}
7.2 Section-render rules
SectionRendered whenNotes
Verdict barAlwaysSingle line; emoji + counts + duration. {findings-summary} shape: if framework findings count is 0, render "{M} findings" (single number). If ≥1 framework finding, render split form "{M_repo} repo · {M_framework} framework" so the user immediately sees the split. Either way, total = M_repo + M_framework.
HeadlineAlwaysOne sentence from Step 4c
⚠️ Action needed≥1 repo-context finding with verdict amber/redTable for ≥2 rows; single-line bullet for exactly 1
🔧 Auto-fixed≥1 auto_fixed[] entryBullet list (rare to exceed 5)
🔧 BCOS framework issues≥1 category: "bcos-framework" findingSeparated block with acknowledge-only banner — never folded into Action needed
📊 JobsAlways (always ≥1 job ran)Table; verdict emoji + finding count + inline status markers in Note column
💡 Suggestions≥1 frequency-suggestion findingBullet list
FooterAlwaysRun timestamp, diary path, auto-commit status

Inline status markers in the Jobs table (Note column):

MarkerWhen
📉 suggest weekly (or similar)A frequency-suggestion finding targets this job
✅ recoveredThis job's prior 3 diary entries had error/red and today is green
🔁 stuck (Nx)This job has ≥1 finding with consecutive_runs ≥ 3; N = max consecutive_runs across its findings
7.3 Chat-echo (3-line compact card per scenario)

After writing the .md file, echo a FIXED 3-line markdown block to the chat output. Do not improvise. The block is what every Claude Code dashboard session card shows; deterministic formatting keeps the dashboard scannable across repos.

The shape is always:

**{verdict-emoji} {repo-or-portfolio-name} {state}** · {ran} ran · {findings} findings · {fixed} fixed
{top-line: ONE sentence — usually identical to the .md headline}
→ {action hint with concrete commands the user can say}

The third line ALWAYS gives the user a concrete next action. Pick the hint per scenario:

ScenarioVerdict bar exampleTop lineAction hint
Green clean**🟢 BCOS green** · 1 ran · 0 findings · 0 fixed · 4sHeadline string from Step 4c, e.g. "10th consecutive green run."→ Nothing to act on. Say "mark read" or ignore.
Green with suggestions**🟢 BCOS green** · 9 ran · 0 findings · 0 fixed · 5mAll 9 jobs green. 3 frequency suggestions emitted.→ Say "tune schedule" / "show suggestions" / "ignore".
Amber, no stuck**🟡 BCOS amber** · 9 ran · 2 findings · 0 fixedTop: {finding type} on {primary_attr}{; +N other}.→ Say "fix it" / "show digest" / "mark read".
Amber WITH stuck**🟡 BCOS stuck** · 9 ran · 3 findings (2 stuck)2 findings unresolved 3+ runs — won't resolve on their own.→ Say "fix it" / "show stuck" / "snooze 7d".
Red critical / silent-skip**🔴 BCOS red** · 5 ran · 2 repo · 1 framework{finding_type} on {primary_attr}{; +N other}.→ Open daily-digest.md for the safety surface. Say "retry" / "investigate".
Error (job crashed)**⚠️ BCOS error** · 9 scheduled, 7 clean, 2 errored{first errored job} {error message snippet}{; +N other}.→ Say "retry failed jobs" / "show errors" / "skip".

The verdict bar's {findings-summary} segment uses the same split rule as Step 7.2 — "3 findings" when zero framework, "2 repo · 1 framework" when ≥1 framework.

When framework findings present (regardless of scenario), append ONE extra line BEFORE the action hint:

⚠️ {N} BCOS framework issue{s} logged (acknowledge-only — the framework maintainer will fix in the next release)

This is the cleanest possible chat surface for the user across all dispatcher invocations. The full detail lives in docs/_inbox/daily-digest.md; the chat just orients and hands off.


Step 7b: Auto-Commit Generated Artifacts (default on, clean-tree only)

If digest.auto_commit is true in schedule-config.json (default: true as of schema 1.2.0; see template _about for the rationale), commit the generated artifacts so the next session starts from a clean tree and the diary/index are versioned.

Branch allowlist (skip commit on short-lived feature branches):

  1. Read digest.auto_commit_branches from schedule-config.json. Default: ["main", "master", "dev", "develop"].

  2. Run git rev-parse --abbrev-ref HEAD to get the current branch.

  3. If the current branch is not in the allowlist → skip the commit entirely. Still write the digest file to disk (so it's available locally), but record auto_commit: skipped (branch {name} not in allowlist) in the digest. The user's feature-branch PR diff stays clean of unrelated digest commits; the next session on a long-lived branch picks up the digest naturally.

  4. If the current branch IS in the allowlist → proceed to the clean-tree rule below.

Per-tick ALLOWED set (outputs-per-job model, schema 1.2.0+):

The set of paths the dispatcher is permitted to auto-commit on this tick is computed dynamically:

TICK_ALLOWED = GLOBAL_ALLOWED  ∪  ⋃ job.outputs (for every job that ran this tick with verdict ≠ skipped)

Where:

  • GLOBAL_ALLOWED is the small hardcoded list of framework files that are written outside any specific job (by helpers, the dispatcher itself, or the digest writer):

    • docs/_inbox/daily-digest.md

    • docs/_inbox/daily-digest.json

    • docs/.session-diary.md

    • docs/.wake-up-context.md

    • docs/.onboarding-checklist.md

    • .claude/hook_state/schedule-diary.jsonl

    • .claude/quality/ecosystem/state.json

    • .claude/quality/context-index.json

  • job.outputs is read from the corresponding entry in schedule-config.json jobs.<name>.outputs (a list of paths and/or globs). Each references/job-<name>.md spec MUST also declare the matching ## Outputs section — the spec is the contract, the config is the live wiring.

  • A job that wrote no artifacts (or whose verdict is skipped / error) contributes nothing — its declared outputs are NOT eligible this tick. This is the per-tick safety property: a stray hand-edit to a "generated" file on a day its owning job did not run still blocks auto-commit.

Validation of outputs: entries (enforced at parse time; on violation, skip auto-commit for the tick and emit a job-outputs-validation-error framework-finding):

  • Must be relative paths.

  • Must lie inside docs/ or .claude/ (no _collections/ — evidence is never auto-committed; no repo-root files).

  • No .. segments. No absolute paths.

  • Maximum 20 literal entries + 5 globs per job.

  • Globs are resolved against git status --porcelain paths (same surface the clean-tree rule already inspects). Rename entries appear as R old -> new; the parser splits on -> and treats the destination as the candidate path. A glob that should match a renamed file must match the destination path; the source path is ignored. (This matches the intent: outputs declare where the job wrote, not where files used to live.)

Backward-compat (soft, silence-preserving): if a job runs and has no outputs: key in schedule-config.json (or the references/job-*.md spec lacks an ## Outputs section), treat its outputs as []. Emit the job-missing-outputs-declaration framework-finding only when the job's run would have changed at least one path outside GLOBAL_ALLOWED (i.e. a path that could have been auto-committable had it been declared). Jobs that ran but produced no committable-shaped writes stay silent — no day-1 finding flood on first sync into downstream repos. The dispatcher keeps functioning; the maintainer is nudged via the daily digest only when the missing declaration actually mattered this tick.

Emission shape (schema 1.3.0+). The finding carries suggested_actions: ["promote-outputs"] so the cockpit / interactive Claude-side renderer can offer a one-click chip. finding_attrs is {job: str, undeclared_paths: str[]} per typed-events.md. The chip routes to the right writer by inspecting emitted_by:

  • emitted_by: "dispatcher" → invokes business-context-os-dev/.claude/scripts/promote_outputs.py --job <job> --paths <comma-joined>.

  • emitted_by: "umbrella-dispatcher" → invokes bcos-umbrella/scripts/promote_outputs.py (same CLI; adds asymmetric "must resolve inside umbrella repo root" validator on top).

See headless-actions.md promote-outputs for the full action contract.

Ignore-silencer pass (schema 1.3.0+). Before emitting a job-missing-outputs-declaration finding for a given (job, undeclared_paths) tuple, read .claude/quality/ecosystem/resolutions.jsonl (if it exists) and build:

IGNORED = { (row.finding_attrs.job, path) : path ∈ row.finding_attrs.undeclared_paths
            for row in resolutions
            where row.action_taken == "promote-outputs"
              and row.outcome == "ignored"
              and (now() - row.ts) <= outputs_ignore_window_days (default 30) }

Filter undeclared_paths by (job, path) ∉ IGNORED. If the filtered list is empty, do not emit the finding for that job at all. The window is configurable via digest.outputs_ignore_window_days in schedule-config.json (default 30). This is the cash-out for the chip's "No, ignore" option — without it the chip would be decorative.

File-missing / parse-error tolerance: a missing resolutions.jsonl means IGNORED = ∅ (silent). A malformed line is skipped with a data-corruption-detected framework finding emitted for the file (per Step 7c's normal pattern); the silencer pass continues with the remaining rows.

Clean-tree rule:

  1. Run git status --porcelain. Collect all changed paths.

  2. Compute TICK_ALLOWED per the formula above.

  3. If every changed path is in TICK_ALLOWED → proceed to commit. Otherwise → skip the commit entirely. Do not stage, do not branch. Record auto_commit: skipped (tree not clean outside generated artifacts) in the digest, listing the unexpected paths. The user will see the dirty state next session and decide manually.

  4. On commit:

    • git add each path in TICK_ALLOWED that actually changed (never git add .).

    • git commit -m "bcos: daily maintenance {YYYY-MM-DD}" — no push, ever.

    • If commit fails (pre-commit hook, etc.), do not retry — record the error in the digest and continue.

  5. Never create a new branch. Never push. Never skip hooks.

This mirrors the update.py policy: "commit only if the tree is clean outside the files we own." The outputs-per-job model strengthens that guarantee — eligibility is per-tick, scoped to jobs that actually ran, so unrelated edits to nominally-generated files still pause the dispatcher.


Step 7c: Append BCOS-Framework Issues to Local Log

Added in schema 1.1.0. When this dispatcher tick produced any finding with category: "bcos-framework", append one JSONL line per such finding to .claude/hook_state/bcos-framework-issues.jsonl.

This local log is the producer side of the umbrella portfolio-aggregation contract (see portfolio-framework-issues-feed.md). Each sibling repo writes its own log; the umbrella's Command Center walker (opt-in, only when umbrella installed) reads and aggregates across siblings. A BCOS install with no umbrella still writes the log — it just sits locally until somebody (or the dashboard) reads it. No opt-out at the framework level: every sibling writes its own log on every tick when framework findings present. Transparent by default.

Line shape

One JSON object per line, written via the same append_diary.py atomic-append helper used for the diary (avoids the sensitive-file approval prompt on .claude/ writes):

{
  "ts": "2026-05-12T09:00:42Z",
  "run_at": "2026-05-12T09:00:00Z",
  "sibling_id": null,
  "finding_type": "dispatcher-silent-skip",
  "verdict": "red",
  "emitted_by": "dispatcher",
  "first_seen": "2026-05-12",
  "consecutive_runs": 1,
  "finding_attrs": { "...": "per typed-events.md shape" }
}

Fields:

  • ts — when the log line was appended (line-level timestamp; distinct from run_at)

  • run_at — when the dispatcher tick started (matches the sidecar's top-level run_at)

  • sibling_id — always null on the producer side. The umbrella walker fills this in when aggregating, prefixed with the sibling's project ID from .bcos-umbrella.json

  • finding_type, verdict, emitted_by, first_seen, consecutive_runs, finding_attrs — copied verbatim from the Finding in daily-digest.json

When NOT to write
  • Zero framework findings this tick → do not write anything to the file. The log only grows when something happened. (Reader code handles "file does not exist" as "no framework issues from this sibling".)

  • Framework finding categorised as repo-context by mistake (classifier bug) → do not write. Surface a schema-validation-failed framework finding instead and let the next tick correct.

Retention + size

Framework issues are append-only. Never trimmed by BCOS itself. The umbrella walker applies its own retention window (default 7 days for portfolio view) when reading — the underlying file keeps the full history for audit. Expected size: a clean dev cycle produces 0 lines; a single bug-cycle from emit → fix → next-update can produce up to 1 line per affected sibling per dispatcher tick. Realistically under 1MB per sibling per year.

Failure modes
  • File does not exist → create on first append (the helper handles this).

  • Write fails → log the failure as a NEW framework finding (framework-config-malformed with finding_attrs.parse_error = "log write failed: {message}") and continue. The dispatcher does NOT retry — repeated failures are caught by the next tick's safety surface.

  • Disk full → same as write fails. The dispatcher's job is to surface, not to ensure infinite reliability.


Step 8: Final Output — AskUserQuestion ONLY when there's something to decide

The last thing the dispatcher does depends on whether the run produced anything that needs user judgement. The goal is to make the Claude Code dashboard useful as a priority inbox: sessions that show up as "Awaiting input" (yellow) should genuinely need attention; sessions that show up as "Ready" (blue) should be bulk-dismissable.

The decision rule

End with AskUserQuestion IF any of these are true:

  • Any action items (amber or red verdict with non-empty actions_needed from any job)

  • Frequency-tuning suggestions emitted (see Step 6)

  • Any job errored (verdict error)

Otherwise — clean green run, zero findings, zero suggestions — output a short summary and stop. No question. The session marks itself "Ready" on the dashboard and the user can bulk-read-acknowledge it later.

Why this rule: if every run always asked a question, every scheduled run would show as "Awaiting input" in the dashboard even on clean days. The yellow marker would lose meaning. This rule makes "Awaiting input" a real signal.

Output for clean green runs (no question)

Short, affirmative, one or two lines:

Maintenance complete — verdict: 🟢 green. Nothing to act on.
(Full report: docs/_inbox/daily-digest.md)

Or even shorter when the user is watching an on-demand run:

🟢 Green — nothing to act on.

Stop. No question. Do not add "let me know if…" or "want me to…". The dashboard handles the follow-through.

Output when something needs attention

Short lead-in (2-4 lines max, above the question):

Maintenance complete — verdict: 🟡 amber.
3 findings, 2 auto-fixed. Full report: docs/_inbox/daily-digest.md

(Use 🔴 for red verdicts, ⚠️ for error.)

Then AskUserQuestion with a header under 12 chars (e.g. "Next step", "Maintenance") and 2-4 options tailored to what happened.

Option templates by scenario

The dispatcher chooses options based on the aggregate result. At least one option must be a concrete "DO something useful" action; at least one must be a way to dismiss/defer.

(The "green, no findings, no suggestions" case is NOT listed here because that case does not use AskUserQuestion — see the decision rule above.)

Green with frequency-tuning suggestions:

OptionWhen to use
Apply suggested changesdispatcher has a concrete config edit to propose
Show me the rationalewhy is the dispatcher suggesting this
Keep as-isdismiss suggestion

Amber with action items (non-critical):

OptionWhen to use
Walk me through action itemstriage them one by one
Show full digestsee everything at once
Dismiss for nowacknowledge, handle later

Red with critical items:

OptionWhen to use
Work through critical itemstop priority, start now
Show full digestsee the context around the critical items
Snooze — I'll handle soonthe critical items are acknowledged but user is busy

Error (a job crashed):

OptionWhen to use
Retry the failed job(s)second chance — transient issue
Show me the error detaildiagnose before retrying
Skip — investigate laterdefer
Chip wiring: promote-outputs (schema 1.3.0+)

When the tick produced one or more job-missing-outputs-declaration findings (each carrying suggested_actions: ["promote-outputs"]), surface ONE AskUserQuestion question per (job, undeclared_paths) tuple — these are concrete fix points, not aggregate "walk me through" candidates. Header ≤12 chars (e.g. "Promote outputs"). Question body template:

Auto-commit skipped this tick — job `<job>` wrote <paths> but those weren't declared
in its `outputs:`. Promote them into the job's declaration?

Options (two only — no one-shot override):

OptionWhat it does
Yes, alwaysInvoke .claude/scripts/promote_outputs.py --job <job> --paths <comma-joined> (or umbrella mirror, per emitted_by). On success, write one resolutions.jsonl row via record_resolution.py with action_taken: promote-outputs, outcome: applied.
No, ignoreWrite one resolutions.jsonl row via record_resolution.py with action_taken: promote-outputs, outcome: ignored. The Step 7b silencer suppresses re-emit on the same (job, path) for outputs_ignore_window_days (default 30 days).

Both options end the question cleanly — no follow-up loop. Subsequent findings (other jobs, other action types) get their own questions.

Rules for option wording
  • Keep each option under 40 characters

  • Start with a verb ("Work through", "Show", "Dismiss") — user reads what they'll GET by clicking

  • Never duplicate effort: if "show full digest" is already in chat, don't also offer "read the file"

  • Never ask about things the user can't directly action from here. ("Do you want architecture review to run weekly?" is too abstract — schedule-tune handles that)

  • If the user picks "Walk me through action items", the dispatcher follows up by loading the first action item and asking what to do about it — NOT by dumping them all

What happens after the user picks

Route to the right behavior:

  • Walk me through action items → load the first action item from the digest, explain it, ask what to do (fix, defer, needs-info). Loop until all handled or user dismisses.

  • Show full digest → open/display docs/_inbox/daily-digest.md content in chat, then re-ask the original question with updated options (drop "show digest", keep actions)

  • Apply suggested changes → invoke schedule-tune skill with the exact proposed config edit

  • Tune schedule → invoke schedule-tune skill in interactive mode ("what would you like to change?")

  • Retry the failed job(s) → re-run only the errored jobs (on-demand mode), then ask again with the new result

  • Dismiss / Snooze / Done, thanks → single-line acknowledgement, exit cleanly. Do NOT offer further questions in this cycle — the user chose to stop.

Example
Maintenance complete — verdict: amber.
3 findings, 2 auto-fixed. Full report: docs/_inbox/daily-digest.md

Then AskUserQuestion:

  • question: "Maintenance found 3 things needing your attention. What next?"

  • header: "Next step"

  • options:

    • Walk me through them

    • Show full digest

    • Dismiss for now

If the user picks "Walk me through them", the dispatcher continues with the first action item. The flow is always structured choice → guided next action, never "here's a list, good luck."


On-Demand Mode

If the user says "run the {job-name} job now" or "run today's maintenance now":

  1. Skip the schedule predicate — run only the named job(s)

  2. Append (do not overwrite) results to docs/_inbox/daily-digest.md under a clearly marked section:

    ---
    
    ## On-demand run — {HH:MM} ({job-name})
    
    **Verdict:** {🟢 green|🟡 amber|🔴 red|⚠️ error} — {findings} findings, {fixed} auto-fixed.
    
    ### ⚠️ Action needed
    - ...
    
    ### 🔧 Auto-fixed
    - ...

    If daily-digest.md does not yet exist (no scheduled run happened today), create it with a minimal header before appending the on-demand section.

  3. Do NOT emit frequency-tuning suggestions (one-off runs don't produce a reliable cadence signal)

  4. DO append a diary entry per job with "trigger":"on-demand" so the run is tracked in history

  5. Report a short summary inline in chat

  6. Follow the same decision rule as Step 8: end with AskUserQuestion only if there are action items or an error. Clean green on-demand runs end with a one-line confirmation ("Green — nothing to act on.") and stop. When a question IS asked, typical on-demand options:

    • Walk me through the findings

    • Run another job

    • Show the on-demand section of the digest

    • Done, thanks

The morning scheduled run always OVERWRITES daily-digest.md fresh — so yesterday's on-demand sections are not preserved in the digest (diary retains them). This keeps the digest a "today's story" file without unbounded growth.


Error Handling

The dispatcher is meant to survive imperfect repos:

  • Missing config → stop with a helpful error (see Preconditions)

  • Malformed config → emit framework-config-malformed typed finding (see Step 1), stop, don't guess

  • A job reference file is missing → emit job-reference-missing typed finding (category: "bcos-framework", verdict red, finding_attrs = {job: "{name}", expected_path: ".claude/skills/schedule-dispatcher/references/job-{name}.md"}), skip that job, log to diary, continue. The framework finding routes to bcos-framework-issues.jsonl via Step 7c.

  • A job spec contains a cross-repo reference (Step 4a preflight match) → emit node-job-cross-repo-reference typed finding (category: "bcos-framework", verdict red, finding_attrs = {job: "{name}", offending_path: "{first match}", location: "_run" | "_claude_step" | "spec_prose"}), skip that job, log to diary, continue.

  • A job errors → log "verdict":"error", continue. If the error originated in a framework-managed code path (auto-fix handler, dispatcher itself), also emit a auto-fix-handler-threw framework finding.

  • Diary file doesn't exist → create it, write the first entry

  • A JSONL loader reports _LAST_LOAD_REPORT.dropped > 0 → emit data-corruption-detected typed finding with the file path + dropped line count

Never silently swallow errors. Every dispatcher run produces either a digest OR a user-facing error message. Schema 1.1.0+: framework-level error conditions emit typed bcos-framework findings rather than prose-only notes, so they route through the same dashboard + portfolio aggregation surface as scheduled findings.


  • schedule-tune — user-facing skill for changing config ("run audit twice a week")

  • context-audit, daydream, lessons-consolidate — underlying skills the job references invoke


Notes for implementers

  • The dispatcher is a coordinator, not a doer. Actual work happens inside the job references. If a check is shared across multiple jobs, put it in references/ as a shared reference, not inline in the dispatcher.

  • Diary lines are atomic — one JSON object per line, no multiline entries, append-only.

  • Never delete or rewrite diary entries. If a run was wrong, add a corrective entry, don't mutate history.

  • Keep individual job runs under 2 minutes each if possible. The dispatcher session is time-bounded.

278 files · 9 not served here

Advantages

Limitations

  • Requires adherence to a specific folder structure and frontmatter schema to function correctly. evidence: README.md
  • Maintenance jobs and dispatcher functionality rely on Python and bash being available on the host system. evidence: README.md

Security

Risk level: Medium risk

This brain runs

Agent instructions that run or fetch something (170)

  • .claude/agents/wiki-fetch/AGENT.md: A 100k-token URL fetched into the main thread by `/wiki run` saturates the context window before a single page lands.
  • .claude/agents/wiki-fetch/AGENT.md: | Calling skill | Subcommand | Trigger | |---|---|---| | `bcos-wiki` | `run` Pass 1 | Each URL in the queue → one `wiki-fetch` invocation | | `bcos-wiki` | `refresh` full-tier | Source-summary past `stale_threshold_days` and HEAD signals changed | | `bcos-wiki` | `promote` (Path B) | S …[+132 chars] · uses the network
  • .claude/agents/wiki-fetch/AGENT.md: The cumulative budget guard ([`_wiki_budget.decide_dispatch_strategy`](../../scripts/_wiki_budget.py)) decides whether N sub-agents run in parallel or serial — `parallel` when projected cumulative tokens stay ≤ 80% of the main context limit;
  • .claude/agents/wiki-fetch/AGENT.md: queue an explicit retry tag for next run | | `error.kind: fetch-error` | 4xx/5xx from upstream | Surface to user;
  • .claude/agents/wiki-fetch/AGENT.md: `python .claude/scripts/test_wiki_fetch.py` — asserts this AGENT.md declares the documented input kinds and output fields, that the 4000-token cap is stated, that calling-skill docs reference both `wiki-fetch` and the Task tool, and that the result-schema validator + cumulative budget g …[+47 chars]
  • .claude/skills/bcos-wiki/SKILL.md: **`/wiki`** with subcommands: `init`, `init --defaults`, `run`, `queue`, `promote`, `create`, `review`, `archive`, `refresh`, `lint`, `remove`, `schema`, `search`
  • .claude/skills/bcos-wiki/SKILL.md: "Run the wiki refresh"
  • .claude/skills/bcos-wiki/SKILL.md: | | `run [<url>]` | implemented | P3 | Path A: batch (no arg) processes all `## Pending` queue items;
  • .claude/skills/bcos-wiki/SKILL.md: single (with URL) auto-queues + ingests | | `queue <url> [tags]` | implemented | P3 | Append URL to `## Pending` of `queue.md` without fetching | | `ingest` | shared protocol | P3 | Internal — called by `run`/`promote`/`create`;
  • .claude/skills/bcos-wiki/SKILL.md: optionally re-pull `builds-on` data points to verify | | `archive <slug>` | implemented | P3 | Soft-delete to `_wiki/.archive/` with dangling-reference scan | | `refresh <slug>` | implemented | P3 | Path A: re-fetch a `source-summary` page (refresh-must-rediscover applies, D-05 two-tie …[+470 chars]
  • .claude/skills/bcos-wiki/SKILL.md: `run` → `run.md`
  • .claude/skills/bcos-wiki/SKILL.md: Run `/wiki init` first."* and exit.
  • .claude/skills/bcos-wiki/SKILL.md: | Choice | Behavior | |---|---| | Init with defaults + proceed | Run `.claude/scripts/cmd_wiki_init.py` (or equivalent `ensure_wiki_zone.py` call).
  • .claude/skills/bcos-wiki/SKILL.md: Then resume the original subcommand (`create from`, `promote`, `run`, etc.) as if the Guard had passed.
  • .claude/skills/bcos-wiki/SKILL.md: | | Full interview + proceed | Read `init.md` and run the 6-question interactive scaffold.
  • .claude/skills/bcos-wiki/SKILL.md: The dispatched subcommand files (`create.md`, `promote.md`, `run.md`, `refresh.md`, `lint.md`, `archive.md`, `review.md`, `remove.md`, `schema.md`, `search.md`, `bundle.md`, `queue.md`) all reference *"the `.config.yml` Guard defined in `SKILL.md`"* — they inherit this AskUserQuestion p …[+46 chars]
  • .claude/skills/bcos-wiki/SKILL.md: The human reviews diffs and runs `git commit` / `git push` when ready. · uses the network
  • .claude/skills/bcos-wiki/SKILL.md: This applies to `run`, `refresh`, and `create` (when source content is large).
  • .claude/skills/bcos-wiki/SKILL.md: Users who want a binary in collections-as-evidence must run `/collections add` explicitly.
  • .claude/skills/bcos-wiki/SKILL.md: ├── run.md ← /wiki run [<url>]
  • .claude/skills/bcos-wiki/SKILL.md: ├── ingest.md ← shared ingest pipeline (called by run/promote/create/refresh)
  • .claude/skills/clear-planner/SKILL.md: Step 2: Run Discovery
  • .claude/skills/clear-planner/SKILL.md: { "step": 2, "name": "Run Discovery", "status": "in_progress" }
  • .claude/skills/clear-planner/SKILL.md: **Run all three discovery scripts:**
  • .claude/skills/clear-planner/SKILL.md: bash .claude/agents/agent-discovery/find_agents.sh
  • .claude/skills/clear-planner/SKILL.md: bash .claude/skills/skill-discovery/find_skills.sh
  • .claude/skills/clear-planner/SKILL.md: python .claude/scripts/find_lessons.py --tags "#{scenarioType}"
  • .claude/skills/clear-planner/SKILL.md: Run discovery scripts (Step 2 results)
  • .claude/skills/clear-planner/SKILL.md: | | ------------------- | ------------------------------------ | --------------------------------------------------------- | ------------------- | | Integration Audit | Detect stale references in ecosystem | `python .claude/scripts/analyze_integration.py --staged` + AI review | **YES …[+455 chars]
  • .claude/skills/clear-planner/SKILL.md: | Scenario | Key Requirement | | ----------------- | ------------------------------------------------------------------ | | **AGENTING** | Check for ecosystem overlaps + run integration audit before commit | | **DOCUMENTAT …[+76 chars]
  • .claude/skills/context-audit/SKILL.md: Run all five audit categories against the scoped files.
  • .claude/skills/context-audit/SKILL.md: python .claude/scripts/build_document_index.py
  • .claude/skills/context-ingest/SKILL.md: | Input shape | Dispatch to | Why | |-------------|-------------|-----| | HTTP/HTTPS URL (article, GitHub, YouTube) | `/wiki run <url>` (the `bcos-wiki` skill, Path A) | Wiki owns external-source ingest, banner citations, schema validation, refresh tier | | Path inside `docs/_inbox/` a …[+508 chars]
  • .claude/skills/context-ingest/SKILL.md: If the input is mixed (e.g. Slack export *and* a URL), do mine first, then handle the URL via `/wiki run` separately, then return to ingest for whatever's left.
  • .claude/skills/context-ingest/SKILL.md: Run `python .claude/scripts/build_document_index.py` after material changes
  • .claude/skills/context-ingest/SKILL.md: **→ Rebuild Document Index** — Always: `python .claude/scripts/build_document_index.py`
  • .claude/skills/context-ingest/SKILL.md: **→ context-audit** — If a new data point was created: "Want me to run a quick CLEAR audit on the new doc?"
  • .claude/skills/context-mine/SKILL.md: Recommend: "Run context-ingest to classify and route these items"
  • .claude/skills/context-onboarding/SKILL.md: | What you see | What you do | |---|---| | User shares a URL, pitch deck, or describes their business | Gather from those sources, ask 2-3 follow-ups if needed | | Repo already has docs/, README, markdown files with business content | Scan the repo, map what exists | | User drops files …[+394 chars] · uses the network
  • .claude/skills/context-onboarding/SKILL.md: Before anything else, run **once** per onboarding session to make sure the BCOS-managed instructions are present in `CLAUDE.md`.
  • .claude/skills/context-onboarding/SKILL.md: This catches the `git clone`-without-`install.sh` case: if `CLAUDE.md` exists but lacks the `<!-- BCOS:CORE:START -->` / `<!-- BCOS:CORE:END -->` markers, the framework section is missing or unstructured. · uses the network
  • .claude/skills/context-onboarding/SKILL.md: If `.claude/bcos-claude-reference.md` doesn't exist yet (fresh clone), point `--source` at the upstream template available in this repo's tree (the same file install.sh would have copied).
  • .claude/skills/context-onboarding/SKILL.md: **First-run routing principle:** onboarding is allowed to identify all BCOS zones, but it should only create active data points after the user approves the architecture.
  • .claude/skills/context-onboarding/SKILL.md: | Material | First-run handling | |---|---| | Canonical facts, current decisions, project/task/business reality | Draft active data points in `docs/*.md` | | Raw notes, unsorted snippets, uncertain material | Keep in `docs/_inbox/` until triaged | | Future ideas, plans, or maybes | Par …[+578 chars]
  • .claude/skills/context-onboarding/SKILL.md: Options: **Activate** (set all to active, run index + wake-up) / **Adjust** (tell me what to fix)
  • .claude/skills/context-onboarding/SKILL.md: Run `python .claude/scripts/build_document_index.py` to generate the Document Index with DOMAIN one-liners
  • .claude/skills/context-onboarding/SKILL.md: Run `python .claude/scripts/generate_wakeup_context.py` to generate the Wake-Up Context for instant session orientation
  • .claude/skills/context-onboarding/SKILL.md: The checklist ships with install at `docs/.onboarding-checklist.md`.
  • .claude/skills/context-onboarding/SKILL.md: Ensure the `.claude/hook_state/` directory exists (it usually does from install.sh — check and create if missing).
  • .claude/skills/context-onboarding/SKILL.md: the dispatcher will create it on first run.
  • .claude/skills/context-onboarding/SKILL.md: **Run the catalog drift guard:**
  • .claude/skills/context-onboarding/SKILL.md: python .claude/scripts/validate_permissions_catalog.py
  • .claude/skills/context-onboarding/SKILL.md: python .claude/scripts/update.py
  • .claude/skills/context-onboarding/SKILL.md: Re-run the validator to confirm clean.
  • .claude/skills/context-onboarding/SKILL.md: If the answer is "Yes, multi-repo" (or the user confirms after explanation), run:
  • .claude/skills/context-onboarding/SKILL.md: python .claude/scripts/install_global_permissions.py
  • .claude/skills/context-onboarding/SKILL.md: Question: "When should the morning dispatcher run?"
  • .claude/skills/context-onboarding/SKILL.md: Run the schedule-dispatcher skill to execute today's scheduled CLEAR maintenance. It will:
  • .claude/skills/context-onboarding/SKILL.md: 3. Execute each job in sequence, appending one diary entry per job
  • .claude/skills/context-onboarding/SKILL.md: The portfolio aggregator picks it up on the next dispatcher run.
  • .claude/skills/context-onboarding/SKILL.md: The dispatcher will run in the wrong directory and writes meant for this repo's `docs/_inbox/` will be blocked.
  • .claude/skills/context-onboarding/SKILL.md: If "Recreate", call `mcp__scheduled-tasks__delete_event` (or the equivalent delete tool) on the bad task, then re-run Step 6d.
  • .claude/skills/context-onboarding/SKILL.md: That's intentional — fresh setups should over-monitor for the first 1-2 weeks until the auto-tuner suggests reductions after green-run streaks.
  • .claude/skills/context-onboarding/SKILL.md: Let the user invoke the first run on their terms.
  • .claude/skills/context-onboarding/SKILL.md: A fresh install has nothing to migrate and should never see the word.
  • .claude/skills/core-discipline/SKILL.md: **Significant change** (restructure a cluster, create new skills) → use clear-planner, run the full workflow
  • .claude/skills/core-discipline/SKILL.md: | Task Type | Action | | ------------------------- | ---------------------- | | Questions, commands | Respond directly | | Single-file fixes | Just do it | | Small changes (1-3 files) | Think briefly, execute |
  • .claude/skills/core-discipline/SKILL.md: A scheduled dispatcher run finishes clean green with zero findings (one-line summary keeps the dashboard "Ready" status meaningful)
  • .claude/skills/core-discipline/SKILL.md: **Special case — wrapping scripts with built-in prompts** (like `update.py`'s `[y/N]` prompt): invoke the script with `--dry-run` first, parse the output, surface the summary via `AskUserQuestion`, then re-invoke with `--yes` based on the user's choice.
  • .claude/skills/daydream/SKILL.md: If the file doesn't exist, this is the first run — use 2 weeks ago as the baseline.
  • .claude/skills/daydream/SKILL.md: # Read last run timestamp (or default to 2 weeks ago)
  • .claude/skills/daydream/SKILL.md: cat .claude/quality/last-daydream.txt 2>/dev/null || echo "no previous run"
  • .claude/skills/daydream/SKILL.md: git log --since="{last_daydream_date}" --name-only --pretty=format:"%h %s (%ar)" -- docs/ ':!docs/_bcos-framework/methodology/' ':!docs/_bcos-framework/guides/' ':!docs/_bcos-framework/templates/'
  • .claude/skills/daydream/SKILL.md: Report "No document changes since last run" and skip to Phase 3 (Imagine) for forward-looking reflection only.
  • .claude/skills/daydream/SKILL.md: git diff {last_daydream_commit}..HEAD -- docs/path/to/changed-file.md
  • .claude/skills/daydream/SKILL.md: python .claude/scripts/build_document_index.py --dry-run
  • .claude/skills/daydream/SKILL.md: python .claude/scripts/generate_wakeup_context.py
  • .claude/skills/daydream/SKILL.md: **Step 5b: Run maintenance scripts**
  • .claude/skills/daydream/SKILL.md: Daydream is the natural time to run periodic maintenance:
  • .claude/skills/daydream/SKILL.md: python .claude/scripts/prune_sessions.py
  • .claude/skills/daydream/SKILL.md: python .claude/scripts/prune_diary.py
  • .claude/skills/daydream/SKILL.md: python .claude/scripts/generate_wakeup_context.py
  • .claude/skills/daydream/SKILL.md: python .claude/scripts/analyze_crossrefs.py
  • .claude/skills/daydream/SKILL.md: **Step 6: Record this run**
  • .claude/skills/daydream/SKILL.md: python .claude/scripts/record_daydream.py
  • .claude/skills/daydream/SKILL.md: **Document Index** — Run `python .claude/scripts/build_document_index.py` if files changed
  • .claude/skills/doc-lint/SKILL.md: If `.md`: Run markdown quality checks and cross-reference validation
  • .claude/skills/doc-lint/SKILL.md: If `.json`: Run JSON structure validation
  • .claude/skills/doc-lint/SKILL.md: Px_001: Run markdown quality check -> doc-lint (markdown category)
  • .claude/skills/doc-lint/SKILL.md: Px_002: Run example code validation -> doc-lint (cross_reference category)
  • .claude/skills/doc-lint/SKILL.md: Px_001: Run JSON structure validation -> doc-lint (json_structure category)
  • .claude/skills/doc-lint/SKILL.md: Px_002: Run markdown quality check -> doc-lint (markdown category)
  • .claude/skills/ecosystem-manager/SKILL.md: Run discovery to see what exists:
  • .claude/skills/ecosystem-manager/SKILL.md: bash .claude/agents/agent-discovery/find_agents.sh
  • .claude/skills/ecosystem-manager/SKILL.md: bash .claude/skills/skill-discovery/find_skills.sh
  • .claude/skills/ecosystem-manager/SKILL.md: Run it before committing.
  • .claude/skills/ecosystem-manager/SKILL.md: python .claude/scripts/analyze_integration.py --uncommitted
  • .claude/skills/ecosystem-manager/SKILL.md: Coverage gaps in install.sh, settings.json, state.json, .gitignore
  • .claude/skills/ecosystem-manager/SKILL.md: Add fix tasks to the plan and execute them before committing.
  • .claude/skills/ecosystem-manager/SKILL.md: [ ] **install.sh installs new files**
  • .claude/skills/ecosystem-manager/SKILL.md: Run after major development sessions or as part of monthly architecture review.
  • .claude/skills/ecosystem-manager/SKILL.md: Run `python .claude/scripts/wiki_schema.py list` to inspect page-types, lint-checks, and auto-fixes from `_wiki/.schema.yml` or the framework fallback.
  • .claude/skills/ecosystem-manager/SKILL.md: Run all 4 CI checks locally:
  • .claude/skills/ecosystem-manager/SKILL.md: python .github/scripts/validate_frontmatter.py # YAML metadata on all managed markdown
  • .claude/skills/ecosystem-manager/SKILL.md: python .github/scripts/validate_references.py # All registry paths resolve + state.json accuracy
  • .claude/skills/ecosystem-manager/SKILL.md: python .claude/scripts/analyze_integration.py --ci # Ecosystem wiring (install.sh, settings.json coverage)
  • .claude/skills/learning/SKILL.md: **Mechanism:** `python .claude/scripts/promote_resolutions.py` (the module's `__main__` calls `regenerate()`).
  • .claude/skills/learning/SKILL.md: Run the matching subcommand directly.
  • .claude/skills/lessons-consolidate/SKILL.md: python .claude/scripts/consolidate_lessons.py
  • .claude/skills/schedule-dispatcher/SKILL.md: Run `python .claude/scripts/update.py` first."
  • .claude/skills/schedule-dispatcher/SKILL.md: Report to the user: "schedule-config.json is malformed — fix before the dispatcher can run.
  • .claude/skills/schedule-dispatcher/SKILL.md: For each entry in `jobs`, decide if it should run today.
  • .claude/skills/schedule-dispatcher/SKILL.md: | `schedule` value | Runs when | |--------------------|----------------------------------------------------| | `"daily"` | Every day | | `"mon"`..`"sun"` | Only on that weekday …[+549 chars]
  • .claude/skills/schedule-dispatcher/SKILL.md: **For on-demand dispatch** (user said "run the audit-inbox job"): skip this step, run only the named job.
  • .claude/skills/schedule-dispatcher/SKILL.md: Build an ordered list of jobs to run.
  • .claude/skills/schedule-dispatcher/SKILL.md: python .claude/scripts/context_index.py --write
  • .claude/skills/schedule-dispatcher/SKILL.md: The cache TTL is 10 min (longer than a full dispatcher cycle), so all jobs in this run hit the same in-memory snapshot.
  • .claude/skills/schedule-dispatcher/SKILL.md: Last run timestamp per job?
  • .claude/skills/schedule-dispatcher/SKILL.md: Use the helper script — it creates `.claude/hook_state/` on first run and matches the allowlisted command prefix so it never prompts:
  • .claude/skills/schedule-dispatcher/SKILL.md: python .claude/scripts/append_diary.py '{"ts":"2026-04-15T09:04:12","job":"index-health","verdict":"green","findings_count":0,"auto_fixed":[],"actions_needed":[],"duration_s":4}'
  • .claude/skills/schedule-dispatcher/SKILL.md: **Fallback:** when `.bcos-umbrella.json` is absent (standalone BCOS install with no umbrella), preflight reduces to the `../` + absolute-path scans — no sibling-name list to check against.
  • .claude/skills/schedule-dispatcher/SKILL.md: After Step 4 completes (last job returned), verify that **every job listed in Step 2's run-list produced exactly one diary entry in this dispatcher tick**.
  • .claude/skills/schedule-dispatcher/SKILL.md: Read back the diary entries appended during this tick (use the dispatcher's in-memory record, or the tail of `.claude/hook_state/schedule-diary.jsonl` filtered to the current run's `ts` prefix if you're running on-demand).
  • .claude/skills/schedule-dispatcher/SKILL.md: **Added in schema 1.1.0.** Before applying auto-fixes (Step 5) or rendering the digest (Step 7), enrich each finding emitted in Step 4 with three computed fields and produce the run's headline string.
  • .claude/skills/schedule-dispatcher/SKILL.md: **Match against prior tick.** Scan diary entries from the **immediately-prior dispatcher tick** (the most-recent run before today, identified by the latest `ts` < today's run window).
  • .claude/skills/schedule-dispatcher/SKILL.md: | Run shape | Headline template | |---|---| | Green clean (0 findings, 0 framework) | "{Nth consecutive green run.}{recovery callout if any job verdict flipped error→green this tick.}" | | Green with frequency suggestions only | "All {N} jobs green.
  • .claude/skills/schedule-dispatcher/SKILL.md: And the run has a `headline` string ready for Step 7.
  • .claude/skills/schedule-dispatcher/SKILL.md: For each job run today, check recent diary:
  • .claude/skills/schedule-dispatcher/SKILL.md: **Last run was `error`** → suggest investigating, not frequency change
  • .claude/skills/schedule-dispatcher/SKILL.md: Both are overwritten each run.
  • .claude/skills/schedule-dispatcher/SKILL.md: Conditional sections render ONLY when their counts are non-zero — a green clean run is ~5 lines, an amber run with 5 findings is ~40 lines.
  • .claude/skills/schedule-dispatcher/SKILL.md: | 1 | `{emitted_by}` | `{primary_attr}` | {one-line meaning} | {`🔁 Nth run` if consecutive_runs ≥ 3, else blank} |
  • .claude/skills/schedule-dispatcher/SKILL.md: Run at {ISO timestamp} · `.claude/hook_state/schedule-diary.jsonl`
  • .claude/skills/schedule-dispatcher/SKILL.md: verdict emoji + finding count + inline status markers in Note column | | `💡 Suggestions` | `≥1` `frequency-suggestion` finding | Bullet list | | Footer | Always | Run timestamp, diary path, auto-commit status |
  • .claude/skills/schedule-dispatcher/SKILL.md: | Scenario | Verdict bar example | Top line | Action hint | |---|---|---|---| | Green clean | `**🟢 BCOS green** · 1 ran · 0 findings · 0 fixed · 4s` | `Headline string from Step 4c, e.g. "10th consecutive green run."` | `→ Nothing to act on.
  • .claude/skills/schedule-dispatcher/SKILL.md: Run `git rev-parse --abbrev-ref HEAD` to get the current branch.
  • .claude/skills/schedule-dispatcher/SKILL.md: This is the per-tick safety property: a stray hand-edit to a "generated" file on a day its owning job did not run still blocks auto-commit.
  • .claude/skills/schedule-dispatcher/SKILL.md: Globs are resolved against `git status --porcelain` paths (same surface the clean-tree rule already inspects).
  • .claude/skills/schedule-dispatcher/SKILL.md: **Emit the `job-missing-outputs-declaration` framework-finding only when** the job's run would have changed at least one path *outside* `GLOBAL_ALLOWED` (i.e. a path that *could* have been auto-committable had it been declared).
  • .claude/skills/schedule-dispatcher/SKILL.md: Run `git status --porcelain`.
  • .claude/skills/schedule-dispatcher/SKILL.md: `git commit -m "bcos: daily maintenance {YYYY-MM-DD}"` — no push, ever.
  • .claude/skills/schedule-dispatcher/SKILL.md: A BCOS install with no umbrella still writes the log — it just sits locally until somebody (or the dashboard) reads it.
  • .claude/skills/schedule-dispatcher/SKILL.md: The last thing the dispatcher does depends on whether the run produced anything that needs user judgement.
  • .claude/skills/schedule-dispatcher/SKILL.md: Otherwise — clean green run, zero findings, zero suggestions — output a short summary and stop.
  • .claude/skills/schedule-dispatcher/SKILL.md: **Why this rule:** if every run always asked a question, every scheduled run would show as "Awaiting input" in the dashboard even on clean days.
  • .claude/skills/schedule-dispatcher/SKILL.md: Or even shorter when the user is watching an on-demand run:
  • .claude/skills/schedule-dispatcher/SKILL.md: ("Do you want architecture review to run weekly?" is too abstract — `schedule-tune` handles that)
  • .claude/skills/schedule-dispatcher/SKILL.md: **Retry the failed job(s)** → re-run only the errored jobs (on-demand mode), then ask again with the new result
  • .claude/skills/schedule-dispatcher/SKILL.md: If the user says "run the {job-name} job now" or "run today's maintenance now":
  • .claude/skills/schedule-dispatcher/SKILL.md: Skip the schedule predicate — run only the named job(s)
  • .claude/skills/schedule-dispatcher/SKILL.md: ## On-demand run — {HH:MM} ({job-name})
  • .claude/skills/schedule-dispatcher/SKILL.md: If `daily-digest.md` does not yet exist (no scheduled run happened today), create it with a minimal header before appending the on-demand section.
  • .claude/skills/schedule-dispatcher/SKILL.md: DO append a diary entry per job with `"trigger":"on-demand"` so the run is tracked in history
  • .claude/skills/schedule-dispatcher/SKILL.md: Run another job
  • .claude/skills/schedule-dispatcher/SKILL.md: The morning scheduled run always OVERWRITES `daily-digest.md` fresh — so yesterday's on-demand sections are not preserved in the digest (diary retains them).
  • .claude/skills/schedule-dispatcher/SKILL.md: Every dispatcher run produces either a digest OR a user-facing error message.
  • .claude/skills/schedule-dispatcher/SKILL.md: `schedule-tune` — user-facing skill for changing config ("run audit twice a week")
  • .claude/skills/schedule-dispatcher/SKILL.md: If a run was wrong, add a corrective entry, don't mutate history.
  • .claude/skills/schedule-tune/SKILL.md: If you haven't set up BCOS scheduling yet, run `context-onboarding` Step 6.
  • .claude/skills/schedule-tune/SKILL.md: **Utterances:** *"run audit twice a week"*, *"change daydream to every 3 days"*, *"switch architecture review to quarterly"*, *"run index-health on weekdays only"*, *"audit on Tuesdays and Fridays"*
  • .claude/skills/schedule-tune/SKILL.md: **Utterances:** *"run the dispatcher at 08:30"*, *"move morning maintenance to 07:00"*
  • .claude/skills/schedule-tune/SKILL.md: Update the actual scheduled task's cron via `mcp__scheduled-tasks__update_scheduled_task` — that's what actually moves the run
  • .claude/skills/schedule-tune/SKILL.md: **Utterances:** *"what's my maintenance schedule?"*, *"when does audit run?"*, *"is architecture-review enabled?"*
  • .claude/skills/schedule-tune/SKILL.md: If the user proposes a cron that would run more than once per day, refuse: *"Dispatcher is designed to run once daily.
  • .claude/skills/schedule-tune/SKILL.md: | User says | Config edit | |----------------------------------------|----------------------------------------------------------------| | "run audit on Tuesday instead of Friday" | `jobs.audit-inbox.schedu …[+1012 chars]
  • .claude/skills/todo-utilities/SKILL.md: **Sequential Agent Invocation** — Tasks run one after another
  • CLAUDE.md: **Small changes (1-3 files)** — think briefly, execute.
  • CLAUDE.md: Auto-generated by `python .claude/scripts/generate_wakeup_context.py`.
  • CLAUDE.md: When unsure, run `context-ingest` and let it propose the route.
  • CLAUDE.md: **Post-work handoffs:** After integrating new content, offer to (a) rebuild the document index, (b) update related data points, (c) run an audit if architecture shifted.

Hooks (5)

  • .claude/settings.json (Stop): bash "$CLAUDE_PROJECT_DIR/.claude/hooks/auto_save_session.sh"
  • .claude/settings.json (PreCompact): bash "$CLAUDE_PROJECT_DIR/.claude/hooks/precompact_save.sh"
  • .claude/settings.json (PostToolUse): "$CLAUDE_PROJECT_DIR/.claude/bin/python3" "$CLAUDE_PROJECT_DIR/.claude/hooks/post_edit_frontmatter_check.py"
  • .claude/settings.json (PostToolUse): "$CLAUDE_PROJECT_DIR/.claude/bin/python3" "$CLAUDE_PROJECT_DIR/.claude/hooks/post_edit_frontmatter_check.py"
  • .claude/settings.json (PostToolUse): "$CLAUDE_PROJECT_DIR/.claude/bin/python3" "$CLAUDE_PROJECT_DIR/.claude/hooks/post_commit_context_check.py"

Install scripts (1)

  • install.sh: sh install.sh
  • Medium risk: runs-instruction-instruction-network (.claude/agents/wiki-fetch/AGENT.md:93)
  • Medium risk: runs-instruction-instruction-network (.claude/skills/bcos-wiki/SKILL.md:150)
  • Medium risk: runs-instruction-instruction-network (.claude/skills/context-onboarding/SKILL.md:33)
  • Medium risk: runs-instruction-instruction-network (.claude/skills/context-onboarding/SKILL.md:50)
  • Low risk: scripts-present (.claude/agents/agent-discovery/find_agents.sh)
  • Low risk: scripts-present (.claude/bin/python3)
  • Low risk: scripts-present (.claude/hooks/auto_save_session.sh)
  • Low risk: scripts-present (.claude/hooks/post_commit_context_check.py)
  • Low risk: scripts-present (.claude/hooks/post_edit_frontmatter_check.py)
  • Low risk: scripts-present (.claude/hooks/precompact_save.sh)
  • Low risk: scripts-present (.claude/scripts/analyze_crossrefs.py)
  • Low risk: scripts-present (.claude/scripts/analyze_integration.py)
  • Low risk: scripts-present (.claude/scripts/append_diary.py)
  • Low risk: scripts-present (.claude/scripts/audit_node_configs.py)
  • Low risk: scripts-present (.claude/scripts/auto_fix_audit.py)
  • Low risk: scripts-present (.claude/scripts/bcos_inventory.py)
  • Low risk: scripts-present (.claude/scripts/build_document_index.py)
  • Low risk: scripts-present (.claude/scripts/cmd_wiki_archive.py)
  • Low risk: scripts-present (.claude/scripts/cmd_wiki_init.py)
  • Low risk: scripts-present (.claude/scripts/cmd_wiki_lint.py)
  • Low risk: scripts-present (.claude/scripts/cmd_wiki_queue_add.py)
  • Low risk: scripts-present (.claude/scripts/cmd_wiki_remove.py)
  • Low risk: scripts-present (.claude/scripts/cmd_wiki_review.py)
  • Low risk: scripts-present (.claude/scripts/cmd_wiki_search.py)
  • Low risk: scripts-present (.claude/scripts/consolidate_lessons.py)
  • Low risk: scripts-present (.claude/scripts/context_bundle.py)
  • Low risk: scripts-present (.claude/scripts/context_index.py)
  • Low risk: scripts-present (.claude/scripts/context_search.py)
  • Low risk: scripts-present (.claude/scripts/digest_sidecar.py)
  • Low risk: scripts-present (.claude/scripts/find_lessons.py)
  • Low risk: scripts-present (.claude/scripts/generate_wakeup_context.py)
  • Low risk: scripts-present (.claude/scripts/install_global_permissions.py)
  • Low risk: scripts-present (.claude/scripts/lifecycle_sweep.py)
  • Low risk: scripts-present (.claude/scripts/load_task_profiles.py)
  • Low risk: scripts-present (.claude/scripts/load_zone_registry.py)
  • Low risk: scripts-present (.claude/scripts/promote_resolutions.py)
  • Low risk: scripts-present (.claude/scripts/prune_diary.py)
  • Low risk: scripts-present (.claude/scripts/prune_sessions.py)
  • Low risk: scripts-present (.claude/scripts/record_daydream.py)
  • Low risk: scripts-present (.claude/scripts/record_resolution.py)
  • Low risk: scripts-present (.claude/scripts/refresh_ecosystem_state.py)
  • Low risk: scripts-present (.claude/scripts/refresh_wiki_index.py)
  • Low risk: scripts-present (.claude/scripts/run_wiki_canonical_drift.py)
  • Low risk: scripts-present (.claude/scripts/run_wiki_coverage_audit.py)
  • Low risk: scripts-present (.claude/scripts/run_wiki_graveyard.py)
  • Low risk: scripts-present (.claude/scripts/run_wiki_source_refresh.py)
  • Low risk: scripts-present (.claude/scripts/run_wiki_stale_propagation.py)
  • Low risk: scripts-present (.claude/scripts/scan_docs_structure.py)
  • Low risk: scripts-present (.claude/scripts/set_profile.sh)
  • Low risk: scripts-present (.claude/scripts/update.py)

Attribution and licence

First committed by
GitHub avatar of walm00walm00
Publisher
Guntis Coders (Community)
Source
walm00/business-context-os · commit 4635683
Licence
MIT License (files served here)
  • ATTRIBUTION.md (written by AutoGineer)
Synced
Contributors
walm00

AutoGineer is not affiliated with or endorsed by walm00.

Install from source

9 of its files are not served here, so there is no ZIP. walm00/business-context-os at 4635683