UCAgent 2.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ucagent/SKILL.md +55 -0
- ucagent/__init__.py +28 -0
- ucagent/__main__.py +12 -0
- ucagent/_version.py +24 -0
- ucagent/api.py +45 -0
- ucagent/applications/ToffeeUT/.gitignore +6 -0
- ucagent/applications/ToffeeUT/MANIFEST.in +4 -0
- ucagent/applications/ToffeeUT/README.md +40 -0
- ucagent/applications/ToffeeUT/docs/development.md +359 -0
- ucagent/applications/ToffeeUT/docs/examples/case-reports/README.md +32 -0
- ucagent/applications/ToffeeUT/docs/examples/case-reports/bug-review.md +42 -0
- ucagent/applications/ToffeeUT/docs/examples/case-reports/hpm/BUG-001-CASE-001-PID/350/277/221/344/274/274/345/214/271/351/205/215/345/257/274/350/207/264/345/244/232/350/256/241.md +140 -0
- ucagent/applications/ToffeeUT/docs/examples/case-reports/hpm/BUG-001-CASE-002-PSCID/350/277/221/344/274/274/345/214/271/351/205/215/345/257/274/350/207/264/345/244/232/350/256/241.md +140 -0
- ucagent/applications/ToffeeUT/docs/examples/case-reports/workflow-comparison.md +66 -0
- ucagent/applications/ToffeeUT/pyproject.toml +37 -0
- ucagent/applications/ToffeeUT/requirements.txt +7 -0
- ucagent/applications/ToffeeUT/scripts/mcp_client.py +102 -0
- ucagent/applications/ToffeeUT/scripts/setup_env.py +42 -0
- ucagent/applications/ToffeeUT/setup.py +26 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/Guide_Doc/ut-adoption.md +111 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/Guide_Doc/ut-bug-review.md +80 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/Guide_Doc/ut-contracts.md +191 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/Guide_Doc/ut-coverage.md +262 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/Guide_Doc/ut-environment.md +91 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/Guide_Doc/ut-methods.md +58 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/Guide_Doc/ut-project.md +177 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/Guide_Doc/ut-results.md +298 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/Guide_Doc/ut-stages.md +190 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/Guide_Doc/ut-static-review.md +53 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/Guide_Doc/ut-waveform.md +164 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/__init__.py +3 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/__main__.py +5 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/adoption.py +118 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/audit.py +528 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/bug_review.py +194 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/build.py +254 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/build_receipts.py +221 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/case_followup.py +555 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/case_history.py +240 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/case_pack.py +370 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/checkers.py +167 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/cli.py +80 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/coverage.py +389 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/coverage_preflight.py +182 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/handoff.py +182 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/implementation.py +336 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/layout.py +88 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/paths.py +165 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/plugin.py +272 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/preparation.py +20 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/process.py +47 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/project.py +225 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/pytest_plugin.py +279 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/reports.py +223 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/review_execution.py +421 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/review_intake.py +427 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/run_state.py +184 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/runner.py +478 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/skills/behavior-equivalence/SKILL.md +72 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/skills/checker-and-runtime/SKILL.md +87 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/skills/closure-and-residuals/SKILL.md +69 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/skills/independent-oracle/SKILL.md +67 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/skills/legal-stimulus/SKILL.md +73 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/skills/observation-precision/SKILL.md +86 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/skills/package-layout/SKILL.md +125 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/skills/requirements-boundary/SKILL.md +72 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/skills/rtl-verification-soundness/CARD.md +22 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/skills/rtl-verification-soundness/SKILL.md +30 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/skills/traceability-and-implementation/SKILL.md +74 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/skills/triage-and-evidence/SKILL.md +63 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/skills/ucv4xs-workflow/SKILL.md +97 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/skills/ucv4xs-workflow/references/LICENSE-MPL-2.0.txt +373 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/skills/ucv4xs-workflow/references/SOURCES.md +55 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/skills/ucv4xs-workflow/references/pending/README.md +19 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/skills/ucv4xs-workflow/references/pending/dependency-upgrade-and-capability-audit.md +56 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/skills/ucv4xs-workflow/references/pending/fixture-consolidation.md +51 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/skills/ucv4xs-workflow/references/pending/framework-capability-selection.md +49 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/skills/ucv4xs-workflow/references/pending/pin-schema-and-suite-migration.md +51 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/skills/verification-completeness/SKILL.md +50 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/source_review.py +140 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/sources.py +61 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/stage_audit.py +417 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/stage_checks/__init__.py +1 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/stage_checks/line_coverage.py +58 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/templates/project/docs/bugs/issue-template.md.j2 +86 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/templates/project/docs/spec/design/{{DUT}}.md.j2 +17 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/templates/project/docs/spec/verification/{{DUT}}.md.j2 +14 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/templates/project/pytest.ini.j2 +6 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/tools.py +594 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/waveform.py +354 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/workflows/adopt.yaml +77 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/workflows/bug_review.yaml +53 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/workflows/fix.yaml +36 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/workflows/review.yaml +36 -0
- ucagent/applications/ToffeeUT/src/toffee_ut/workflows/ut.yaml +853 -0
- ucagent/applications/ToffeeUT/ucagent-plugin.toml +4 -0
- ucagent/applications/UnitTest/MANIFEST.in +10 -0
- ucagent/applications/UnitTest/README.md +44 -0
- ucagent/applications/UnitTest/pyproject.toml +40 -0
- ucagent/applications/UnitTest/src/unit_test/Guide_Doc/dut_api_instruction.md +627 -0
- ucagent/applications/UnitTest/src/unit_test/Guide_Doc/dut_bug_analysis.md +947 -0
- ucagent/applications/UnitTest/src/unit_test/Guide_Doc/dut_fixture.md +436 -0
- ucagent/applications/UnitTest/src/unit_test/Guide_Doc/dut_function_coverage_def.md +328 -0
- ucagent/applications/UnitTest/src/unit_test/Guide_Doc/dut_functions_and_checks.md +389 -0
- ucagent/applications/UnitTest/src/unit_test/Guide_Doc/dut_line_coverage.md +349 -0
- ucagent/applications/UnitTest/src/unit_test/Guide_Doc/dut_line_func_map.md +115 -0
- ucagent/applications/UnitTest/src/unit_test/Guide_Doc/dut_mock.md +242 -0
- ucagent/applications/UnitTest/src/unit_test/Guide_Doc/dut_mock_test.md +148 -0
- ucagent/applications/UnitTest/src/unit_test/Guide_Doc/dut_test_case.md +478 -0
- ucagent/applications/UnitTest/src/unit_test/Guide_Doc/dut_test_case_random.md +75 -0
- ucagent/applications/UnitTest/src/unit_test/Guide_Doc/dut_test_program.md +383 -0
- ucagent/applications/UnitTest/src/unit_test/Guide_Doc/dut_test_summary.md +204 -0
- ucagent/applications/UnitTest/src/unit_test/Guide_Doc/dut_test_template.md +214 -0
- ucagent/applications/UnitTest/src/unit_test/Guide_Doc/env_spec_template.md +72 -0
- ucagent/applications/UnitTest/src/unit_test/__init__.py +1 -0
- ucagent/applications/UnitTest/src/unit_test/bug_analysis_contract.py +477 -0
- ucagent/applications/UnitTest/src/unit_test/checkers/__init__.py +49 -0
- ucagent/applications/UnitTest/src/unit_test/checkers/descriptions.py +241 -0
- ucagent/applications/UnitTest/src/unit_test/checkers/dut_source.py +182 -0
- ucagent/applications/UnitTest/src/unit_test/checkers/file_linemap.py +1272 -0
- ucagent/applications/UnitTest/src/unit_test/checkers/file_markdown.py +501 -0
- ucagent/applications/UnitTest/src/unit_test/checkers/increment.py +29 -0
- ucagent/applications/UnitTest/src/unit_test/checkers/mock_tests.py +241 -0
- ucagent/applications/UnitTest/src/unit_test/checkers/recorder.py +1292 -0
- ucagent/applications/UnitTest/src/unit_test/checkers/static_bug.py +1238 -0
- ucagent/applications/UnitTest/src/unit_test/checkers/test_cases.py +1306 -0
- ucagent/applications/UnitTest/src/unit_test/checkers/toffee_report.py +4527 -0
- ucagent/applications/UnitTest/src/unit_test/checkers/unit_test.py +1780 -0
- ucagent/applications/UnitTest/src/unit_test/checkers/unit_test_random.py +413 -0
- ucagent/applications/UnitTest/src/unit_test/checkers/vibe_workspace.py +59 -0
- ucagent/applications/UnitTest/src/unit_test/checkers/waveform.py +60 -0
- ucagent/applications/UnitTest/src/unit_test/checkers/workflow_docs.py +725 -0
- ucagent/applications/UnitTest/src/unit_test/coverage.py +91 -0
- ucagent/applications/UnitTest/src/unit_test/doc_marks.py +318 -0
- ucagent/applications/UnitTest/src/unit_test/lang/zh/config/bug_analysis_contract.json +68 -0
- ucagent/applications/UnitTest/src/unit_test/operations/__init__.py +1 -0
- ucagent/applications/UnitTest/src/unit_test/operations/waveform_replay.py +377 -0
- ucagent/applications/UnitTest/src/unit_test/plugin.py +187 -0
- ucagent/applications/UnitTest/src/unit_test/preparation.py +110 -0
- ucagent/applications/UnitTest/src/unit_test/presets/labeled_spec.yaml +39 -0
- ucagent/applications/UnitTest/src/unit_test/pytest_report.py +430 -0
- ucagent/applications/UnitTest/src/unit_test/report_store.py +153 -0
- ucagent/applications/UnitTest/src/unit_test/report_utils.py +305 -0
- ucagent/applications/UnitTest/src/unit_test/skills/create-test-case-templates/SKILL.md +79 -0
- ucagent/applications/UnitTest/src/unit_test/skills/create-test-case-templates/scripts/__init__.py +12 -0
- ucagent/applications/UnitTest/src/unit_test/skills/create-test-case-templates/scripts/createtemplate.py +159 -0
- ucagent/applications/UnitTest/src/unit_test/skills/dynamic-bug-recording/SKILL.md +107 -0
- ucagent/applications/UnitTest/src/unit_test/skills/dynamic-bug-recording/assets/bug_analysis_document.md +17 -0
- ucagent/applications/UnitTest/src/unit_test/skills/dynamic-bug-recording/assets/dynamic_bug_entry.md +26 -0
- ucagent/applications/UnitTest/src/unit_test/skills/dynamic-bug-recording/scripts/__init__.py +93 -0
- ucagent/applications/UnitTest/src/unit_test/skills/dynamic-bug-recording/scripts/record_dynamic_bug.py +2558 -0
- ucagent/applications/UnitTest/src/unit_test/skills/functions-and-checks/SKILL.md +205 -0
- ucagent/applications/UnitTest/src/unit_test/skills/functions-and-checks/scripts/update.py +310 -0
- ucagent/applications/UnitTest/src/unit_test/skills/mock-components/SKILL.md +96 -0
- ucagent/applications/UnitTest/src/unit_test/skills/mock-components/agents/openai.yaml +4 -0
- ucagent/applications/UnitTest/src/unit_test/skills/static-bug-analysis/SKILL.md +118 -0
- ucagent/applications/UnitTest/src/unit_test/skills/static-bug-analysis/scripts/__init__.py +13 -0
- ucagent/applications/UnitTest/src/unit_test/skills/static-bug-analysis/scripts/record_static_bug.py +558 -0
- ucagent/applications/UnitTest/src/unit_test/skills/static-bug-validation/SKILL.md +42 -0
- ucagent/applications/UnitTest/src/unit_test/skills/static-bug-validation/scripts/__init__.py +13 -0
- ucagent/applications/UnitTest/src/unit_test/skills/static-bug-validation/scripts/linkbug.py +634 -0
- ucagent/applications/UnitTest/src/unit_test/skills/test-case-implementation-in-batch/SKILL.md +216 -0
- ucagent/applications/UnitTest/src/unit_test/skills/test-case-implementation-in-batch/scripts/__init__.py +12 -0
- ucagent/applications/UnitTest/src/unit_test/str_utils.py +22 -0
- ucagent/applications/UnitTest/src/unit_test/templates/unit_test/.pytest.ini +7 -0
- ucagent/applications/UnitTest/src/unit_test/templates/unit_test/tests/test_example.py +21 -0
- ucagent/applications/UnitTest/src/unit_test/templates/unit_test/tests/test_{{DUT}}_random_example.py +18 -0
- ucagent/applications/UnitTest/src/unit_test/templates/unit_test/tests/{{DUT}}.ignore +13 -0
- ucagent/applications/UnitTest/src/unit_test/templates/unit_test/tests/{{DUT}}_api.py +150 -0
- ucagent/applications/UnitTest/src/unit_test/templates/unit_test/tests/{{DUT}}_function_coverage_def.py +39 -0
- ucagent/applications/UnitTest/src/unit_test/templates/unit_test/{{DUT}}_bug_analysis.md +17 -0
- ucagent/applications/UnitTest/src/unit_test/templates/unit_test/{{DUT}}_functions_and_checks.md +6 -0
- ucagent/applications/UnitTest/src/unit_test/templates/unit_test/{{DUT}}_line_coverage_analysis.md +11 -0
- ucagent/applications/UnitTest/src/unit_test/test_report.py +274 -0
- ucagent/applications/UnitTest/src/unit_test/test_runner.py +154 -0
- ucagent/applications/UnitTest/src/unit_test/test_utils.py +266 -0
- ucagent/applications/UnitTest/src/unit_test/testops.py +634 -0
- ucagent/applications/UnitTest/src/unit_test/waveform.py +6010 -0
- ucagent/applications/UnitTest/src/unit_test/waveform_formats/__init__.py +57 -0
- ucagent/applications/UnitTest/src/unit_test/waveform_formats/adapter_pywellen.py +224 -0
- ucagent/applications/UnitTest/src/unit_test/waveform_formats/adapter_wavekit.py +82 -0
- ucagent/applications/UnitTest/src/unit_test/waveform_formats/pagination.py +35 -0
- ucagent/applications/UnitTest/src/unit_test/waveform_formats/protocols.py +262 -0
- ucagent/applications/UnitTest/src/unit_test/waveform_formats/queries.py +66 -0
- ucagent/applications/UnitTest/src/unit_test/waveform_formats/read_fsdb.py +13 -0
- ucagent/applications/UnitTest/src/unit_test/waveform_formats/read_fst.py +36 -0
- ucagent/applications/UnitTest/src/unit_test/waveform_formats/read_usdb.py +366 -0
- ucagent/applications/UnitTest/src/unit_test/waveform_formats/read_vcd.py +80 -0
- ucagent/applications/UnitTest/src/unit_test/waveform_formats/registry.py +126 -0
- ucagent/applications/UnitTest/src/unit_test/workflows/base.yaml +417 -0
- ucagent/applications/UnitTest/src/unit_test/workflows/incremental.yaml +490 -0
- ucagent/applications/UnitTest/src/unit_test/workflows/unittest.yaml +1175 -0
- ucagent/applications/UnitTest/src/unit_test/workflows/vibe.yaml +115 -0
- ucagent/applications/UnitTest/ucagent-plugin.toml +4 -0
- ucagent/applications/__init__.py +1 -0
- ucagent/core/__init__.py +1 -0
- ucagent/core/agent/__init__.py +1 -0
- ucagent/core/agent/configuration.py +210 -0
- ucagent/core/agent/construction.py +426 -0
- ucagent/core/agent/execution.py +864 -0
- ucagent/core/agent/model_config.py +65 -0
- ucagent/core/agent/session.py +69 -0
- ucagent/core/agent/telemetry.py +39 -0
- ucagent/core/backends/__init__.py +39 -0
- ucagent/core/backends/assets/config_claude.yaml +25 -0
- ucagent/core/backends/assets/config_codex.yaml +71 -0
- ucagent/core/backends/assets/config_copilot.yaml +26 -0
- ucagent/core/backends/assets/config_kilo.yaml +20 -0
- ucagent/core/backends/assets/config_opencode.yaml +40 -0
- ucagent/core/backends/assets/config_qwen.yaml +18 -0
- ucagent/core/backends/assets/templates/claude.json.j2 +4 -0
- ucagent/core/backends/assets/templates/copilot.json.j2 +4 -0
- ucagent/core/backends/assets/templates/kilo.json.j2 +31 -0
- ucagent/core/backends/assets/templates/opencode.json.j2 +48 -0
- ucagent/core/backends/assets/templates/opencode_v2.json.j2 +55 -0
- ucagent/core/backends/assets/templates/qwen.json.j2 +29 -0
- ucagent/core/backends/base.py +270 -0
- ucagent/core/backends/blank.py +47 -0
- ucagent/core/backends/cmdline.py +663 -0
- ucagent/core/backends/langchain/__init__.py +3 -0
- ucagent/core/backends/langchain/agent.py +439 -0
- ucagent/core/backends/langchain/cancellation.py +215 -0
- ucagent/core/backends/langchain/content.py +76 -0
- ucagent/core/backends/langchain/middleware/__init__.py +2 -0
- ucagent/core/backends/langchain/middleware/execution.py +16 -0
- ucagent/core/backends/langchain/middleware/messages.py +1020 -0
- ucagent/core/checkers/__init__.py +4 -0
- ucagent/core/checkers/base.py +939 -0
- ucagent/core/checkers/bash_script.py +97 -0
- ucagent/core/interaction/__init__.py +38 -0
- ucagent/core/interaction/advanced.py +623 -0
- ucagent/core/interaction/enhanced.py +363 -0
- ucagent/core/interaction/orchestrator.py +404 -0
- ucagent/core/locales/zh.yaml +177 -0
- ucagent/core/multi_agent/__init__.py +1 -0
- ucagent/core/multi_agent/global_agent/__init__.py +5 -0
- ucagent/core/multi_agent/global_agent/business.py +37 -0
- ucagent/core/multi_agent/global_agent/catalog.py +90 -0
- ucagent/core/multi_agent/global_agent/contracts.py +49 -0
- ucagent/core/multi_agent/global_agent/display.py +21 -0
- ucagent/core/multi_agent/global_agent/duts.py +76 -0
- ucagent/core/multi_agent/global_agent/result.py +161 -0
- ucagent/core/multi_agent/global_agent/service.py +48 -0
- ucagent/core/multi_agent/global_agent/session_contracts.py +128 -0
- ucagent/core/multi_agent/global_agent/workflow.yaml +44 -0
- ucagent/core/multi_agent/mode.py +19 -0
- ucagent/core/multi_agent/super_agent/__init__.py +1 -0
- ucagent/core/multi_agent/super_agent/contracts.py +204 -0
- ucagent/core/multi_agent/super_agent/display.py +94 -0
- ucagent/core/multi_agent/super_agent/recovery.py +350 -0
- ucagent/core/multi_agent/super_agent/requirements.py +52 -0
- ucagent/core/multi_agent/super_agent/service.py +1500 -0
- ucagent/core/multi_agent/super_agent/supervisor.py +154 -0
- ucagent/core/multi_agent/super_agent/view.py +124 -0
- ucagent/core/multi_agent/super_agent/worker.py +551 -0
- ucagent/core/plugins.py +1516 -0
- ucagent/core/stage/__init__.py +4 -0
- ucagent/core/stage/display.py +181 -0
- ucagent/core/stage/history.py +190 -0
- ucagent/core/stage/llm_suggestion/__init__.py +34 -0
- ucagent/core/stage/llm_suggestion/base_suggestion.py +82 -0
- ucagent/core/stage/llm_suggestion/langchain_suggestion.py +304 -0
- ucagent/core/stage/vmanager.py +2007 -0
- ucagent/core/stage/vstage.py +1457 -0
- ucagent/core/stage/work.py +197 -0
- ucagent/core/tools/__init__.py +127 -0
- ucagent/core/tools/bash.py +144 -0
- ucagent/core/tools/context.py +54 -0
- ucagent/core/tools/delegation.py +145 -0
- ucagent/core/tools/extool.py +43 -0
- ucagent/core/tools/fileops.py +2171 -0
- ucagent/core/tools/global_agent.py +79 -0
- ucagent/core/tools/human.py +41 -0
- ucagent/core/tools/memory.py +178 -0
- ucagent/core/tools/planning.py +254 -0
- ucagent/core/tools/skill.py +579 -0
- ucagent/core/tools/uctool.py +642 -0
- ucagent/core/tools/workdiff.py +111 -0
- ucagent/core/workflow/__init__.py +1 -0
- ucagent/core/workflow/chain.py +175 -0
- ucagent/core/workflow/contracts.py +213 -0
- ucagent/core/workspace/__init__.py +1 -0
- ucagent/core/workspace/assets.py +416 -0
- ucagent/core/workspace/files.py +148 -0
- ucagent/core/workspace/permissions.py +74 -0
- ucagent/core/workspace/preparation.py +168 -0
- ucagent/interfaces/__init__.py +1 -0
- ucagent/interfaces/cli/__init__.py +1 -0
- ucagent/interfaces/cli/actions.py +212 -0
- ucagent/interfaces/cli/arguments.py +761 -0
- ucagent/interfaces/cli/attach.py +17 -0
- ucagent/interfaces/cli/options.py +325 -0
- ucagent/interfaces/cli/workspace_preparation.py +36 -0
- ucagent/interfaces/server/__init__.py +32 -0
- ucagent/interfaces/server/_pty_exec.py +12 -0
- ucagent/interfaces/server/api_cmd/__init__.py +8 -0
- ucagent/interfaces/server/api_cmd/file_routes.py +161 -0
- ucagent/interfaces/server/api_cmd/master_proxy.py +53 -0
- ucagent/interfaces/server/api_cmd/server.py +761 -0
- ucagent/interfaces/server/api_cmd/stage_routes.py +179 -0
- ucagent/interfaces/server/api_cmd/transport.py +151 -0
- ucagent/interfaces/server/api_cmd/waveform_routes.py +243 -0
- ucagent/interfaces/server/api_cmd/xpra.py +399 -0
- ucagent/interfaces/server/api_cmd/xpra_routes.py +211 -0
- ucagent/interfaces/server/api_master/__init__.py +6 -0
- ucagent/interfaces/server/api_master/client.py +351 -0
- ucagent/interfaces/server/api_master/common.py +804 -0
- ucagent/interfaces/server/api_master/compilation.py +687 -0
- ucagent/interfaces/server/api_master/launch_runtime.py +1494 -0
- ucagent/interfaces/server/api_master/managed.py +364 -0
- ucagent/interfaces/server/api_master/relaunch.py +780 -0
- ucagent/interfaces/server/api_master/routes.py +2278 -0
- ucagent/interfaces/server/api_master/server.py +2177 -0
- ucagent/interfaces/server/api_master/task_client.py +134 -0
- ucagent/interfaces/server/api_master/workspaces.py +1042 -0
- ucagent/interfaces/server/api_mcp.py +194 -0
- ucagent/interfaces/server/api_terminal.py +1478 -0
- ucagent/interfaces/server/fst_converter/.gitignore +1 -0
- ucagent/interfaces/server/fst_converter/Cargo.lock +253 -0
- ucagent/interfaces/server/fst_converter/Cargo.toml +18 -0
- ucagent/interfaces/server/fst_converter/README.md +25 -0
- ucagent/interfaces/server/fst_converter/src/bin/fst2vcd.rs +18 -0
- ucagent/interfaces/server/fst_converter/src/lib.rs +417 -0
- ucagent/interfaces/server/mcp_http.py +201 -0
- ucagent/interfaces/server/static/highlight-atom-one-dark.min.css +1 -0
- ucagent/interfaces/server/static/highlight.min.js +1213 -0
- ucagent/interfaces/server/static/marked.min.js +6 -0
- ucagent/interfaces/server/static/share/console-view.js +172 -0
- ucagent/interfaces/server/static/share/stage-view.js +53 -0
- ucagent/interfaces/server/static/share/ucagent-favicon.svg +17 -0
- ucagent/interfaces/server/static/share/ucagent-shell.css +245 -0
- ucagent/interfaces/server/static/share/ucagent-shell.js +273 -0
- ucagent/interfaces/server/static/surfer/NOTICE.md +13 -0
- ucagent/interfaces/server/static/surfer/deep-link.js +221 -0
- ucagent/interfaces/server/static/surfer/fst-converter.wasm +0 -0
- ucagent/interfaces/server/static/surfer/fst-fallback-worker.js +69 -0
- ucagent/interfaces/server/static/surfer/fst-fallback.js +380 -0
- ucagent/interfaces/server/static/surfer/index.html +307 -0
- ucagent/interfaces/server/static/surfer/integration.js +52 -0
- ucagent/interfaces/server/static/surfer/manifest.json +10 -0
- ucagent/interfaces/server/static/surfer/surfer.js +2284 -0
- ucagent/interfaces/server/static/surfer/surfer_bg.wasm +0 -0
- ucagent/interfaces/server/static/surfer/sw.js +37 -0
- ucagent/interfaces/server/static/surfer/ucagent-wave-ready.sucl +1 -0
- ucagent/interfaces/server/static/xterm/addon-fit.min.js +8 -0
- ucagent/interfaces/server/static/xterm/addon-web-links.min.js +8 -0
- ucagent/interfaces/server/static/xterm/xterm.min.css +8 -0
- ucagent/interfaces/server/static/xterm/xterm.min.js +8 -0
- ucagent/interfaces/server/templates/agent.html +3373 -0
- ucagent/interfaces/server/templates/complete.html +405 -0
- ucagent/interfaces/server/templates/launch.html +4316 -0
- ucagent/interfaces/server/templates/master.html +1525 -0
- ucagent/interfaces/server/templates/task.html +971 -0
- ucagent/interfaces/server/templates/terminal.html +279 -0
- ucagent/interfaces/server/templates/wave.html +23 -0
- ucagent/interfaces/server/templates/xpra.html +64 -0
- ucagent/interfaces/server/templates/xpra_client.html +23 -0
- ucagent/interfaces/server/templates/xpra_client.js +256 -0
- ucagent/interfaces/server/templates/xpra_view.html +50 -0
- ucagent/interfaces/server/worker_mcp.py +27 -0
- ucagent/interfaces/terminal/__init__.py +1 -0
- ucagent/interfaces/terminal/console.py +304 -0
- ucagent/interfaces/terminal/presentation.py +100 -0
- ucagent/interfaces/terminal/tui/__init__.py +17 -0
- ucagent/interfaces/terminal/tui/agent_screen.py +380 -0
- ucagent/interfaces/terminal/tui/agent_view.py +115 -0
- ucagent/interfaces/terminal/tui/app.py +293 -0
- ucagent/interfaces/terminal/tui/completion.py +109 -0
- ucagent/interfaces/terminal/tui/event_display.py +21 -0
- ucagent/interfaces/terminal/tui/global_app.py +281 -0
- ucagent/interfaces/terminal/tui/handlers.py +107 -0
- ucagent/interfaces/terminal/tui/mixins/__init__.py +5 -0
- ucagent/interfaces/terminal/tui/mixins/auto_scroll.py +56 -0
- ucagent/interfaces/terminal/tui/screens/__init__.py +5 -0
- ucagent/interfaces/terminal/tui/screens/confirmation.py +45 -0
- ucagent/interfaces/terminal/tui/screens/theme_picker.py +98 -0
- ucagent/interfaces/terminal/tui/styles/__init__.py +8 -0
- ucagent/interfaces/terminal/tui/styles/default.tcss +275 -0
- ucagent/interfaces/terminal/tui/utils.py +96 -0
- ucagent/interfaces/terminal/tui/widgets/__init__.py +18 -0
- ucagent/interfaces/terminal/tui/widgets/console.py +303 -0
- ucagent/interfaces/terminal/tui/widgets/console_input.py +331 -0
- ucagent/interfaces/terminal/tui/widgets/messages_panel.py +427 -0
- ucagent/interfaces/terminal/tui/widgets/recovery.py +177 -0
- ucagent/interfaces/terminal/tui/widgets/splitter.py +121 -0
- ucagent/interfaces/terminal/tui/widgets/status_bar.py +70 -0
- ucagent/interfaces/terminal/tui/widgets/task_panel.py +132 -0
- ucagent/launcher/__init__.py +1 -0
- ucagent/launcher/entry.py +91 -0
- ucagent/launcher/global_agent.py +67 -0
- ucagent/launcher/launch.py +163 -0
- ucagent/launcher/plan.py +82 -0
- ucagent/launcher/preparation.py +79 -0
- ucagent/launcher/prepare_workspace.py +70 -0
- ucagent/launcher/presets/zh/master.yaml +24 -0
- ucagent/launcher/workflow_handoff.py +199 -0
- ucagent/launcher/workspace.py +322 -0
- ucagent/runtime/__init__.py +1 -0
- ucagent/runtime/agent_events.py +142 -0
- ucagent/runtime/agent_sessions.py +408 -0
- ucagent/runtime/agent_view.py +53 -0
- ucagent/runtime/control/__init__.py +1 -0
- ucagent/runtime/control/commands.py +590 -0
- ucagent/runtime/control/controller.py +522 -0
- ucagent/runtime/events.py +249 -0
- ucagent/runtime/host.py +507 -0
- ucagent/runtime/operations.py +715 -0
- ucagent/runtime/output.py +274 -0
- ucagent/runtime/services.py +686 -0
- ucagent/runtime/session.py +222 -0
- ucagent/runtime/startup.py +113 -0
- ucagent/runtime/task_contracts.py +54 -0
- ucagent/runtime/task_queue.py +78 -0
- ucagent/runtime/task_store.py +79 -0
- ucagent/runtime/workflow_checkpoint.py +75 -0
- ucagent/runtime/workflow_control.py +273 -0
- ucagent/runtime/workflow_evidence.py +101 -0
- ucagent/runtime/workflow_handoff.py +209 -0
- ucagent/runtime/workspace/__init__.py +1 -0
- ucagent/runtime/workspace/access.py +149 -0
- ucagent/runtime/workspace/git.py +279 -0
- ucagent/runtime/workspace/queries.py +516 -0
- ucagent/runtime/workspace_preparation.py +135 -0
- ucagent/scripts/refresh_workspace_assets.py +103 -0
- ucagent/scripts/surfer/LICENSE-EUPL-1.2.txt +287 -0
- ucagent/scripts/surfer/bit_expansion.patch +39 -0
- ucagent/scripts/surfer/bit_expansion.rs +245 -0
- ucagent/scripts/surfer/rebuild.py +84 -0
- ucagent/scripts/ucagent-client/SKILL.md +64 -0
- ucagent/scripts/ucagent-client/scripts/ucagent_client.py +810 -0
- ucagent/scripts/uvd/launch_uvd.py +156 -0
- ucagent/scripts/verdi/launch_verdi.py +127 -0
- ucagent/setting.yaml +643 -0
- ucagent/util/__init__.py +0 -0
- ucagent/util/config.py +1159 -0
- ucagent/util/config_references.py +318 -0
- ucagent/util/cqueque.py +98 -0
- ucagent/util/diff_ops.py +730 -0
- ucagent/util/file_policy.py +191 -0
- ucagent/util/functions.py +1535 -0
- ucagent/util/log.py +290 -0
- ucagent/util/markdown.py +147 -0
- ucagent/util/models.py +350 -0
- ucagent/util/output.py +61 -0
- ucagent/util/persistence.py +53 -0
- ucagent/util/redaction.py +47 -0
- ucagent/util/test_tools.py +9 -0
- ucagent/util/waveform_viewer.py +350 -0
- ucagent/util/workspace_archive.py +230 -0
- ucagent/version.py +24 -0
- ucagent-2.0.0.dist-info/METADATA +464 -0
- ucagent-2.0.0.dist-info/RECORD +457 -0
- ucagent-2.0.0.dist-info/WHEEL +5 -0
- ucagent-2.0.0.dist-info/entry_points.txt +2 -0
- ucagent-2.0.0.dist-info/licenses/LICENSE +202 -0
- ucagent-2.0.0.dist-info/licenses/NOTICE.md +8 -0
- ucagent-2.0.0.dist-info/top_level.txt +1 -0
ucagent/SKILL.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ucagent
|
|
3
|
+
description: 帮助用户编写、校验和启动 UCAgent 工作流,或定位阶段和 Checker 问题。适用于创建任务 YAML、配置自定义 Checker 和使用 --emulate-config。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# UCAgent 工作流配置
|
|
7
|
+
|
|
8
|
+
## 创建最小任务
|
|
9
|
+
|
|
10
|
+
为文档生成任务创建 `task.yaml`。`workflow: null` 从框架配置开始,由这里的阶段定义任务。要扩展现有应用时,先选定应用和工作流,再用 `--config` 提供覆盖项。
|
|
11
|
+
|
|
12
|
+
```yaml
|
|
13
|
+
workflow: null
|
|
14
|
+
output: docs
|
|
15
|
+
write_dirs: ["{OUT}"]
|
|
16
|
+
mission:
|
|
17
|
+
name: "{DUT} 项目文档"
|
|
18
|
+
prompt:
|
|
19
|
+
system: 根据项目资料编写可核实的需求说明。
|
|
20
|
+
stage:
|
|
21
|
+
- name: requirement_analysis
|
|
22
|
+
desc: 编写需求说明
|
|
23
|
+
task:
|
|
24
|
+
- 阅读 DUT 目录中的项目资料。
|
|
25
|
+
- 将有来源支持的需求写入 {OUT}/{DUT}_requirements.md。
|
|
26
|
+
output_files:
|
|
27
|
+
- "{OUT}/{DUT}_requirements.md"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`{WORKSPACE}`、`{DUT}` 和 `{OUT}` 在配置加载后渲染。配置文件中的列表整体替换,覆盖 `stage` 时提供完整的目标阶段列表。更多配置键和加载顺序见[工作流配置](https://xs-mlvp.github.io/UCAgent/content/03_develop/03_workflow/)。
|
|
31
|
+
|
|
32
|
+
## 校验和执行
|
|
33
|
+
|
|
34
|
+
用空后端在临时工作区遍历阶段配置。
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
ucagent --backend blank --emulate-config --config task.yaml
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
检查输出中的配置加载、阶段描述和验收反馈。模拟会调用阶段的完成检查,配置中的 Checker 可以执行检查命令。依赖真实输入或交付物的检查,需要在任务工作区验证。
|
|
41
|
+
|
|
42
|
+
将任务资料放入 `workspace/DUT/`,并使用已配置的模型启动任务。以下命令使用 LangChain。
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
ucagent workspace/ DUT --config task.yaml --backend langchain --tui --loop
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## 增加验收
|
|
49
|
+
|
|
50
|
+
- 将阶段生成的必需文件列入 `output_files`。需要在 Agent 初始化时检查已有输入时,可用 `OrginFileMustExistChecker`,参数 `files` 接收 workspace 相对路径或路径列表。
|
|
51
|
+
- 为内容、结构或证据编写 Checker 时,从 `ucagent` 导入 `Checker`。自定义构造函数先调用 `super().__init__()`,在 `on_init()` 准备工作区相关状态,在 `do_check(is_complete=False, **kwargs)` 验证当前产物。可明确定位的失败应返回 `error_code`、`error` 和 `next_action`。
|
|
52
|
+
- 在阶段的 `checker` 项中用 `clss` 指定完整类名,用 `args` 提供构造参数。直接开发本地模块时,用 `--append-py-path ./checkers` 指定导入目录。
|
|
53
|
+
- 补齐阶段任务、参考文档和验收例子。技能用于辅助,关闭技能时仍需通过相同的 Checker。
|
|
54
|
+
|
|
55
|
+
完整实现和诊断契约见[自定义 Checker](https://xs-mlvp.github.io/UCAgent/content/03_develop/07_checkers/)。
|
ucagent/__init__.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""Public Python API for the UCAgent framework."""
|
|
2
|
+
|
|
3
|
+
from .api import PUBLIC_API_NAMES as _PUBLIC_API_NAMES, resolve as _resolve
|
|
4
|
+
from .version import __author__, __description__, __email__, __version__, banner, SOURCE_TREE_RUNTIME
|
|
5
|
+
|
|
6
|
+
__all__ = [
|
|
7
|
+
"__version__",
|
|
8
|
+
"__author__",
|
|
9
|
+
"__email__",
|
|
10
|
+
"__description__",
|
|
11
|
+
"banner",
|
|
12
|
+
"SOURCE_TREE_RUNTIME",
|
|
13
|
+
*_PUBLIC_API_NAMES,
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def __getattr__(name):
|
|
18
|
+
"""Load only declared public symbols, without hiding implementation errors."""
|
|
19
|
+
if name not in _PUBLIC_API_NAMES:
|
|
20
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
21
|
+
value = _resolve(name)
|
|
22
|
+
globals()[name] = value
|
|
23
|
+
return value
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def __dir__():
|
|
27
|
+
"""List public exports together with normal package attributes."""
|
|
28
|
+
return sorted(set(globals()) | set(__all__))
|
ucagent/__main__.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""Launch UCAgent with python -m ucagent or an explicit package entry file."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
if __package__ in {None, ""}:
|
|
7
|
+
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
8
|
+
|
|
9
|
+
from ucagent.launcher.entry import main
|
|
10
|
+
|
|
11
|
+
if __name__ == "__main__":
|
|
12
|
+
main()
|
ucagent/_version.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# file generated by vcs-versioning
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"__version__",
|
|
7
|
+
"__version_tuple__",
|
|
8
|
+
"version",
|
|
9
|
+
"version_tuple",
|
|
10
|
+
"__commit_id__",
|
|
11
|
+
"commit_id",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
version: str
|
|
15
|
+
__version__: str
|
|
16
|
+
__version_tuple__: tuple[int | str, ...]
|
|
17
|
+
version_tuple: tuple[int | str, ...]
|
|
18
|
+
commit_id: str | None
|
|
19
|
+
__commit_id__: str | None
|
|
20
|
+
|
|
21
|
+
__version__ = version = '2.0.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (2, 0, 0)
|
|
23
|
+
|
|
24
|
+
__commit_id__ = commit_id = 'gcfbe48290'
|
ucagent/api.py
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""Declared, lazy root API for framework users and plugin authors.
|
|
2
|
+
|
|
3
|
+
Framework implementations import their owning modules directly. Specialized
|
|
4
|
+
plugin interfaces are documented in the plugin development guide.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from importlib import import_module
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
_EXPORTS = {
|
|
11
|
+
'AgentBackendBase': ('ucagent.core.backends.base', 'AgentBackendBase'),
|
|
12
|
+
'Argument': ('ucagent.runtime.control.commands', 'Argument'),
|
|
13
|
+
'BaseReadWrite': ('ucagent.core.tools.fileops', 'BaseReadWrite'),
|
|
14
|
+
'BatchTask': ('ucagent.core.checkers.base', 'BatchTask'),
|
|
15
|
+
'BlankBackend': ('ucagent.core.backends.blank', 'BlankBackend'),
|
|
16
|
+
'Checker': ('ucagent.core.checkers.base', 'Checker'),
|
|
17
|
+
'CommandRequirement': ('ucagent.core.plugins', 'CommandRequirement'),
|
|
18
|
+
'CommandSpec': ('ucagent.runtime.control.commands', 'CommandSpec'),
|
|
19
|
+
'Config': ('ucagent.util.config', 'Config'),
|
|
20
|
+
'EmptyArgs': ('ucagent.core.tools.uctool', 'EmptyArgs'),
|
|
21
|
+
'ManagerTool': ('ucagent.core.stage.vmanager', 'ManagerTool'),
|
|
22
|
+
'OperationCancelled': ('ucagent.runtime.operations', 'OperationCancelled'),
|
|
23
|
+
'OperationFailure': ('ucagent.runtime.operations', 'OperationFailure'),
|
|
24
|
+
'PLUGIN_API_VERSION': ('ucagent.core.plugins', 'PLUGIN_API_VERSION'),
|
|
25
|
+
'Plugin': ('ucagent.core.plugins', 'Plugin'),
|
|
26
|
+
'PluginContext': ('ucagent.core.plugins', 'PluginContext'),
|
|
27
|
+
'PluginError': ('ucagent.core.plugins', 'PluginError'),
|
|
28
|
+
'PluginLaunchContext': ('ucagent.core.plugins', 'PluginLaunchContext'),
|
|
29
|
+
'PluginLaunchHooks': ('ucagent.core.plugins', 'PluginLaunchHooks'),
|
|
30
|
+
'PluginWorkflow': ('ucagent.core.plugins', 'PluginWorkflow'),
|
|
31
|
+
'PreparationOptions': ('ucagent.core.workspace.preparation', 'PreparationOptions'),
|
|
32
|
+
'UCTool': ('ucagent.core.tools.uctool', 'UCTool'),
|
|
33
|
+
'VerifyAgent': ('ucagent.core.agent.execution', 'VerifyAgent'),
|
|
34
|
+
'WorkspacePreparation': ('ucagent.core.workspace.preparation', 'WorkspacePreparation'),
|
|
35
|
+
'load_runtime_config': ('ucagent.util.config', 'load_runtime_config'),
|
|
36
|
+
'to_mcp_tool': ('ucagent.core.tools.uctool', 'to_mcp_tool'),
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
PUBLIC_API_NAMES = tuple(_EXPORTS)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def resolve(name: str):
|
|
43
|
+
"""Resolve a declared export, preserving implementation import failures."""
|
|
44
|
+
module_name, attribute = _EXPORTS[name]
|
|
45
|
+
return getattr(import_module(module_name), attribute)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
# ToffeeUT
|
|
3
|
+
|
|
4
|
+
一个 DUT 对应一个长期验证工程。规格、环境和用例就在工程里维护;复核和试修用的是同一工程、同一 CASE,不需要手工准备复跑目录或候选目录。
|
|
5
|
+
|
|
6
|
+
## 开始验证
|
|
7
|
+
|
|
8
|
+
使用 `uc-toffee[runner]>=2.4,<3`。实际编译需要 Picker 和 Verilator。安装和验证方式见[开发和运行契约](docs/development.md#安装边界)。
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
python -m ucagent toffee-ut /abs/workspace MyDUT --output ut_project \
|
|
12
|
+
--agent-mode single --backend opencode --no-embed-tools --mcp-server --mcp-server-port -1 --loop
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
首次可通过 `--config` 登记 `runtime_options.ut_documents` 和 `ut_rtl_dirs`(工作区相对路径);已有原生 DUT 也可登记 `ut_dut_package`,或使用 `BuildToffeeDUT` 为真实 RTL 建包。新工程由 Toffee 初始化 `env/`、`tests/`、`dut/` 和 `toffee.toml`;ToffeeUT 创建验证规格模板和证据入口,不生成替身或占位 Python 用例。
|
|
16
|
+
|
|
17
|
+
## 继续已有工程
|
|
18
|
+
|
|
19
|
+
用相同 workspace、DUT 和 `--output` 重新打开。工程就是工作区时用 `--output .`。已有 `testbenches/<DUT>/` 工程先核验再沿用,不搬目录、不重写可以复用的规格和测试。只接手部分工作时,可用 `toffee-ut:adopt` 盘点,或在 `ut` 用 `ut_task` 和 `ut_task_stages` 指定范围。
|
|
20
|
+
|
|
21
|
+
已有问题时,在相同启动命令中通过 `--workflow` 切换工作流并指定 CASE:
|
|
22
|
+
|
|
23
|
+
| 入口 | 操作者提供 | 工作内容 |
|
|
24
|
+
|---|---|---|
|
|
25
|
+
| `toffee-ut:review` | `--override "runtime_options.ut_review_cases=['BUG-001-CASE-001']"` | 核对原运行、精确用例、种子和首错;有已验收的复现就复用,不改 RTL。 |
|
|
26
|
+
| `toffee-ut:fix` | 同一 CASE 选择,另加 `--override runtime_options.ut_authorize_fix=True` | 已确认是同一 RTL 失败且原构建配方可核验时,只改候选、实际重编、复验原例。 |
|
|
27
|
+
|
|
28
|
+
选多个 CASE 时,用 `--config` 提供 `runtime_options.ut_review_cases` 的 YAML 列表,每例各自复核和交付。`fix` 不重走 UT,不重跑已经验收的原版,也不关闭缺陷。若一开始就希望在同一次 UT 中处理失败,可显式设置 `ut_case_followup: reproduce` 或 `fix`;默认 `none`。旧 `bug_review` / `prepare-review` 用于独立调试,不是前置步骤。
|
|
29
|
+
|
|
30
|
+
## 去哪里看结果
|
|
31
|
+
|
|
32
|
+
| 路径(相对工程) | 内容 |
|
|
33
|
+
|---|---|
|
|
34
|
+
| `docs/spec/design/`、`docs/spec/verification/` | 长期维护的设计依据和验证规格。 |
|
|
35
|
+
| `docs/README.md`、`docs/delivery-summary.json` | 人读总览与独立机器摘要。 |
|
|
36
|
+
| `docs/bugs/open/BUG-…-CASE-…-症状/report.md` | 一例一目录,既是在册问题,也可直接打包给设计。`report.md` 保留 UT 初判;同目录有本例原日志和原波形(如有),复核、试修验收后才追加各自的记录。 |
|
|
37
|
+
|
|
38
|
+
`latest` 更新不改变历史 CASE 的来源。清除已验收步骤的临时副本不影响上述交付;不要清除签名运行、构建原件或工程验收记录。旧散档和旧交付包原样保留,不自动迁移。移动工作区后旧报告仍可读,但不能把旧绝对路径或一轮新构建当成原版复现。候选仅定向通过,不是全量回归通过。
|
|
39
|
+
|
|
40
|
+
上述命令直接打开指定工程;不依赖 Global 自动复制执行目录。工具、权限、入口及开发回归见[开发和运行契约](docs/development.md)。
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
|
|
2
|
+
# ToffeeUT 开发和运行契约
|
|
3
|
+
|
|
4
|
+
## 安装边界
|
|
5
|
+
|
|
6
|
+
应用与 UnitTest 同级,独立包名 `ucagent-toffee-ut`,导入 `toffee_ut`。日常工作流是
|
|
7
|
+
`toffee-ut:ut`、`toffee-ut:review`、`toffee-ut:fix`;`adopt` 和 `bug_review` 分别供交接和独立调试。
|
|
8
|
+
使用 `ucagent toffee-ut` 启动主工作流。UCAgent 主发行包以包数据附带 ToffeeUT 的工作流与运行资源。
|
|
9
|
+
|
|
10
|
+
运行 `scripts/setup_env.py` 可创建单独的插件虚拟环境。脚本从仓库和插件的
|
|
11
|
+
requirements 文件安装 Toffee 2 依赖,并通过 `.pth` 引用所选 UCAgent 源码。
|
|
12
|
+
工具和 pytest 都使用启动时的 `sys.executable`。
|
|
13
|
+
|
|
14
|
+
使用 `uc-toffee[runner]>=2.4,<3`,由发布包提供 `toffee.project.check_project` 和 `init_project`。
|
|
15
|
+
独立复核使用同一虚拟环境的 `python -I`。把 Toffee、xcomm 和工程依赖安装到该环境,
|
|
16
|
+
再验证隔离进程的导入。只通过 `PYTHONPATH` 接入 Toffee 源码会在独立复核时丢失。
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
python -I -c 'import toffee, xspcomm; from importlib.metadata import version; from toffee.project import check_project, init_project; print(version("uc-toffee"), version("uc-xcomm"), toffee.__file__, xspcomm.__file__)'
|
|
20
|
+
python -m toffee check /abs/workspace/ut_project
|
|
21
|
+
python -m ucagent --validate-plugin ./ucagent/applications/ToffeeUT
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
同一解释器要能导入选定 UCAgent、ToffeeUT 和 Toffee;重编还需核对 Picker 路径。用户级安装的工具回归
|
|
25
|
+
若用临时 HOME 隔离配置,应保留原解释器的 PYTHONUSERBASE,避免子进程误换安装根。
|
|
26
|
+
|
|
27
|
+
需要编译实际 DUT 时,外部工具链为 Picker、Verilator、C/C++ 构建工具及
|
|
28
|
+
verilator_coverage。已有 DUT 包的 ABI 须与当前 Python 和 xcomm 绑定匹配。
|
|
29
|
+
非重叠 transition 使用 `strategy="auto"` 时,Toffee 会在 xcomm 缺少 `KmpNext` 时改用 Python 采样。
|
|
30
|
+
若工程指定 `strategy="native"`,用实际 DUT 绑定验证其提供 `KmpNext`,并用同一刺激核对命中。
|
|
31
|
+
|
|
32
|
+
## 从 Toffee 2.3 升级已有工程
|
|
33
|
+
|
|
34
|
+
- Toffee 2.4 的原生计数保存在各构建的 `native/<build-id>/coverage.dat`。行覆盖从 DAT 的行和分支源码段
|
|
35
|
+
投影,和 `coverage.html` 的源码行口径一致。分支、翻转保留原生点身份,块、表达式和 FSM 可在 Toffee
|
|
36
|
+
网页查看。`CoverageInfo` 和阶段验收使用签名 DAT,额外生成的摘要只供排查。
|
|
37
|
+
- 旧 `coverage.info` 与当前 DAT 投影的行分母和计数可能不同。已有运行的签名和源码绑定仍有效时,可用同一
|
|
38
|
+
口径重读原 DAT。复核 `line_coverage.uncovered` 中受影响的条目,并用当前计数更新汇总。升级后需要新的完整
|
|
39
|
+
执行基线且缺可比的用例证据时,按 `Guide_Doc/ut-coverage.md` 的全量预检约定由操作者决定是否为本次全量关闭预检。
|
|
40
|
+
- IOMMU 的 `iommu_wrap` 和 `iommu_acd_translate_unit` 自检曾读取 `toffee._coverage_capture` 的
|
|
41
|
+
`live_groups`、`suspended` 或 `_suspended`。新版辅助组使用 `instantiate(..., capture=False)`,用公开
|
|
42
|
+
`report()` 验证本地采样,再从同次回归的 `functional-coverage.json` 验证导出边界。用实际导出的
|
|
43
|
+
功能组和命中作正对照。共享受管组在 `selftest` 期间暂停,功能用例恢复采样。
|
|
44
|
+
|
|
45
|
+
需要脱机源码详情时,从签名 manifest 选定实际 DAT,在新的输出位置生成 Toffee 的报告站点。
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
toffee-coverage-report --verilator-dat DUT=/abs/run/native/build-id/coverage.dat \
|
|
49
|
+
--coverview-source-root /abs/workspace --site /abs/review/coverage-site
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Global/Master 输入准备与编译时机
|
|
53
|
+
|
|
54
|
+
`toffee-ut:ut` 注册 `prepare_workspace`,由 Master 的准备队列调用。原始 DUT 来源目录复制到新工作区的 `<DUT>/`,保留 RTL、Scala、include 和文档之间的相对位置;例如 `IntegerDivider/IntegerDivider.v` 与 `IntegerDivider/README.md`。已有 `<DUT>/`、`<DUT>_RTL/` 或已登记的 Toffee 工程保持原目录结构,不重新归档。运行状态和其他受管输出使用通用复制规则排除。
|
|
55
|
+
|
|
56
|
+
默认输入盘点读取 `<DUT>/README.md`、`<DUT>/Doc/`、`<DUT>_Doc/` 等资料,以及 `<DUT>/`、`<DUT>_RTL/` 等源码。已有平铺工作区中存在 `<DUT>.v/.sv` 时,也识别根目录 README、Doc 和源码文件;不要求搬动历史任务。显式 `ut_documents/ut_rtl_dirs` 仍优先,空列表表示不自动补入文件。新原始来源嵌入 `<DUT>/` 后,显式路径和构建配方应使用新工作区的相对路径。
|
|
57
|
+
|
|
58
|
+
准备阶段只整理输入,不预先生成旧 UnitTest 的模拟器接口。工作流通过 `UTProject(inspect/scaffold)` 建立输入清单和验证工程,再由原生 DUT 构建阶段调用 `BuildToffeeDUT`。该工具执行 Picker/Verilator,将原生包放在 `{OUT}/dut/<DUT>/`,构建命令、日志及输入/输出摘要保存在 `{OUT}/results/build-*/`。已配置 `ut_native_build_recipe` 时使用该配方;未配置时需要明确的源码及编译参数,不能伪造编译成功。目录准备完成也不意味着工程初始化、原生构建或 UT 已通过。
|
|
59
|
+
|
|
60
|
+
## 自己的 opencode + MCP
|
|
61
|
+
|
|
62
|
+
若 UT 使用手动交互,可先用 `--mcp-server --mcp-server-port 5000 -hm` 启动 UCAgent,不加 `--loop`。
|
|
63
|
+
在任务工作区的 OpenCode V2 配置中合并以下
|
|
64
|
+
MCP 条目。不要覆盖其他配置或填入模型密钥;只监听本机回环地址。
|
|
65
|
+
|
|
66
|
+
```jsonc
|
|
67
|
+
{
|
|
68
|
+
"$schema": "https://opencode.ai/config.json",
|
|
69
|
+
"mcp": {
|
|
70
|
+
"servers": {
|
|
71
|
+
"ut": {
|
|
72
|
+
"type": "remote",
|
|
73
|
+
"url": "http://127.0.0.1:5000/mcp",
|
|
74
|
+
"oauth": false,
|
|
75
|
+
"timeout": { "execution": 3700000 }
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
这里的本地 UCAgent 服务不使用 OAuth;不要把这个示例用于需要身份认证的外网服务。
|
|
83
|
+
启动 `opencode /abs/workspace`,用 `/models` 选择当前项目可用的模型,并让它:
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
请通过 UCAgent 的 RoleInfo 和 CurrentTips 获取当前任务,使用其 ReadTextFile 阅读
|
|
87
|
+
阶段 reference_files,然后按 toffee-ut 工作流执行。所有修改限于当前任务允许目录。
|
|
88
|
+
资料盘点、骨架、编译、测试和汇总使用 UTProject、BuildToffeeDUT、RunToffee。
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
不用自动 loop、不由 UCAgent 发起另一个 opencode,就可以保留自己的交互终端和模型
|
|
92
|
+
选择。若明确希望 UCAgent 自动调用现有 opencode 后端,可增加
|
|
93
|
+
`--backend=opencode --loop`;模型用其已支持的 CLI 追加参数传入:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
export UC_ENV_CMD_BACKEND_EX_ARGS="--model <provider/model>"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
这只影响自动调用模式,不影响你自己的交互会话。独立复核、试修用 UCA 管理的
|
|
100
|
+
OpenCode 或 LangChain;未限制本机写权限的手动客户端不具备候选编辑边界。
|
|
101
|
+
OpenCode V2 的依据为官方
|
|
102
|
+
[MCP](https://opencode.ai/v2/docs/mcp-servers)、
|
|
103
|
+
[模型](https://opencode.ai/v2/docs/models)和 [CLI](https://opencode.ai/v2/docs/cli)说明。
|
|
104
|
+
|
|
105
|
+
## 确定性接口
|
|
106
|
+
|
|
107
|
+
| 入口 | 职责 |
|
|
108
|
+
|---|---|
|
|
109
|
+
| `UTProject(inspect)` | 真实输入发现、hash、schema2 DUT 映射与资料分流 |
|
|
110
|
+
| `UTProject(scaffold)` | 新布局来自 Toffee 的 `init_project`;`check_project` 核对平铺或已有分组工程。插件只添 UT 文档、登记和 pytest 设置,不生成 Python 样板。 |
|
|
111
|
+
| `BuildToffeeDUT` | 结构化 timing/rtl_defines/include_dirs 编译用户 RTL,复核输入字节与配方;拒绝覆盖已有包,失败保留日志 |
|
|
112
|
+
| `RunToffee` | 同一选定解释器运行实际选择,串行/xdist、取消/超时、逐例阶段和构建证据 |
|
|
113
|
+
| `WaveInfo` | 从指定运行的用例波形中读取信号目录或事件窗口;查询只读 |
|
|
114
|
+
| `CoverageInfo` | 分页读取当前 DUT 的实际原生行/分支/toggle 计数及未覆盖点 |
|
|
115
|
+
| `UTProject(audit)` / Checker | 相同的阶段验收,不自动启动测试或改变资料 |
|
|
116
|
+
| `UTProject(summary)` | 从当前运行更新 docs/README.md 的人读总览和证据入口,保留生成区块外的人工说明 |
|
|
117
|
+
|
|
118
|
+
`UTProject(action="export_case", report="docs/bugs/open/<CASE>/report.md", markdown=...)` 核验完整提交并原地发布。省略 `markdown` 只读核验已有交付,不另建副本。`ReviewUTCase` 在同一目录追加复核与试修验收。
|
|
119
|
+
|
|
120
|
+
离线 CLI 复用同一实现。例如:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
toffee-ut inspect /abs/workspace MyDUT --rtl-dir inputs/rtl --document inputs/spec.md
|
|
124
|
+
toffee-ut scaffold /abs/workspace MyDUT --native-package MyDUT
|
|
125
|
+
toffee-ut audit /abs/workspace MyDUT --phase plan
|
|
126
|
+
toffee-ut run /abs/workspace MyDUT --workers 1
|
|
127
|
+
toffee-ut summary /abs/workspace MyDUT
|
|
128
|
+
toffee-ut export-case /abs/workspace MyDUT \
|
|
129
|
+
--report docs/bugs/open/BUG-001-CASE-001-输出不符/report.md --markdown-file /abs/case-draft.md
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
CLI 不经过 UCAgent 的文件写策略,使用者负责只对授权工作区运行;所有路径仍受工作
|
|
133
|
+
区边界检查。UTProject/编译/运行工具同时检查词法路径和链接实际目标的写权限。
|
|
134
|
+
`ut_timeout` 与单次 RunToffee 的 timeout 单位为秒,上限均为 3600;默认 1200。
|
|
135
|
+
`ut_run_seed` 接受 1 到 2147483647 的整数,与单次 RunToffee 的 `seed` 范围一致;
|
|
136
|
+
填整数时固定使用该值。设为 `null` 时可由单次调用指定;调用也未指定时使用任务的默认种子。
|
|
137
|
+
构建参数和输入闭包限制见 `Guide_Doc/ut-project.md`;纯替身构建回归不提供原生构建
|
|
138
|
+
或硬件通过信用,实际工具链必须在授权 DUT 上执行。
|
|
139
|
+
|
|
140
|
+
阶段按 `Guide_Doc/ut-stages.md` 使用 ToffeeUT 的工程布局、阶段工件和检查器。
|
|
141
|
+
分组容器不单独执行,带跳过条件的阶段按本轮配置决定是否执行。
|
|
142
|
+
|
|
143
|
+
`ut_reference_model` 和 `ut_mock_components` 默认 false,分别控制参考模型与 Mock。
|
|
144
|
+
`ut_line_coverage` 默认 true,控制独立原生覆盖复盘;缺采集不会自动跳过。
|
|
145
|
+
`ut_native_coverage_thresholds` 默认 `default`(行 99%、分支 99%、翻转 90%);在原生覆盖启用时
|
|
146
|
+
也可设置 `line`、`branch`、`toggle` 到 0–100 数值的映射,或设为 `null` 使用逐项验收。阈值和
|
|
147
|
+
缺口分类见 `Guide_Doc/ut-coverage.md`。
|
|
148
|
+
随机场景阶段排在原生覆盖之前,两者可合批发布新的全量。重新打开已有工程时,以当前流程的稳定阶段名
|
|
149
|
+
确认恢复位置;阶段序号对应当前配置。
|
|
150
|
+
`ut_human_env_spec_review` 和 `ut_human_env_review` 默认 false,分别启用
|
|
151
|
+
人工复核及 HumanChecker。仅启用真实适用的可选阶段;其他设计、场景、环境、测试、
|
|
152
|
+
静态候选和归因阶段不随资料情况被跳过。功能规格分析的来源追溯与复核包含逐行映射和
|
|
153
|
+
规格复核两个步骤;无可映射输入文档时只跳过逐行映射,规格复核仍检查功能点与检查点。
|
|
154
|
+
这些开关以及 `ut_coverage_batch_preflight` 必须使用布尔值;例如字符串 `"false"` 会在启动前被拒绝。
|
|
155
|
+
|
|
156
|
+
验证文档继续维护既有 `kind: design`/`verification`:行为组、检查点、场景结果矩阵
|
|
157
|
+
在同一规格内;逐行物理映射在 `docs/spec/verification/` 下。静态审阅与阶段人工解释
|
|
158
|
+
在 `docs/reviews/` 下,以免后写分析文字使已有签名测试源码身份过期。
|
|
159
|
+
`RunToffee` 的阶段角色标记只说明对应节点真实执行,不自动证明判据独立。
|
|
160
|
+
`rtl` 根因分类逐节点核对当前 run/nodeid、原始波形上的信号取值、独立要求和事件级分析,
|
|
161
|
+
不再无条件拒绝。缺观察仍保留真实 FAIL 并报告未达成,不通过改标签或跳过复核解决。
|
|
162
|
+
|
|
163
|
+
## 按任务接入与选择阶段
|
|
164
|
+
|
|
165
|
+
### 独立复核和试修
|
|
166
|
+
|
|
167
|
+
`plugin.py` 在加载工作流时把 CASE 选择绑定到在册报告字节、原签名和精确 nodeid。
|
|
168
|
+
`review.yaml` 和 `fix.yaml` 各声明自己的工作和验收;不能通过角色名、跳阶段或工具参数补授试修。
|
|
169
|
+
`fix` 要求 `ut_authorize_fix: true`、每个选择已有同一首错的 RTL 复现、以及能核对的同配方构建;不要求尚未生成的候选输出。
|
|
170
|
+
两个入口都没有通用写文件、shell、测试启动或构建工具。受管 OpenCode 只暴露 UCA 工具;`ReviewUTCase` 仍按操作校验精确 CASE、候选 RTL 及发布路径。
|
|
171
|
+
|
|
172
|
+
`case_history.py` 读取明确的 `results/<run-id>/receipt.json`,与 `latest` 无关。`review_intake.py` 在执行前核对原件和当前可比输入;工具在 `.ucagent/toffee-ut-reviews/` 开隔离副本。`review_execution.py` 用原包和完整 nodeid 复跑;试修时核对完整输入闭包、实编 diff、输出指纹、种子和实际判定。移动引起的绝对路径失效只保留查阅信用;不能改旧回执来恢复运行资格。
|
|
173
|
+
|
|
174
|
+
`case_pack.py` 发布四项题录、七行摘要、十三节的 `report.md`、本例 `original.log` 和已有的原波形。`ReviewUTCase` 仅复现时加 `reproduce.md`、`reproduce.log`;试修实际重编复验后才加 `fix.md`、`fix.log`、`candidate.diff`。`results/case-reviews/<CASE>/` 签名绑定原运行、报告和各步交付字节,不随目录打包。总报告直接链接在册 `report.md`,机器摘要独立。
|
|
175
|
+
保留签名凭据、原始运行/构建、CASE 目录及对应签名 key。验收后可清理 `.ucagent/toffee-ut-reviews/`,单独打开或继续试修不需要它。旧平铺报告及旧 `docs/case-packs/` 可查阅,已有签名验收仍可核对;工具不往旧路径发布、不搬迁或补签。若同一原运行/节点已经在旧档登记,先请操作者决定如何处理,不并存两份正式材料。
|
|
176
|
+
|
|
177
|
+
单独 `review` / `fix` 按入口和 CASE 选择分开保存阶段进度,不读写 UT 的 `.ucagent/ucagent_info.json`。长期工程直接启动;Global 当前默认把输入送到新执行工作区,不是本接口的原地续做入口。未用 Global 收取结果时,不把单 Agent 或 Super→Sub 的结果称为 Global 验收。
|
|
178
|
+
|
|
179
|
+
### 在同一个多 Agent 任务里处理失败用例
|
|
180
|
+
|
|
181
|
+
`toffee-ut:ut` 可以在交付缺陷报告后继续复核。给 UT 任务设置以下配置,不需要另启 CLI 命令或第二个 Mission:
|
|
182
|
+
|
|
183
|
+
```yaml
|
|
184
|
+
runtime_options:
|
|
185
|
+
ut_case_followup: fix # none(默认,只做 UT)/ reproduce(仅复现)/ fix(复现后尝试修 RTL)
|
|
186
|
+
ut_followup_cases: null # 默认处理本轮有报告的功能 FAIL;也可填完整 pytest nodeid 列表
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
在 UCAgent `multi` 中,Super 派发 UT 阶段和后续复核阶段。复核 Sub 调用 `ReviewUTCase`:列表、复跑、提交本例记录;获准且确定是 RTL 问题时修改候选 RTL、重新编译并重跑。工具负责隔离副本,不接受模型指定的新工作区路径。最终把检查过的 `reproduce.md`、`fix.md` 追加到本轮现有 CASE 目录,不改写 `report.md` 或原失败。旧的 `prepare-review` 仍可用于独立复核和调试,不在此链路里。
|
|
190
|
+
|
|
191
|
+
这个阶段以当前有效的全量签名运行为前提;若只想接手已有结果,可以用 `ut_task_stages: [follow_up_failed_cases]` 并填写 `ut_task`。本轮无功能失败时不创建任务副本。没有可重建的原 DUT 配方、构建失败或证据不全时留诊断,不当作修复完成。原版和候选执行目前按 CASE 隔离;同组用例尚不复用候选构建。UCAgent 的 `multi` 当前不与 Master 联用。
|
|
192
|
+
|
|
193
|
+
### 只接手已有工程的一部分
|
|
194
|
+
|
|
195
|
+
`toffee-ut:adopt` 包含“任务与边界、相关成果与依赖、阶段安排与人工确认”三个阶段。
|
|
196
|
+
它不依赖 schema2 或现成完整运行,`--output` 指向通过 Toffee 检查的已有目录;不调用主流程的
|
|
197
|
+
准备函数、不生成骨架、不刷新 input_inventory,也不使既有运行因盘点而失效。
|
|
198
|
+
业务文件唯一允许写入的位置是 `<OUT>/docs/reviews/<DUT>-adoption.md`,构建、执行、
|
|
199
|
+
通用 shell 和 UTProject 均不在该流程的可用工具面。最终使用真实 HumanChecker 批准,
|
|
200
|
+
文本 `Check` 只验证结构与本地引用,不认证语义、执行或主流程进度。
|
|
201
|
+
|
|
202
|
+
主流程新增两个运行选项:
|
|
203
|
+
|
|
204
|
+
| 选项 | 默认值 | 作用 |
|
|
205
|
+
|---|---|---|
|
|
206
|
+
| `ut_task` | 空字符串 | 用户本次任务说明;显式选择阶段时必须非空 |
|
|
207
|
+
| `ut_task_stages` | null | null 保持完整配置;非空、无重复的稳定阶段名列表只选择这些工作 |
|
|
208
|
+
|
|
209
|
+
阶段名来自实际 `ut.yaml`,没有硬编码的安全跳过名单。显式父阶段选择包含其已启用
|
|
210
|
+
后代;只选子阶段时,未被选择的祖先保留为容器,不运行父汇总门禁或无关兄弟阶段。
|
|
211
|
+
节点名称、原顺序和所选节点的检查不变。禁用或不适用节点不能被选择自动开启,
|
|
212
|
+
必须先确认其原有可选配置。局部任务完成不表示全 DUT 通过;缺必要合同或证据时仍
|
|
213
|
+
报告依赖,由用户决定扩展任务或停止,不通过局部选择来放松所选检查。
|
|
214
|
+
|
|
215
|
+
例如当前任务只修 monitor:
|
|
216
|
+
|
|
217
|
+
```yaml
|
|
218
|
+
runtime_options:
|
|
219
|
+
ut_task: 修复 monitor 同拍多通道漏采,并验证受影响路径
|
|
220
|
+
ut_task_stages:
|
|
221
|
+
- env_fixture_implementation
|
|
222
|
+
- evaluate_env_fixture
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
将已确认配置另存为 `task.yaml`。两个入口分别启动,沿用同一个插件 venv 和用户自己的
|
|
226
|
+
OpenCode/MCP 会话,不自动启动另一模型 Agent:
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
python -m ucagent /abs/workspace MyDUT --output existing_project \
|
|
230
|
+
--plugin ./ucagent/applications/ToffeeUT --workflow toffee-ut:adopt \
|
|
231
|
+
--config /abs/task.yaml --no-history --mcp-server-no-file-tools -hm --tui
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
接入批准并停止旧实例后再启动:
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
python -m ucagent /abs/workspace MyDUT --output existing_project \
|
|
238
|
+
--plugin ./ucagent/applications/ToffeeUT --workflow toffee-ut:ut \
|
|
239
|
+
--config /abs/task.yaml --no-history --mcp-server-no-file-tools -hm --tui
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
**历史边界:**此处的 `adopt` 与原 UT 流程仍按工作区保存阶段索引,不自动隔离阶段选择。
|
|
243
|
+
切换前操作者应另存需要的 `.ucagent/ucagent_info.json`,再使用 `--no-history`;
|
|
244
|
+
该参数只禁止加载,后续仍保存本次进度,不能宣称旧记录已被隔离或自动合并。
|
|
245
|
+
同一入口、同一任务选择中断续做时才沿用原进度;不要为接入删除运行产物或历史目录。
|
|
246
|
+
接入的完整工件格式和任务执行边界以 `Guide_Doc/ut-adoption.md` 为准。
|
|
247
|
+
|
|
248
|
+
## 方法集合与启用范围
|
|
249
|
+
|
|
250
|
+
10 个问题方法各自保留适用输入、操作步骤、产出、验收和源案例依据:需求边界、观察精度、
|
|
251
|
+
行为等价类、实现追溯、退出残余、包分层、合法激励、独立 oracle、checker/运行时、归因证据。
|
|
252
|
+
设计导航、执行/复核导航、ucv4xs 项目入口也分别保留,合计 13 个可发现 Skill;阶段给当前
|
|
253
|
+
推荐,通用列表允许按问题跨阶段取用,不要求每轮全读。运行时选择入口为
|
|
254
|
+
`Guide_Doc/ut-methods.md`,方法不带生成、执行或计数脚本。
|
|
255
|
+
|
|
256
|
+
P01–P12 速查卡随执行导航复制;依赖升级、fixture 集中、框架选型、迁移边界四篇 pending
|
|
257
|
+
随项目入口作为参考复制,不注册为 Skill、不列入阶段推荐,也不提升为强制验收标准。
|
|
258
|
+
读取本身不授权改变锁、环境、工程、发布或删除。禁用 Skill、缺少技能目录时,仍按同一
|
|
259
|
+
阶段任务、Guide_Doc、工具、模板和验收执行;不依赖 Skill 使用记录推进。
|
|
260
|
+
|
|
261
|
+
这批内容适配自 ucv4xs 实际工作树,含未提交修订;文件指纹、来源路径和适配边界见
|
|
262
|
+
[来源记录](../src/toffee_ut/skills/ucv4xs-workflow/references/SOURCES.md)。方法正文、速查卡和
|
|
263
|
+
待审参考保留 MPL-2.0 及许可全文,插件代码和工作流为 Apache-2.0;发行元数据声明两者。
|
|
264
|
+
wheel/sdist 与工作区复制均包含这些参考,不依赖读取原来的本机 ucv4xs 目录。
|
|
265
|
+
案例保留经验和原路径,不打包原工程运行产物,不把历史结果说成本轮复现。
|
|
266
|
+
|
|
267
|
+
Skill 在初始化时复制,已有运行实例不会自动读取源文件修改;需要重启实例重新复制。
|
|
268
|
+
对旧开发资源不添加别名或自动迁移路径;使用新工作区或由操作者移走旧 Skill 资源后重新
|
|
269
|
+
初始化,不自行删除现有工作区内容。
|
|
270
|
+
|
|
271
|
+
## 运行与证据
|
|
272
|
+
|
|
273
|
+
- RunToffee 使用 Toffee 的原生 managed pytest backend 和不存在的新输出目录;
|
|
274
|
+
串行/xdist 均由同一个 backend 收集和合并,不另造覆盖运行器。直接加载 backend
|
|
275
|
+
保留解析后的 Python import roots,不让 CLI 把旧安装插件放到当前源码前。
|
|
276
|
+
pytest 的缓存和临时文件放在本次运行目录。`results/<DUT>-runs.json` 记录 `full`、每个
|
|
277
|
+
nodeid 完成的 `delta` 和最近未完成的尝试。全量发布后清理已被替代的运行,并保留仍在用的
|
|
278
|
+
定向、覆盖对比基线及 CASE 或审阅引用。清理限于签名属于该 DUT 的运行目录。
|
|
279
|
+
Toffee 每个 worker 分批合并原生 DAT。成功时每个构建发布一份 DAT。进程组超时或取消后,
|
|
280
|
+
RunToffee 清除该轮未提交的 worker 临时产物,保留日志和尝试状态。
|
|
281
|
+
- pytest adapter 使用 Toffee 的 phase_record/case_status,不从 JUnit 反推判定。
|
|
282
|
+
记录精确 nodeid、全部阶段、场景、自检类别、实际 fixture 所有的 DUT 来源和请求 seed。
|
|
283
|
+
- 阶段可选 `captured_diagnostics` 只提取名称精确匹配 `Captured stdout/stderr/log <when>`
|
|
284
|
+
的标准文本 sections,保留原序及重复,不用 capstdout 等累计视图,不添加日志 handler、
|
|
285
|
+
流重定向或任意属性协议。按 Unicode 码点计数、头部保留,每段 6000 字符,每阶段总共
|
|
286
|
+
12000 字符及 12 段(含空段);各段保存 name/text、original_chars、retained_chars、
|
|
287
|
+
truncated,字段内含 unit/retention/limits,完全省略段另累计 omitted_sections/omitted_chars。
|
|
288
|
+
cases 文件继续受现有收据 hash/签名保护,不改 verdict 或门禁,不追补历史。
|
|
289
|
+
renderer 将其独立展示为 runtime captured diagnostics, not independent proof;没有字段、
|
|
290
|
+
无输出或关闭 capture 不产生语义结论;日志中 expected/observed、完成及种子声明都不升级
|
|
291
|
+
为独立判据或运行时结构化检查证明。完整字段例子见 `Guide_Doc/ut-results.md`。
|
|
292
|
+
- selftest/shared 的设施自检暂停受管功能组采样。辅助组声明 `capture=False`,可保持局部采样和断言。
|
|
293
|
+
Runner 每个组只汇总一次,检查共享组的累计命中时用同轮功能覆盖产物。
|
|
294
|
+
- 禁止环境 PYTEST_ADDOPTS/PYTEST_PLUGINS 或 pytest.ini addopts 暗中改变工具选择。
|
|
295
|
+
conftest 声明的插件仍正常加载,配置项如 asyncio_mode 保留。Toffee 核对实际 worker 数,覆盖预检用
|
|
296
|
+
collect-only 取得精确节点。插件引起的 deselection 会记录在逐例证据中。
|
|
297
|
+
- 原生覆盖关联核对 actual fixture class/source 和 manifest 的构建文件,避免只跑
|
|
298
|
+
Python 自检却借用别的 DUT 覆盖。要求引用的构建原件仍在工作区范围内。
|
|
299
|
+
- 全量按整工程输入校验。定向结果允许复用未受影响的测试文件。变更限定在实际测试文件
|
|
300
|
+
时,按模块名和路径引用扩展影响范围。共享文件变化或发现无法解析的常见动态加载时,旧
|
|
301
|
+
结果失效。覆盖补测的全量重跑用实际 pytest 收集校验 `full + delta`,并锁定同一 DUT 的
|
|
302
|
+
补测全量启动。纯审阅无需仿真。
|
|
303
|
+
- `receipt.json` 和 DUT 运行索引使用工作区私有 key 作 HMAC。构建和运行在进程内按设备、
|
|
304
|
+
inode、大小、mtime 和 ctime 复用输入摘要。运行收据记录 `cases.json`、`manifest.json`
|
|
305
|
+
的摘要及覆盖和波形的文件版本。覆盖版本变化时核对 Toffee manifest 已有摘要。波形在查询
|
|
306
|
+
或验收引用时才核对对应文件,导出 CASE 时对实际交付副本计算摘要。总日志、JUnit 和覆盖网页
|
|
307
|
+
可直接用于排查。若内容变化未反映到文件版本,基于版本的复用可能漏检。
|
|
308
|
+
- manifest 的 committed/coverage_complete 与硬件 PASS 分开。UNCERTAIN、覆盖未达目标、
|
|
309
|
+
推断要求、跳过和排除范围不能计入 PASS。真实设计失败允许以 FAIL 交付;验证设施
|
|
310
|
+
错误必须修复。结构验收不证明激励合法、oracle 独立或行为全集完整,仍需语义复核。
|
|
311
|
+
新运行的回执记录启动解释器、Toffee 版本和导入位置,以及环境中的 `uc-xcomm` 发行版本。
|
|
312
|
+
- api_tests/random 在原角色、场景、native 和 seed 条件下接受 PASS 或已核验的 call
|
|
313
|
+
阶段 RTL FAIL。FAIL 路径复用交付的当前问题归因及逐节点的原始波形复核,
|
|
314
|
+
要求场景对应 confirmed 要求、当前 open rtl 问题和本 DUT 匹配的 native manifest
|
|
315
|
+
身份;已知设施错误、未确认或缺证据的失败不豁免,设施自检仍须 PASS。定向阶段不
|
|
316
|
+
附加完整回归、覆盖或无关残余关闭要求,不改写 raw FAIL,也不放宽最终交付门禁。
|
|
317
|
+
该路径同时复用已知 failure-only 检查,仅检查当前失败节点的函数身份(含参数化/类),
|
|
318
|
+
不因有效issue放过空模板,也不扫描未选中的模板来扩大定向实现范围。
|
|
319
|
+
- 实现门禁及场景批次排除已知 failure-only 空体(仅立即 pytest.fail、assert False 或
|
|
320
|
+
raise AssertionError,可带文档说明),不依据错误消息关键字或问题分类判断;模板创建
|
|
321
|
+
阶段仍允许失败占位。实际 API/比较后保留的 FAIL 不受此规则豁免或降级。这里只拒绝
|
|
322
|
+
能明确识别的空体,不推断任意 Python 调用/fixture 已完成合法刺激和检查。
|
|
323
|
+
- 报告投影只消费已校验的 current run 和维护合同;纯渲染器不运行测试、不读测试实现、
|
|
324
|
+
不修改 cases/receipt,也不按异常文本猜实现状态或合并根因。raw、非 selftest 功能候选、
|
|
325
|
+
selftest 分开计数;每个 case 保留全部阶段、角色、声明种子、原生登记、构建身份和原件
|
|
326
|
+
链接。当前失败用例逐例关联独立的 open CASE 报告,同一疑似机制使用共同 BUG 编号;未归因失败仍列出。失败数、文档数、疑似 BUG 组数分别记账,均不能代替已确认根因数。
|
|
327
|
+
- 人读场景到 case 表保留所有维护场景、要求/basis、范围理由、call 候选 nodeid 和原始
|
|
328
|
+
case 结果,未执行和排除项不因没有详细 case 而消失。它不改变结构化证据或计数,
|
|
329
|
+
多标签/多节点只作多对多追溯,不自动产生实现、原生执行、比较或完成信用。
|
|
330
|
+
- scenario 的 stimulus/expected/oracle/completion 与 requirement 来源/basis 是计划合同,
|
|
331
|
+
不是实际比较、逐 UID 完成或 oracle 独立性的运行证明;缺少的实际字段明确披露,不能从
|
|
332
|
+
PASS、标签、错误字符串或覆盖计数补造。requested/declared seed 都不证明 native 生效。
|
|
333
|
+
runtime 只显示收据已有字段;源码 hash 表和完整 build 原件链接到 receipt/manifest,
|
|
334
|
+
源码映射使用排序、紧凑 JSON 的 SHA-256 标识,避免复制完整 hash 表。没有收据字段的
|
|
335
|
+
工具提交、构建选项及跨版本同刺激结论不作证明。
|
|
336
|
+
- summary 管理生成区块,链接从 docs/README.md 出发(results 用 `../results/`);
|
|
337
|
+
保留机器证据原义与区块外的人工说明,final 依据当前证据核对生成内容。问题正文示例见
|
|
338
|
+
`Guide_Doc/ut-results.md`。设计侧逐例复核的[本机案例研究与两份 HPM 报告](examples/case-reports/README.md)说明如何保留修复假设和反证;交付渲染回归见 `tests/reports/test_reports.py`。
|
|
339
|
+
|
|
340
|
+
## 当前限制与测试范围
|
|
341
|
+
|
|
342
|
+
目录职责参考 ucv4xs MainBTB、RAS、uBTB 的单模块工程和 `docs/tutorials/bpu-first-ut.md`:区分设计依据、环境、事务、判据和用例,从入口文档找到运行方式。实际工程布局与组件引用由 Toffee 检查。插件不复制 ucv4xs 的多 DUT 容器和构建脚本,也不导入其运行代码;
|
|
343
|
+
采用已有工程时,该工程自身的运行依赖(例如 ucv 包)仍需安装到同一个 venv。
|
|
344
|
+
|
|
345
|
+
本实现不迁移 schema1、旧 UnitTest、标记覆盖或旧 WaveInfo 协议。ToffeeUT 的独立
|
|
346
|
+
WaveInfo 使用 pywellen 读取 FST/VCD;默认原生捕获在登记 DUT 时设置运行内的唯一
|
|
347
|
+
waveform 路径,不调用 Step、reset 或 immediatewrite,仍由原 fixture Finish。
|
|
348
|
+
运行收据绑定波形文件版本、nodeid 与原生实例身份。多个用例共用一个实例时,该波形不作为单例证据。需要确认 RTL 时,检查器打开本轮该节点的原件,在报告指定的时刻逐信号核对观察值。保留被 open 报告引用的原件,缺失时不能靠摘录通过验收。迁移既有问题时,在原签名运行上重新取值,保留历史交付,不把旧轮观察写成当前观察。
|
|
349
|
+
根因解释仍需对照独立规格审查。
|
|
350
|
+
|
|
351
|
+
历史依据:`git show -s 5b23ce67` 记录了逐测试波形要求的目的——避免用静态标签或虚构的失败确认动态 Bug。ToffeeUT 随 `0f955c74` 接入该证据约定。此前在原波形被清理后仍要核验观察,因此保存了签名窗口;现在以报告引用的原件为准。
|
|
352
|
+
|
|
353
|
+
Native seed 必须由实际 fixture 接入,
|
|
354
|
+
记录请求值不等于已经证明原生种子生效。共享 origin 的 first/last 不提供完整逐例
|
|
355
|
+
覆盖归因,场景标签也不证明相应比较已经发生。
|
|
356
|
+
|
|
357
|
+
插件回归使用临时工作区,验证契约、配置、模板和真实 Toffee/pytest adapter;构建
|
|
358
|
+
调用使用受控替身校验 argv、输出和取消,不编译额外示例 DUT。真实 RTL 全流程须在
|
|
359
|
+
用户选择的实际 DUT 上运行,不能用插件回归结果声称硬件验证已跑通。
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
# 逐失败 Bug 报告:设计人员如何判断候选修复
|
|
3
|
+
|
|
4
|
+
这里保存 ToffeeUT 的写作研究与读者样例。运行时规范见 [ut-results.md](../../../src/toffee_ut/Guide_Doc/ut-results.md),新工程使用[逐例模板](../../../src/toffee_ut/templates/project/docs/bugs/issue-template.md.j2)。以下历史材料的路径相对 IOMMU 验证工作区;原始运行、波形和上游资料不随插件分发。
|
|
5
|
+
|
|
6
|
+
## 先读一对真实案例
|
|
7
|
+
|
|
8
|
+
| 报告 | 设计要回答的问题 |
|
|
9
|
+
|---|---|
|
|
10
|
+
| [BUG-001-CASE-001:PID 近似匹配导致多计](hpm/BUG-001-CASE-001-PID近似匹配导致多计.md) | 配置与有效 PID 只差一位时,为什么计数器 22 增加?修复后完全匹配时是否仍加一? |
|
|
11
|
+
| [BUG-001-CASE-002:PSCID 近似匹配导致多计](hpm/BUG-001-CASE-002-PSCID近似匹配导致多计.md) | 换成 PSCID、另一条 lane 和计数器 23,该节点自己的证据是否支持相同判断? |
|
|
12
|
+
|
|
13
|
+
两例共享的是候选问题编号。任取其中一篇,设计应能独立找到本例的输入、首错、独立依据、对应波形和修复判定标准。一个修复可以让两例都通过,但关闭每一例都要有该节点自己的修后结果;同一份全选回执里的两个节点结果可以分别引用,无需专为文档拆成两次运行。
|
|
14
|
+
|
|
15
|
+
两篇是从原工程 E-HPM-001 提取的写作示范,示范组号不是原项目重新分配的缺陷号。该 HPM 完整运行另有 eventID/IDT 和随机序列两个失败,本目录的两篇不能抵作它们的报告。
|
|
16
|
+
|
|
17
|
+
CASE 第 10 节提出候选修改后,见[从 CASE 报告到 Bug Review](bug-review.md):如何独立裁决声明、审查一个共用补丁,以及逐例登记修后结果。
|
|
18
|
+
|
|
19
|
+
## 从本机哪些报告学到了什么?
|
|
20
|
+
|
|
21
|
+
| 可复核的材料(相对 IOMMU 根目录) | 可借用的写法 | 写作边界 |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| `Kunminghu-v2_StoreQueue_TLB_Miss_Bug_Report.docx` 原件(45,468 字节,SHA-256 `644466da2ee154dcf115bcfed45ff321d5da33b52fe66c6f80a645f0b21cac82`);对照 `plan/21_bugreport_template.md` | 保留原 §1–11 的论证顺序和七行摘要。原件先解释 `addrReadyPtr` 的单调性,再区分 replay/miss 时“写零”和“不写”,最后才引出修复提交 `94f61d2`。 | ToffeeUT 的 §12、§13 对应原 §15、§16(结论、参考);原 §12–14 不作为单例必填章节。HPM 未修复,故修后预期、修后实测分列。原件未随插件分发。 |
|
|
24
|
+
| `plan/bugreports/B-15-arb-w-grant-port3.md` §12–13 | 解释为什么已有 PASS 没有发现问题:只轮转前三个端口的用例从未请求第四个端口。将这样的样本作为邻近控制,不拿来证明第四路正确。 | 历史报告将几个失败写在一起;新报告只继承分析方法,每个 nodeid 分别落档。 |
|
|
25
|
+
| `plan/fail-repair/README.md` 的“同条件原版/修复版对照” | 单驱第四路时,原版第四路接受 0,实验修复版接受 1、转发 1;另外三个端口的对照在两版中都是接受 3、转发 3。把目标变化和不应变化的结果放在同一表。 | 这是缩窄数据宽度后的仲裁器与 FIFO 局部实验,不是正式 DS 构建、更不证明完整写事务闭环。 |
|
|
26
|
+
| `tests/iommu_acd_hpm_top/ut_project/docs/bugs/closed/hpm-dmask-mask-direction.md` 的“独立依据/复验” | 从规范示例推导掩码边界,再区分 RTL 错与模型错;修了 oracle 后同条件重跑,同时保留 DMASK=0 的严格匹配对照。 | 这里的已关闭问题是 **DID/GSCID 掩码宽度的模型错误**。不能用它替上面两个 **PID/PSCID 精确匹配**的 RTL 用例销项。 |
|
|
27
|
+
|
|
28
|
+
## 给设计的修复建议怎样才有用?
|
|
29
|
+
|
|
30
|
+
以第四路为例:“修仲裁优先级”太宽泛。较好的建议是:“在四路交付合同成立的前提下,核对数据选择与授权是否同指第四路。若数据被选中但上游未被接受,候选修法应恢复两者的一致性。若实测在入缓冲前二者已经一致,则这项解释不能成立,应转查缓冲交付。”这给设计一个可以反驳的机制,而不是一条未经验证的改码指令。
|
|
31
|
+
|
|
32
|
+
按实际证据用词:**建议**写“改什么、预期哪项改变、哪项不变”;**局部实验已验证**附对照的构建和观察边界;**正式修复已验证**才写原 nodeid 在修后正式构建的比较结果和完成条件。若缺独立合同,写明请哪位接口负责人裁定哪两个可选语义,以及选哪一项会怎样改变复验预期。修复建议本身始终选填。
|