Headless toolkit: CLI, codegen, HTTP, SQL, waits, email, PDF#209
Open
JE-Chen wants to merge 8 commits into
Open
Headless toolkit: CLI, codegen, HTTP, SQL, waits, email, PDF#209JE-Chen wants to merge 8 commits into
JE-Chen wants to merge 8 commits into
Conversation
Extend the no-GUI surface with five capabilities, each wired through the full stack (headless core, facade re-export, AC_ executor command, MCP tool, visual script-builder schema, headless tests) so they work from action files, the socket server, the scheduler and MCP without the GUI: - CLI: register the je_auto_control console script and add validate/lint, list-commands, fmt, record and codegen subcommands so action files are runnable and inspectable from CI. - codegen: turn recordings or action files into pytest, standalone Python, or Robot source (readable ac.<fn>(...) calls, executor fall-back for flow control). - HTTP/API: dependency-free http_request action (method, headers, JSON/raw body, basic/bearer auth, explicit timeout); http_to_var now shares it so it can POST bodies too. - SQL: read-only, parameterised SQLite query-to-var and assert-db steps built on the existing data-source loader. - wait-for-file: block until a download appears and stops growing.
Companion to launch_process: poll a host:port until a TCP connection succeeds, replacing unreliable sleeps when waiting for a server to come up. Follows the smart-waits pattern (injectable connector, WaitOutcome, hard timeout) and is wired through the full stack: headless wait_until_port, facade re-export, AC_wait_for_port executor command, ac_wait_for_port MCP tool, and a script-builder entry.
Round out the headless toolkit with two integrations, each wired through the full stack (headless core, facade, AC_ executor command, MCP tool, script-builder schema, tests): - email: send_email / AC_send_email sends mail via stdlib smtplib with TLS on by default (STARTTLS or implicit SSL, verified context), attachments and multiple recipients, so a flow can mail its report. - PDF: extract_pdf_text / pdf_metadata / assert_pdf_text plus the AC_pdf_to_var and AC_assert_pdf_text commands, backed by the optional pypdf extra (clear error when absent), to verify generated documents.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 322 |
| Duplication | 1 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
- email: harden the SMTP TLS context (explicit TLS 1.2+ floor and certificate validation) to clear S4423/S4830. - waits: hoist duplicated validation messages into module constants (S1192). - cli: give cmd_codegen a single return path (S3516). - mark the non-cryptographic random.Random seeds with # nosec B311 (flow-control random var, humanized motion/typing jitter). - tests: separate positional/keyword args (S5549/E1124), use pytest.approx for float comparisons (S1244), and NOSONAR the fake SMTP/HTTP test passwords (S2068).
Pass host/port and the timing kwargs as explicit positional/keyword arguments instead of **params, so static analysers can see there is no duplicate host/port argument (clears SonarCloud S5549 false positive).
The HTTP action allow-lists exactly http and https and rejects any other scheme; plain http is required for internal/localhost automation targets. Mark the reviewed clear-text-protocol hotspot with an inline NOSONAR justification (the repo's established suppression convention).
Add a "What's new (2026-06-18)" section to the English and zh-TW/zh-CN READMEs and a v5 new-features reference page (English + Traditional Chinese), registered in both Sphinx toctrees, covering the CLI, codegen, HTTP, SQL, email, PDF, and the file/port waits.
zh_index referenced doc/new_features/v4_features_doc but the Traditional Chinese page was never created with the 2026-06-17 toolkit (only the English one was), leaving a dangling toctree entry. Add the translated page so the Chinese Sphinx build resolves.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Extends the headless (no-GUI) surface with eight capabilities. Every
feature is wired through the full stack — headless core, package-facade
re-export,
AC_*executor command, MCP tool, visual script-builderschema, and headless tests — so each works from action files, the socket
server, the scheduler and MCP without ever importing PySide6.
Features (by commit)
8cb901d— CLI, codegen, HTTP, SQL, file-waitje_auto_controlconsole script; addvalidate/lint,list-commands,fmt,record,codegen,versionsubcommands.Python, or Robot source (readable
ac.<fn>(...)calls, executorfall-back for flow control).
http_requestaction (method, headers,JSON/raw body, basic/bearer auth, explicit timeout);
http_to_varnowshares it and can POST bodies.
AC_sql_to_var/AC_assert_db.8184f80—AC_wait_for_port: block until a TCP port acceptsconnections (pairs with
launch_process).7cc39d7— email + PDFsend_email/AC_send_emailvia stdlibsmtplib, TLS onby default (verified context), attachments + multiple recipients.
extract_pdf_text/pdf_metadata/assert_pdf_textplusAC_pdf_to_var/AC_assert_pdf_text, backed by the optionalpypdfextra (clear error when absent).
Safety
import je_auto_controlstays Qt-free (verified in a subprocess test).timeouts, no
verify=False, no hardcoded credentials.realpathbefore I/O.Testing
HTTP/SMTP/PDF backends are monkeypatched or injected).
ruff,radon(CC < C) andbanditclean on all changed files.