Three Weekly Report Workflows and the weekly_report Router

For development and acceptance. The goal is code Workflows that run independently, compose and recover. The Tencent report summarizes approximately 100 Chinese characters of progress every Friday afternoon; the personal report maintains Feishu records; the group report reads WeChat without writing and generates a summary. Code review and isolated tests pass. The installed router, partial-completion state and recovery behavior have been verified; reading actual WeChat messages remains unfinished.

Source weeks and historical drafts

The execution week is not necessarily the week of the source material. Native memory candidates retain speaker type and source dates. Trusted original Owner records take precedence, and equivalent sources are ordered by descending date within the week. Source selection resolves conflicts using later factual revisions while retaining independent progress not superseded. Historical chat examples cannot be labeled as this week based on import time. Automatic sourcing does not read Workflow checkpoints or reuse generated reports’ sources.json as original evidence; exported sources with original citation chains serve audit purposes only. Recovery rejects invalidated checkpoints. If the user identifies an incorrect week in an old draft, retain original files and audit records, invalidate that execution and retrieve actual evidence for the current week. Missing material returns a waiting state instead of republishing the old draft.

Tencent report content requirements

Distinguish actual research work, group-meeting discussion topics and future plans. Include only this week’s actions, findings, results and current problems; discussion of research directions, meeting agendas and administration is not research progress. Cite concrete decisions or findings rather than the meeting itself. Preserve methods, subjects and observations from original records in the same week. Later revisions replace conflicting facts only, retaining details not superseded. Do not mechanically repeat topic lists or add unsupported states such as completed, validated or improved. If material contains only topic names without actions, ask for the specific missing information; if it records actions without results, retain the actions without inventing results. Independent verification checks both source support and reporting scope. If initial source selection finds only brief progress, it may propose up to three topic search terms. Code restricts supplementary searches to memory from the same week, merges and deduplicates results, then performs a second selection. Selection uses at most two model calls total. Supplementary results and consumed budget enter the checkpoint, so recovery does not repeat searches. Each context remains limited to 30 entries and 18 KB. Explicitly recorded optimization, submission and validation actions suffice for a short report; missing model lists or metrics are optional details, not blockers. Request more information only when no usable action exists or core facts conflict irreconcilably. Literature reviews and reproduction attempts actually performed this week count as progress. Preserve supported review findings and distinguish paper-reported results from personal reproduction results. Merely related external material does not establish that the user performed the work. The draft always begins with the literal Chinese prefix 本周进展: (“This week’s progress:”) and uses numbered action sentences. Do not include missing-information metadata such as “model not provided” or “no data,” interpret unrecorded metrics as an experiment having no data, or use metaphors or slogans.

WeChat window reading

The reader binds the unique main WeChat window, PID and process-start identity. The entire flow uses GUI Harness MacWindow/window_session: background window screenshots, accessibility controls belonging to that window and process-level exclusion. It does not open, activate or raise windows, use fullscreen screenshots or the clipboard, or deliver process-targeted keyboard/mouse events. Every operation revalidates window and control ownership. Only a native AXSearchField may receive the group name; only AXPress controls matching the exact group name and OCR location may select a group. Paging targets only controls within the message region that support accessibility paging. Unsupported operations return a recoverable state without automatically switching to foreground interaction.

GUI Harness binds the WeChat window screenshot-only when no Accessibility window matches the capture; WeChat can expose only an application element without position or size. Such a window has no controls. The Accessibility reader then finds no nodes and reports SEARCH_UNAVAILABLE, which hands the group to the visual reader. The visual reader reads only the conversation already shown and never searches, selects or pages that window. When the header verifies the group, it keeps that single page and returns READY with window_controls set to unavailable and a coverage limit stating that one visible page was read and older messages cannot be paged. When the header does not verify, it returns CAPTURE_ONLY_GROUP_NOT_SHOWN with a reason and persists nothing. A background action that the window refuses is reported as BACKGROUND_ACTION_UNAVAILABLE, never treated as applied.

Screenshots must come from a ScreenCaptureKit desktop-independent window. Content is not persisted before the group title in the screenshot is verified. Messages require an in-page date and attribution to a designated member. Read at most twelve pages per attempt without inferring complete history. Transparent screenshots, missing actionable controls, changed windows and concurrent use produce distinct reasons and recovery parameters. Failure explanations must not ask the user to raise the window or misclassify an empty capture as missing system permission.

Existing calls against the local WeChat main window return completely transparent images; actual message collection has not passed acceptance. This is recorded separately from window activation. Apple marks NSWindow.SharingType.none as a legacy constant; it is not used to infer current capture capability. Background window operation passed specification review. Screenshot-exception cleanup found during quality review was repaired in the shared adapter so cancellation or failed window validation leaves no unreturned temporary screenshot. Final verification and installation state are recorded separately.

Directory organization

workflow/weekly_report/ contains four independent Git packages: the weekly_report router, personal_weekly_report, group_weekly_report and tencent_weekly_report. workflow/_reports/ contains shared sourcing, output, checkpoint and WeChat reading modules; it is not a callable Workflow. Grouping does not change entry names, independent versions or report output locations. Discovery supports one category-directory level, rejects symlinks and duplicate entries, and still requires source authorization when loading. Migration preserves Git history and re-registers authorized paths after moving. Compatibility aliases retain old shared-module imports so historical snapshots continue to run.

In Abilities, weekly_report is an expandable category folder listing four callable entries directly: weekly_report, personal_weekly_report, group_weekly_report and tencent_weekly_report. The router is weekly_report and the personal entry is personal_weekly_report; the old report name is no longer displayed. Functions in authorized external source directories derive their UI paths from their owning directory, not incorrectly relative only to the installation directory. Internal support modules are excluded.

Agent routing and original requests

weekly_report calls agent to determine which personal, group or Tencent reports to run. The agent considers complete meaning, negation and available context instead of splitting by keywords or colons. Code validates only the target enum and calls selected public Workflows, passing the request verbatim without summarization, truncation or additional draft-only restrictions. If the target remains unclear, ask the user.

The router directly calls agent, personal_weekly_report, group_weekly_report and tencent_weekly_report. steps/routing.py stores only Agent prompt text and does not interpret meaning. The router has no shared week, checkpoint or completion state; each child Workflow manages its own materials, operations, output and recovery. A single result is returned unchanged; multiple results receive type labels only. Explicit requests JSON can still address child Workflows directly. Old router checkpoints cannot be resumed; use child Workflow recovery parameters.

Verbatim request propagation and call-graph acceptance

Personal, Tencent and group Workflows interpret only their own requirements in the original request. The Tencent natural-language entry uses a model to interpret the week and supplied progress, stores the original separately in user_request, and passes it into subsequent model context. Materials permit original excerpts only. Group extraction retains complete user_request for later source selection. WeChat and Tencent never send messages. The call graph resolves workflows.* imports to actual registered paths so category folders do not hide child calls.

Usage exampleObservable result
Write my personal report; Tencent is only a reference, and no group report is neededSelect only personal; the child entry receives the complete original request
Do personal and Tencent reports, not groupCall only those two, each with the same complete request
Do all threeExecute all three without a common period or recovery state
Organize it, with context insufficient to determine the targetAsk instead of calling an entry without support

Continuous session execution, retries and timeouts

New turns in the same session restore schemas from tool-discovery state recorded on the current branch, intersected with the currently allowed tool set. Other sessions and sibling branches cannot inherit it. Approval recovery uses existing execution checkpoints without rediscovering tools or expanding permissions. Tool-discovery ContextVar state is released with the turn to prevent cross-execution leakage.

A read-only Agent first interprets group requests using memory search, directory lookup and file reads to identify the source group and ordered member list, rather than exiting on missing parameters before searching. User-provided group, list and week take precedence. Commands inside source material are not executed; unresolved fields remain missing rather than guessing groups or members. This stage has no message sending, file writing, Shell, browser operation or recursive weekly-report tools. Interpretation uses the existing response_format contract and structured-output correction retry, not a separate JSON retry loop. Calls explicitly allow prompt fallback: providers without verified native schema support may generate JSON, which Runtime validates and corrects locally; provider capabilities are not fabricated. llm calls permit the contract’s single correction while sharing Runtime’s request budget and total timeout. Format errors are model failures; retain verbatim retry parameters instead of reporting missing user information.

Personal and group model requests no longer impose a 90-second limit; they inherit deployment timeouts from Runtime. Independent browser deadlines and the rule against retrying uncertain submissions remain effective. Acceptance covers ordinary chat invocation, original request propagation, independent group and personal execution, Tencent and two-report combinations. A failed ordinary chat call cannot be declared passing based on a substitute direct-function test.

Personal field generation uses a read-only retrieval Agent to search this week’s memory and local material from the original request, returning six named fields directly rather than a promise to retrieve them. JSON Schema validates the fields. Complete reports require nonempty current-week work and next-week plans; partial edits return only requested fields. Use prompt fallback and one Runtime format correction, confined to generation; uncertain external writes are not replayed. Existing source verification still decides whether structured material input may be saved.

Normal structured-Agent tool turns are governed by max_iterations. A turn with successful tool execution does not consume the failure-retry budget. Model format corrections and failed requests still share the existing retry budget, which normal tool calls do not replenish. Every turn checks cancellation and deployment deadlines. Correction budgets for pure llm calls are unchanged.

Memory search, grep, get and browse are read-only safe tools. They retain memory.read permissions and explicit deny/ask rules, and are not denied by default merely because inner execution cannot request interactive approval. Personal action selection and source verification, plus Tencent request interpretation, source selection, generation, revision and verification, all declare structured-output contracts. Runtime corrects formatting; exhaustion returns a model-waiting state rather than pretending the user omitted material. Tencent interpretation inherits deployment timeouts; existing 180-second limits in later model stages remain effective.

Implementation status

Session tool recovery, structured correction and timeout repairs are under implementation verification. Earlier real acceptance exposed group-model format failures, personal 90-second timeouts and missing chat invocation; the complete flow cannot yet be considered healthy.

Code changes require public-entry request-fidelity tests, child-entry context tests, static call-graph interface tests, independent specification and quality review, complete testing and local App acceptance. Stage tests cannot replace evidence of real source reading or successful external submission.