feat(monitoring): add business_diagnostic v0.1 — scenario ledger and calibration (#338) - #344
feat(monitoring): add business_diagnostic v0.1 — scenario ledger and calibration (#338)#344mrmasa88 wants to merge 8 commits into
Conversation
…extras, examples (ARPAHLS#338)
|
@mrmasa88 this is excessive and quite deep work, probably your best first PR so far. <3 Some things to consider before we can merge: Offline demo, full v0.1 lifecycleExpand
Minor ripples to be addressed in the same PR after the above is in:
Catalog, two-action loop + all providers
Agent loops doc
Directive + catalog semantics to tighten honestyMirror in
Tests already solid, but re-run after the above. Also remove PR from work in progress / draft whe you done, so we can merge. <3 |
…p catalog, demo lifecycle, agent-loop section, directive semantics (ARPAHLS#344)
|
Thanks a lot! @rosspeili Round 1 addressed in one commit (
No changes to Warm regards, Masa |
|
Thanks @mrmasa88, LGTM. Before merge: merge/rebase After these tiny fixes we can merge as is, and I will prepare a v2 issue you can pick and upgrade on your own pace. <3 |
…ness_diagnostic # Conflicts: # docs/usage/install_extras.md
|
@rosspeili Thanks a lot! Synced with Warm regards, Masa |
|
Thanks, round 1 + Gemini sync look great, and the skill bundle is solid. #346 merged since your last sync, so the PR is conflicted again. Please merge/rebase
After that we can merge. v2 issue whenever you’re ready, and we can review together. <3 |
|
@rosspeili Hey! Synced with
One thing I noticed while resolving and left untouched here: after #347 the I'll open the v0.2 Skill Upgrade issue as soon as this merges — happy to review it together. Warm regards, Masa |
Closes #338
Scope
v0.1 only —
adjudicateandcalibrate. Stateless, stdlib-only, offline; schemas shipped as documentation with explicit runtime validation; fail-closed contract errors. Projections against declared targets and a report skeleton are out of scope here and will come as separate Skill Upgrade issues after this merges.Bundle (
skills/monitoring/business_diagnostic/)manifest.yaml,skill.py,instructions.md,card.json,__init__.pyschemas/— framework, marks, observations, outcome, output (documentation; runtime uses explicit checks)kb/demo_scenarios.json— synthetic framework, timestamped and sourcedfixtures/— E2E adjudicate/calibrate, honest state, one fixture per error codetest_skill.py— 36 offline tests: loader, manifest identity, E2E equality against fixtures, every error code from its fixture (registry set == fixture set), non-exhaustive update, negative observations, re-mark boundary, honest state, Brier trend ordering, identity without indicators, bit-identical repeat, no clock in sourceModeled on
monitoring/kpi_gate(#318).Repo ripples
docs/skills/business_diagnostic.md(catalog page) ·docs/skills/README.mdrow ·docs/usage/agent_loops.md·docs/usage/install_extras.md+pyproject.tomlextras (viascripts/sync_extras.py) ·tests/fixtures/card_ui_schema/monitoring__business_diagnostic.json·examples/business_diagnostic_demo.py(+ README, smoke test) · host-simulation stress discovery assert ·CHANGELOG.mdDeviations from the issue text (small, deliberate)
as_ofis a required input — the skill never reads the clock, so identical input returns identical output.status: error+error{code, detail}); thecontract_errors: []array in the issue's example is not used.marked_onor afteradjudication_dateare rejected — the ledger cannot double-count.INVALID_REQUESTenvelope code was added so thatUNKNOWN_ACTIONmeans exactly that. Validation order is fixed and documented.when:gates in chains (fired_any,marks_stale,insufficient).Tests
python3 -m pytest skills/monitoring/business_diagnostic tests/test_skill_issuer.py tests/test_registry_identity.py tests/test_card_ui_schema.py tests/test_registry_docs.py tests/test_extras_sync.py tests/test_examples_smoke.py -q→ 91 passedFull suite: 721 passed / 5 skipped.
black --checkandflake8clean;scripts/sync_extras.py --checkOK. Wheel smoke: run locally — 21 registry skills verified in the built wheel,monitoring/business_diagnosticloadable from a fresh base install, 4 unrelated skills deferred (optional extras not installed).Type of Change
skills/skills/skillware/core/loader, env, adaptersskillware/cli.py,docs/usage/cli.mdexamples/*.py, agent loops,examples/README.mdpyproject.toml,MANIFEST.inChecklist (all PRs)
Fixes #…orRefs #…)python -m black --check .andflake8pass locally (or CI-equivalent subset)pytest skills/andpytest tests/pass locally when relevantCHANGELOG.mdupdated under[Unreleased]when user-visible behavior changesexamples/README.mdupdated if this PR adds, renames, or removes a runnable scriptpytest tests/test_registry_docs.pywhen skills, examples index, or agent-loops matrix changedNew or updated skill
Bundle and metadata
skills/<category>/<skill_name>/(fromtemplates/python_skill/or equivalent)manifest.yaml:name(full ID),version,description,parameters,constitution, realissuershort_description,issuer.github,issuer.org,requirements,env_varsEffect, Directive, Assurance
skill.py(Effect; no ad-hoc LLM-generated execution paths)instructions.md(Directive) explains when and how to use the skillcard.json(Presentation) issuer matches manifest when presenttest_skill.py(Assurance) covers execution and schema expectationsSkillLoader.load_skill("<category>/<skill_name>")succeeds (or deps documented)Documentation and catalog
docs/skills/<skill_name>.mdand row indocs/skills/README.mdConstitution and safety (skills only)
Compute only: no data fetching, no network, no clock, no side effects. Operator marks are never overwritten; model-implied values are labeled as what the declared weights imply, not forecasts. Undeclared ids are contract errors; what cannot be computed honestly returns
insufficient_datawith a reason code.Related Issues
Closes #338 · Refs #318 (kpi_gate, the template for this bundle)