feat: add generated scene skill platform hardening

This commit is contained in:
木炎
2026-04-21 23:19:06 +08:00
parent 118fc77935
commit 956f0c2b68
439 changed files with 61974 additions and 3645 deletions

View File

@@ -0,0 +1,35 @@
# tq-lineloss Report Lessons Learned
These lessons capture the non-negotiable rules that the generated scene skill platform must preserve when turning the current `tq-lineloss-report` scenario into future staged browser-script skills.
## Routing
- Deterministic intranet routing must require the exact `。。。` suffix.
- Unsupported scenes must fail closed with a prompt instead of falling back to hidden page defaults or legacy one-off logic.
- Ambiguous scene matches must fail closed and ask the operator to clarify.
## Canonical parameters
- Organization resolution must come from an explicit dictionary entity resolver.
- Period resolution must require an explicit month or week expression from the operator instruction.
- Generated browser scripts must receive canonical arguments and must not re-parse raw natural language.
- Page defaults are not allowed to silently fill missing organization or period values.
## Bootstrap
- Every generated browser-script scene must declare `expected_domain` and `target_url` in `scene.toml`.
- The runtime owns target URL/domain validation and bootstrap; generated skills should not hard-code Rust-side bootstrap behavior.
- When page context is present, routing can use it for scoring, but the manifest remains the registration contract.
## Artifact contract
- Report collection skills must return a generic `report-artifact` payload.
- Exportable artifacts must include stable `columns`, human-readable `column_defs`, and row data.
- When `postprocess.exporter = "xlsx_report"`, Rust should perform the XLSX export generically from the artifact fields.
## Validation
- A generated scene is not complete until deterministic routing, registry loading, browser-script execution, and postprocess tests cover it.
- Pipe and browser-ws service paths must stay covered because both remain supported runtime entrypoints.
- Manual service-console smoke testing must verify the real callback-host bootstrap path.
- Timeout diagnostics must preserve enough callback-host stage information to identify whether failure happened before helper load, before helper ready, or during command execution.

View File

@@ -0,0 +1,24 @@
[routing]
require_exact_suffix = true
unsupported_scene_fail_closed = true
ambiguity_fail_closed = true
[canonical_params]
require_dictionary_entity_for_org = true
require_explicit_period = true
forbid_hidden_page_defaults = true
[bootstrap]
require_expected_domain = true
require_target_url = true
prefer_page_context_when_present = true
[artifact]
require_report_artifact = true
require_column_defs_for_export = true
rust_side_xlsx_export_when_postprocess_xlsx = true
[validation]
require_pipe_and_ws_checks = true
require_manual_service_console_smoke = true
require_callback_host_timeout_notes = true