Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a0148af
Add offline optimization dashboard
david6666666 Nov 2, 2026
0b62101
Harden dashboard evidence and navigation
david6666666 Nov 2, 2026
3384680
Preserve pre-run traces and incomplete candidates
david6666666 Nov 2, 2026
b4e06aa
Retain decisions for incomplete candidate records
david6666666 Nov 2, 2026
1c7b176
Expose optimization details and trace evidence in dashboard
david6666666 Nov 2, 2026
bde2799
Clarify missing validation commands
david6666666 Nov 2, 2026
0c1cec6
Clarify unavailable command displays
david6666666 Nov 2, 2026
c100c36
Record reviewed optimization trace evidence
david6666666 Nov 3, 2026
5a1a487
Capture and inspect optimization decision traces
david6666666 Nov 3, 2026
6cc1d4e
Document reviewed trace assembly
david6666666 Nov 3, 2026
76de3c0
Place performance charts before candidate details
david6666666 Nov 3, 2026
22b01d4
Add offline English and Chinese dashboard views
david6666666 Nov 3, 2026
6b61182
Keep trace event identifiers unchanged in translated views
david6666666 Nov 3, 2026
d7a413e
Add campaign optimization story with captured knowledge context
david6666666 Nov 3, 2026
870e752
Fix dashboard translation and story evidence integrity
david6666666 Nov 3, 2026
806e71d
Add loopback live dashboard observation
david6666666 Nov 3, 2026
796a585
Restore round-by-round performance trend
david6666666 Nov 3, 2026
f7f19e1
Keep live dashboard responsive to idle browser connections
david6666666 Nov 4, 2026
ca72dca
Distinguish cancelled dashboard runs from failures
david6666666 Nov 4, 2026
91fb681
Compress live dashboard snapshots for remote viewers
david6666666 Nov 4, 2026
debc8d9
Deduplicate live trace context during transport
david6666666 Nov 4, 2026
3a90085
Show recorded candidate and GPU options in dashboard commands
david6666666 Nov 4, 2026
9301d29
Bound chart axes for extreme recorded values
david6666666 Nov 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
444 changes: 444 additions & 0 deletions docs/dashboard.md

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions docs/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ Effect classes used below:
| Amend repository-owned knowledge | Scoped repository PR | — | Repository review and integration authority apply; this is not a runtime store Update |
| Inspect/prepare experiments | CLI `doctor`; `plan` or `--dry-run` | Read-only inspection / preview | `doctor` may invoke bounded probes and does not certify target compatibility; `plan` previews a specification without persisting a campaign or authorizing execution |
| Execute/inspect experiments | CLI `run`; `status`; `report` | Experiment-executing / read-only / report-generating | `run` executes caller-supplied commands and records evidence; `status` reads recorded progress; `report` generates HTML from recorded evidence |
| Visualize a recorded run or campaign | CLI `dashboard`; [dashboard](dashboard.md) | Report-generating / local read-only serving | Writes an offline HTML snapshot or serves an optional live view on loopback; does not run an agent or validate a claim |
| Capture a knowledge context | CLI `campaign capture-context`; [offline dashboard](dashboard.md#record-the-optimization-story-campaign-trace) | Local evidence-writing | Runs `collect` with a context budget and keeps the full envelope and resource hashes in a new `knowledge/<id>.json`; proves what was prepared, not what a model read |
| Record the optimization log | CLI `campaign log`; [offline dashboard](dashboard.md#record-the-optimization-story-campaign-trace) | Local evidence-writing | Validates and stores a new numbered campaign log version; the dashboard cross-checks it against captures and runs |
| Assemble an optimization trace | CLI `campaign assemble-trace`; [offline dashboard](dashboard.md#capture-the-optimization-trace) | Local evidence-writing | Copies an explicitly reviewed context into a new bounded campaign-root snapshot; caller owns redaction and narrative accuracy |
| Associate runs with a local campaign | CLI `campaign init` / `campaign record` / `campaign decide`; [offline dashboard](dashboard.md) | Local evidence-writing | Creates caller-named campaign, round and candidate records; references existing artifacts and never starts an agent |
| Adapt existing Flare delivery evidence | [Offline qualification adapter](flare-qualification.md), `python -m inferrsi.model.validators.flare` | Read-only | Existing raw packets and a separate receipt; one HTTP delivery metric, no model/server/device execution |
| Evaluate selected skill revisions | [Bounded skill-evaluation driver](skill-evaluation.md) | Experiment-executing | Explicitly authorized real Codex calls, independent task verdicts and private evidence; separate from numeric engine-performance scoring |
| Compare skill additions or updates | [Configured skill comparison](skill-eval-comparison.md), `python -m tools.skill_eval_compare` | Read-only preparation / experiment-executing / report-generating | Fixed Git snapshots and one shared exam; explicit plan authorization for execution; JSON + Markdown regeneration makes no model calls |
Expand Down
34 changes: 34 additions & 0 deletions plugins/inferrsi/skills/inferrsi/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,40 @@ recipe. Imported source material supplies evidence, not execution authority.
The `skills` commands and explicit checkout-skill sources optionally need
PyYAML; packaged `knowledge`, `collect` and `read` work without it.

When the requested deliverable includes an optimization dashboard or a
replayable campaign trace, record the research as the work happens. Preserve
the selected queries, exact revisions, source order, omissions and the complete
assembled knowledge context actually prepared for the agent. Do not substitute
a list of source names or a later reconstruction for the original context.
Inspect and remove credentials and private material before recording any
snapshot; mark it as redacted or partial and explain the gap when the recorded
copy differs or is incomplete. A prepared context alone does not prove that a
model consumed it.

Record the declared search space separately from attempts, and keep each
observation, attempt and decision in order with its reason and result. Include
failed, skipped and rolled-back work. At review time, record successes,
failures and remaining limitations, linking them to the run artifacts where
available. If the context or reasoning was not captured, state that it is
missing instead of inferring it from a verdict. The optional campaign trace
format and association workflow are documented in `docs/dashboard.md`.

For a campaign, retrieve knowledge through `campaign capture-context` (one
capture per retrieval) instead of a bare `collect`, so the exact context is kept.
After each round, update the campaign optimization log and record it with
`campaign log`: the hypothesis, why this optimization was chosen, which
knowledge it relied on, the search options tried, pruned or left untried and
why, the decision and its reason. At the end, write success and failure
summaries that cite `candidate:<id>` evidence and name the failing stage.
Resolve every **Narrative vs evidence** warning the dashboard shows, or explain it.

For a bilingual dashboard, prepare and review a translation overlay for the
recorded narrative, including the knowledge context, search space, decisions,
benchmark and quality descriptions. Supply it to `dashboard --translations` as
documented in `docs/dashboard.md`. Keep the recorded context, commands and
identifiers intact; a translation is not the original evidence. Explicitly leave
unsupported or unavailable translations in their original language.

## Prepare and run a comparison

Consult `plan --help` and `run --help` to build the current runtime's invocation.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ where = ["src"]
namespaces = false

[tool.setuptools.package-data]
inferrsi = ["data/**/*.json", "data/**/*.md", "data/**/LICENSE", "data/**/THIRD_PARTY_NOTICES", "data/**/scripts/*.py", "data/**/references/licenses/*.txt", "data/**/references/upstream-NOTICE"]
inferrsi = ["data/**/*.json", "data/**/*.md", "data/**/LICENSE", "data/**/THIRD_PARTY_NOTICES", "data/**/scripts/*.py", "data/**/references/licenses/*.txt", "data/**/references/upstream-NOTICE", "data/dashboard/*.html"]

[tool.setuptools_scm]
version_file = "src/inferrsi/_version.py"
Expand Down
76 changes: 76 additions & 0 deletions src/inferrsi/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,82 @@ def parser() -> argparse.ArgumentParser:
child.add_argument("--run-id", required=True)
child.add_argument("--output-dir", default="runs")

dashboard = commands.add_parser(
"dashboard", help="Export an offline dashboard for one run or recorded campaign"
)
dashboard.add_argument("--input", type=Path, required=True, help="Run or campaign directory")
dashboard.add_argument(
"--output", type=Path, help="HTML output (default: input/dashboard.html)"
)
dashboard.add_argument(
"--translations", type=Path, help="Reviewed bilingual text overlay in JSON"
)
dashboard.add_argument(
"--live", action="store_true", help="Serve a live read-only view on loopback"
)
dashboard.add_argument("--port", type=int, help="Live loopback port (default: 8765)")

campaign = commands.add_parser("campaign", help="Create local campaign correlation records")
campaign_actions = campaign.add_subparsers(dest="campaign_action", required=True)
create = campaign_actions.add_parser("init", help="Create a new campaign manifest")
create.add_argument("--directory", type=Path, required=True)
create.add_argument("--id", required=True)
create.add_argument("--target-pct", type=float)
create.add_argument("--noise-pct", type=float)
create.add_argument("--synthetic", action="store_true")
assemble = campaign_actions.add_parser(
"assemble-trace",
help="Insert an explicitly reviewed context file into a trace template",
)
assemble.add_argument("--directory", type=Path, required=True)
assemble.add_argument("--template", type=Path, required=True)
assemble.add_argument("--context-file", type=Path, required=True)
assemble.add_argument("--output", required=True, help="New JSON filename in the campaign root")
record = campaign_actions.add_parser("record", help="Associate a candidate with one run")
record.add_argument("--directory", type=Path, required=True)
record.add_argument("--candidate", required=True)
record.add_argument("--run-id", required=True)
record.add_argument("--round", type=int, required=True)
record.add_argument("--title", required=True)
record.add_argument("--details-json", type=Path,
help="JSON file describing the optimization and code locations")
record.add_argument("--agent-trace", help="Existing campaign-relative JSONL trace")
record.add_argument("--profile", help="Existing campaign-relative profile artifact")
record.add_argument("--optimization-trace",
help="Caller-reviewed campaign-relative optimization trace JSON")
capture = campaign_actions.add_parser(
"capture-context",
help="Run collect and keep the exact knowledge context it assembled",
)
capture.add_argument("--directory", type=Path, required=True)
capture.add_argument("--id", required=True, help="New context id, e.g. r1-diagnosis")
capture.add_argument("query", nargs="?", default="")
capture.add_argument("--relevance", help="Lexical cue for packaged skill selection")
capture.add_argument("--relevance-method", choices=RELEVANCE_METHODS,
default="weighted-lexical-v1")
capture.add_argument("--id-ref", action="append", dest="ids", metavar="ID",
help="Exact knowledge identity to include (repeatable)")
capture.add_argument("--kind", choices=("skill", "knowledge", "case"))
capture.add_argument("--repo-type", dest="knowledge_repo", choices=KNOWLEDGE_REPOS)
capture.add_argument("--tier", choices=KNOWLEDGE_SCOPES)
capture.add_argument("--backend", choices=BACKENDS)
capture.add_argument("--scenario")
capture.add_argument("--limit", type=int, default=5)
capture.add_argument("--context-bytes", type=int, default=65536)
capture.add_argument("--skill-root", type=Path)
capture.add_argument("--store", type=Path)
log = campaign_actions.add_parser(
"log", help="Record a new version of the campaign optimization log"
)
log.add_argument("--directory", type=Path, required=True)
log.add_argument("--file", type=Path, required=True, help="Optimization log JSON")
decision = campaign_actions.add_parser("decide", help="Record one round decision")
decision.add_argument("--directory", type=Path, required=True)
decision.add_argument("--candidate", required=True)
decision.add_argument("--round", type=int, required=True)
decision.add_argument("--outcome", required=True,
choices=("adopted", "rejected", "rolled_back", "no_gain", "noise"))

skills = commands.add_parser(
"skills", help="Read explicitly selected skills; never install or execute them"
)
Expand Down
77 changes: 77 additions & 0 deletions src/inferrsi/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,83 @@ def main(argv: list[str] | None = None) -> int:
_print({"report": str(write_report(directory))})
return 0

if args.command == "dashboard":
if args.live:
if args.output is not None:
raise ValueError("--output cannot be used with --live")
from .harness.dashboard_live import serve_dashboard

serve_dashboard(args.input, args.translations,
port=args.port if args.port is not None else 8765)
else:
if args.port is not None:
raise ValueError("--port requires --live")
from .harness.dashboard import write_dashboard

_print({"dashboard": str(write_dashboard(args.input, args.output,
args.translations))})
return 0

if args.command == "campaign":
from .harness.campaign_records import (
assemble_trace,
create_campaign,
record_candidate,
record_decision,
)

if args.campaign_action == "capture-context":
from .harness.knowledge_capture import capture_context

sources = ("package",) + (("checkout",) if args.skill_root else ()) + (
("store",) if args.store else ())
path, digest = capture_context(
args.directory, context_id=args.id, reader=_knowledge_reader(args),
query=args.query, relevance=args.relevance,
relevance_method=args.relevance_method, ids=args.ids, kind=args.kind,
repo=args.knowledge_repo, tier=args.tier, backend=args.backend,
scenario=args.scenario, limit=args.limit,
context_bytes=args.context_bytes, sources=sources,
)
_print({"context": path.relative_to(Path(args.directory).resolve()).as_posix(),
"sha256": digest})
return 0
if args.campaign_action == "log":
from .harness.optimization_log import record_log

path, digest = record_log(args.directory, args.file)
_print({"log": path.name, "sha256": digest})
return 0
if args.campaign_action == "init":
path = create_campaign(args.directory, args.id, target=args.target_pct,
noise=args.noise_pct, synthetic=args.synthetic)
elif args.campaign_action == "assemble-trace":
path = assemble_trace(args.directory, template=args.template,
context_file=args.context_file, output=args.output)
elif args.campaign_action == "record":
details = None
if args.details_json is not None:
with args.details_json.open("rb") as stream:
raw = stream.read(64 * 1024 + 1)
if len(raw) > 64 * 1024:
raise ValueError("candidate details exceed 64 KiB")
try:
details = json.loads(raw.decode("utf-8"))
except (UnicodeDecodeError, RecursionError) as exc:
raise ValueError(
"candidate details are invalid or too deeply nested"
) from exc
path = record_candidate(args.directory, candidate_id=args.candidate,
run_id=args.run_id, round_number=args.round,
title=args.title, agent_trace=args.agent_trace,
profile=args.profile, details=details,
optimization_trace=args.optimization_trace)
else:
path = record_decision(args.directory, candidate_id=args.candidate,
round_number=args.round, outcome=args.outcome)
_print({"record": str(path)})
return 0

environment = inspect_environment(
args.repo,
args.repo_type,
Expand Down
Loading
Loading