The core of apcore is task orchestration and execution specifications. It provides a unified task orchestration framework that supports execution of multiple task types.
- Prioritize simplicity, readability, and maintainability above all.
- Avoid premature abstraction, optimization, or over-engineering.
- Code should be understandable in ≤10 seconds; favor straightforward over clever.
- Always follow: Understand → Plan → Implement minimally → Test/Validate → Commit.
- Use precise, full-word names (standard abbreviations only when conventional).
- Functions ≤50 lines, single responsibility, verb-named.
- Avoid obscure tricks, heavy comprehensions, excessive *args/**kwargs, unnecessary decorators.
- Break complex logic into small, well-named helpers.
- Full type annotations everywhere.
- Avoid
Anyexcept for dynamic/external data. - Prefer
dataclass,TypedDict,Protocol,NewType.
- Favor functional style + data classes; minimize inheritance.
- Composition > inheritance; use Protocols/ABCs only for true interfaces.
- No circular imports.
- Dependency injection for config, logging, DB, etc.
- Explicit exception handling; no bare
except:. - Context managers for files/DB/connections.
- Validate/sanitize all public inputs.
- Use
logging.infofor key paths. logging.error+ context for exceptions.- No
print()in production/debug code.
- Unit tests in
tests/, ≥90% coverage on core logic. - Name:
test_<unit>_<behavior>. - Never change prod code without/updating tests.
- After changes, always run:
- ruff check --fix .
- black .
- pyright .
- Zero errors/warnings before commit.
- Never hardcode secrets; use env/config.
- Validate/sanitize inputs.
- Avoid unjustified quadratic+ complexity in hot paths.
- English ONLY for comments, docstrings, logs, errors, commit messages.
- Fully understand surrounding code before changes.
- Do not generate unnecessary documentation, examples, stubs, or bloated
__init__.pyfiles unless explicitly requested.