feat(monitoring): add business_diagnostic v0.1 — scenario ledger and calibration (#338) - #344
Draft
mrmasa88 wants to merge 3 commits into
Draft
feat(monitoring): add business_diagnostic v0.1 — scenario ledger and calibration (#338)#344mrmasa88 wants to merge 3 commits into
mrmasa88 wants to merge 3 commits into
Conversation
…extras, examples (ARPAHLS#338)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)