58 lines
2.6 KiB
Markdown
58 lines
2.6 KiB
Markdown
# Report and Experience Agent
|
|||
|
|
|
||
|
|
The first implementation is available at `/report-workbench`. It consumes an
|
||
|
|
immutable risk-run snapshot from Agent 1 and uses the mini-openclaw AgentManager
|
||
|
|
for optional AI chapter proposals.
|
||
|
|
|
||
|
|
## Workflow
|
||
|
|
|
||
|
|
1. Select a risk run and record a human source-confirmation note.
|
||
|
|
2. Create a report using the bundled example corporate template.
|
||
|
|
3. Review the fixed facts and evidence chapters. Edit the judgment and conditions
|
||
|
|
chapters, or request an AI proposal and review it before saving.
|
||
|
|
4. Lock every chapter and finalize with a reviewer opinion.
|
||
|
|
5. Review the resulting experience card through its successive states. Sharing
|
||
|
|
requires an approval result and an independent reviewer. Verification requires
|
||
|
|
a post-lease observation result.
|
||
|
|
6. Export the current report as a Word document.
|
||
|
|
|
||
|
|
## Boundaries
|
||
|
|
|
||
|
|
- Facts and evidence cannot be overwritten. Changed facts require a new source
|
||
|
|
run and report. Final reports are immutable; updates use optimistic versions.
|
||
|
|
- AI proposals never overwrite saved chapters. Missing or failed local models
|
||
|
|
produce an explicit error while preserving the report.
|
||
|
|
- Administrators and reviewers can prepare drafts. Reviewers finalize reports
|
||
|
|
and advance experience cards. Managers can read/export their assigned projects.
|
||
|
|
- Local preview permits all operations for demonstration. Configure
|
||
|
|
`XINGBANG_AUTH_USERS` and `XINGBANG_REQUIRE_AUTH=1` for authenticated use, as
|
||
|
|
described in `RISK_AGENT_GUIDE.md`.
|
||
|
|
- Documents and events are stored alongside risk runs in the local SQLite store.
|
||
|
|
|
||
|
|
## Current Scope
|
||
|
|
|
||
|
|
This is a working first version, not the complete production workflow. The
|
||
|
|
template is an example, not an approved Xingbang report template. Custom template
|
||
|
|
management, semantic consistency checks, experience retrieval by Agent 1, ERP
|
||
|
|
approval/post-lease synchronization, and formal organization roles remain to be
|
||
|
|
implemented. Experience states currently record review progress; a searchable
|
||
|
|
state does not yet publish the card into a retrieval index.
|
||
|
|
|
||
|
|
The local model integration uses the existing scoped agent tools and
|
||
|
|
`backend/skills/report_evidence/SKILL.md`. Live model output requires a configured
|
||
|
|
local model with tool-calling support; automated tests mock that model call.
|
||
|
|
|
||
|
|
## Verification
|
||
|
|
|
||
|
|
Run from the repository root:
|
||
|
|
|
||
|
|
```powershell
|
||
|
|
python -m unittest discover -s backend -p "test_report_agent.py"
|
||
|
|
python -m unittest discover -s backend -p "test_risk_agent*.py"
|
||
|
|
python -m unittest discover -s backend -p "test_risk_core.py"
|
||
|
|
npx tsc --noEmit
|
||
|
|
```
|
||
|
|
|
||
|
|
`verify-report-agent.cjs` exercises report creation, chapter editing/locking and
|
||
|
|
Word download against the preview servers, and captures desktop/mobile layouts.
|