Weekly report workflows
| Report | Produces | Writes externally |
|---|---|---|
personal | The Feishu personal form | Feishu, under its existing gates |
personal_chat | The owner's three-section copy for the WeChat group | Never |
group | Summary of other members' reports read from WeChat | Never |
tencent | About 100 Chinese characters of progress, on Friday afternoons | Never |
Package
weekly_report/
workflow.py the one public entry, weekly_report(task)
steps/routing.py Agent prompt text only
reports/<report>/ roles, steps and README of each report
tests/<report>/
openprogram/programs/_authoring/reports/ shared sourcing, output, checkpoint, WeChat modules
Only the root PROGRAM_ENTRIES registers a tool, so Abilities shows one entry. Internal modules are excluded. Discovery allows one category-directory level, rejects symlinks and duplicates, and still needs source authorization. Functions in authorized external directories derive their UI path from their owning directory.
Routing
weekly_report calls an Agent to choose reports from the complete meaning, negation and context, never by keywords or colons. Code validates only the target enum and forwards the request verbatim: no summary, truncation or added draft-only limits.
| Request | Runs | Each child gets |
|---|---|---|
| Write my personal report; Tencent is only a reference, no group report | Only the personal report | The full request |
| Do personal and Tencent, not group | Those two | The same full request |
| Do all of them | All, with no shared period or recovery state | The same full request |
| Audience unclear | personal_chat, an unsent discovery draft; never a clarification | The full request |
- The owner's report for the group is
personal_chat.groupmeans collecting other members' reports. - One result returns verbatim; several get audience labels. A failed child's section reads as unfinished with its error, and the others still run; only when all fail is the first exception raised. Cancellation stops at once and attaches completed results.
- No shared week, checkpoint or completion state; each child owns its materials, output and recovery. Old router checkpoints do not resume: pass the child's resume request through
requests. - JSON
{"requests": {"tencent": …}}addresses children directly;result_format: "structured"returns aresultsmapping without claiming aggregate completion. - Each report interprets only its own part. Tencent stores the original in
user_requestfor later model context; materials allow original excerpts only. Group extraction keeps the complete request for source selection.
Source weeks and old drafts
- The execution week is not necessarily the source week. Memory candidates keep speaker type and source dates. Import time never labels old chat as this week.
- Trusted original owner records come first; equivalent sources are ordered by date descending within the week.
- Later factual revisions replace only what conflicts; independent progress stays.
- Automatic sourcing never reads Workflow checkpoints or a report's
sources.jsonas evidence. Exported sources with citation chains are for audit. - Recovery rejects invalidated checkpoints. A wrong week in an old draft keeps its files and audit records, invalidates that execution and retrieves real evidence. Missing material returns a waiting state, not the old draft.
Tencent content
| Aspect | Rule |
|---|---|
| Include | This week's actions, findings, results and current problems; methods, subjects and observations from same-week records; literature reviews and reproductions actually performed |
| Exclude | Direction discussion, meeting agendas, administration, future plans. Cite decisions or findings, not the meeting. No repeated topic lists |
| Do not invent | States such as completed, validated, improved. Actions without results stay actions. Related external material does not show the user did the work; paper results and personal reproduction are kept apart |
| Format | Always starts with the fixed Chinese prefix for “This week's progress:”, then numbered action sentences. No “model not provided” metadata, metaphors or slogans; unrecorded metrics do not mean no data |
| Enough material | Recorded optimization, submission and validation suffice; model lists and metrics are optional |
| Ask only when | No usable action exists, or core facts conflict irreconcilably |
| Supplementary search | After brief progress, up to three topic terms, same-week memory only, merged and deduplicated, then a second selection. At most two selection model calls. Results and budget go in the checkpoint, so recovery does not repeat. Each context at most 30 entries and 18 KB |
| Verification | Independent check of source support and reporting scope |
WeChat window reading
Binds the unique main window, PID and process-start identity, through GUI Harness MacWindow / window_session. Never opens, activates or raises a window, uses fullscreen screenshots or the clipboard, or delivers process-targeted keyboard or mouse events. Every operation revalidates window and control ownership.
| Operation | Rule |
|---|---|
| Enter a group name | Native AXSearchField only |
| Select a group | AXPress on a control matching the exact name and OCR location |
| Page | Only controls in the message region with accessibility paging; at most twelve pages per attempt, no claim of complete history |
| Screenshot | ScreenCaptureKit desktop-independent window. Nothing persists before the title in the image is verified |
| Message | Needs an in-page date and a designated member |
| Unsupported operation | Recoverable state; no switch to foreground |
| No Accessibility window (screenshot-only binding) | SEARCH_UNAVAILABLE; the visual reader reads only the conversation shown, never searches, selects or pages |
| Header verifies the group | READY, window_controls unavailable, coverage limited to one visible page |
| Header does not verify | CAPTURE_ONLY_GROUP_NOT_SHOWN with a reason; nothing persists |
| A refused background action | BACKGROUND_ACTION_UNAVAILABLE, never treated as applied |
| Transparent image, missing controls, changed window, concurrent use | Distinct reasons and recovery parameters. Never asks the user to raise the window or calls an empty capture missing permission |
Temporary screenshots are returned even on cancellation or failed validation. Apple marks NSWindow.SharingType.none legacy; it is not used to infer capture capability.
Agent execution
Session tools, structured output and timeouts
- New turns restore tool schemas from discovery state on the current branch, intersected with allowed tools. Other sessions and sibling branches do not inherit. Approval recovery uses existing checkpoints and never expands permissions. The ContextVar is released with the turn.
- A read-only Agent interprets group requests through memory search, directory lookup and file reads to find the group and ordered members. User-provided values win. No sending, writing, Shell, browser or recursive report tools. Unresolved fields stay missing.
- Structured stages use
response_formatwith prompt fallback: Runtime validates JSON and allows one correction within its request budget and timeout. A format error is a model failure with verbatim retry parameters, not missing user information. - Tool turns are governed by
max_iterations; a successful tool turn does not consume the failure budget, and normal calls do not replenish it. Every turn checks cancellation and the deadline. - Personal fields: a read-only retrieval Agent returns six named fields, validated by JSON Schema. Complete reports need non-empty current-week work and next-week plans; partial edits return only the requested fields. Source verification still decides what structured input is saved. Uncertain external writes are not replayed.
- Memory search, grep, get and browse are read-only safe tools; they keep
memory.readand explicit deny or ask rules. - Timeouts: model requests inherit the Runtime deployment timeout (
OPENPROGRAM_EXEC_TIMEOUT_S), with no 90-second limit. Later Tencent model stages keep 180 seconds. Browser deadlines and the no-retry rule for uncertain submissions stay.
Implementation status
- Router, partial completion and recovery are verified in the installed App.
- Real WeChat message reading is unfinished: calls against the local main window return fully transparent images.
- Session tool recovery, structured correction and timeout repairs are in verification; earlier acceptance exposed group-model format failures and missing chat invocation, so the full flow is not yet called healthy.
- Acceptance needs public-entry request-fidelity tests, child context tests, call-graph tests and local App runs through ordinary chat. A direct-function test cannot stand in for a failed chat call, and stage tests cannot replace real source reading or external submission.