Skip to content

Weaver graphical UI - #981

Merged
nonprofittechy merged 52 commits into
mainfrom
weaver-graphical-ui
Aug 2, 2026
Merged

Weaver graphical UI#981
nonprofittechy merged 52 commits into
mainfrom
weaver-graphical-ui

Conversation

@nonprofittechy

Copy link
Copy Markdown
Member

No description provided.

nonprofittechy and others added 21 commits April 19, 2026 10:18
apply_llm_draft_payload stored llm_draft_typical_role and
llm_draft_form_type but never promoted them to the live typical_role /
form_type / court_related fields the way it already does for title,
intro_prompt, description, etc.

Because typical_role is set early by _guess_role(), the weaver question
at assembly_line.yml:118 is never shown (variable already defined), so
the LLM's better classification was silently discarded.  The generated
interview then emitted a bare 'user_ask_role' reference (asking the end
user) instead of 'user_ask_role = "plaintiff"' when the LLM correctly
identified the role.

Fix: when the LLM payload contains a confident role ('plaintiff' or
'defendant'), override the heuristic value.  An LLM 'unknown' result
leaves the heuristic value intact so a keyword match isn't downgraded.
form_type (and the derived court_related) are applied for any valid
value, matching the apply=True path of llm_prefill_metadata.

Add four regression tests covering the new behaviour.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add _PersonObjectSpec dataclass and _PERSON_DEFAULT_PARAMS constant
  matching AssemblyLine's ql_baseline.yml defaults (users, children,
  witnesses, decedents, guardians_ad_litem)
- Add DAFieldList._guess_people_quantities(): reads final_display_var
  patterns like users[0].name.first to detect max index per person type
  and returns 'one' or 'more' quantity hints
- Add DAInterview._guess_objects_list(): builds objects list using person
  candidates + quantity heuristics; mirrors assembly_line.yml consolidation
  (defendants+plaintiffs → other_parties); always includes users
- Add _normalize_objects() helper: converts DAObjects to _PersonObjectSpec,
  filling empty params from field heuristics then per-person defaults
- Update generate_interview_artifacts() to accept optional objects list;
  auto-calls _guess_objects_list() when None; normalizes passed objects
  so empty params get sensible defaults instead of bare ALPeopleList
- Update assembly_line.yml to pass objects=list(objects) so user's
  explicit quantity answers are respected in manual (non-lucky) mode;
  in lucky mode objects have empty params so heuristics fill them in
- Add regression tests: _guess_people_quantities unit tests, objects
  block always generated, explicit objects respected

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
serialize_order_steps produced 2-space-indented Python code intended for
direct YAML embedding. When that string was set as a Python dict value
and serialized via canonical_block_yaml/yaml.dump, PyYAML saw a string
starting with spaces and emitted the explicit indentation indicator |2.
Docassemble does not handle |2 reliably.

Fix: change _append_steps(steps, 2) to _append_steps(steps, 0) so
serialize_order_steps produces clean 0-indent Python code. PyYAML then
handles indentation itself and emits plain |.

The raw YAML fallback path in api_editor.py (used when no existing order
block is found) now explicitly indents code_body lines with 2 spaces
when building the YAML string directly.

Update the two serialize_order_steps tests to expect 0-indent output.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nonprofittechy

Copy link
Copy Markdown
Member Author

Merging as placeholder; this doesn't break any existing functionality, just adds the alpha graphical layer

@nonprofittechy
nonprofittechy merged commit 879e0c7 into main Aug 2, 2026
4 of 7 checks passed
@nonprofittechy
nonprofittechy deleted the weaver-graphical-ui branch August 2, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant