Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
2626 commits
Select commit Hold shift + click to select a range
dddcc83
Merge pull request #189 from awslabs/fix/sdk_init_config_handlers
fgogolli Mar 31, 2026
8b16c27
Merge pull request #187 from awslabs/dependabot/github_actions/github…
fgogolli Mar 31, 2026
16bc628
Merge pull request #188 from awslabs/chore/monthly-dependency-mainten…
fgogolli Mar 31, 2026
da54bdf
test(onmoto): add EC2Fleet, ASG, SpotFleet price type matrix tests
fgogolli Mar 31, 2026
a366cc9
fix(tests): resolve all pyright errors across test suite and enforce …
fgogolli Mar 31, 2026
5da2798
style: auto-format code with ruff [skip ci]
github-actions[bot] Mar 31, 2026
35e1705
test(onmoto): complete epic 1670 — RunInstances gaps, cross-cutting, …
fgogolli Mar 31, 2026
5170f4b
style: auto-format code with ruff [skip ci]
github-actions[bot] Mar 31, 2026
179e07c
fix(cli): use plain print for JSON output and fix Rich console line w…
fgogolli Mar 31, 2026
b2f75d6
style: auto-format code with ruff [skip ci]
github-actions[bot] Mar 31, 2026
ad7ace4
test(onmoto): complete epic 2153 — full onmoto/onaws equivalence cove…
fgogolli Mar 31, 2026
9ae7818
fix(providers): EC2Fleet/SpotFleet request fleet deleted on partial r…
fgogolli Mar 31, 2026
0a1b140
style: auto-format code with ruff [skip ci]
github-actions[bot] Mar 31, 2026
c20cb47
fix(tests): add explanatory comments to empty except blocks in test_c…
fgogolli Mar 31, 2026
a12dc01
fix(ci): fix ruff import sorting/unused imports and restore uv.lock f…
fgogolli Apr 1, 2026
05bf22c
fix(onaws): correct partial return test matrix across all provider APIs
fgogolli Apr 1, 2026
82c8939
style: auto-format code with ruff [skip ci]
github-actions[bot] Apr 1, 2026
86fccb1
fix(tests): rename unused return_request_id to _return_request_id in …
fgogolli Apr 1, 2026
b502722
fix(ci): exclude intentional missing-import test files from pyright, …
fgogolli Apr 1, 2026
176deb8
fix(tests): log return_request_id for traceability in cleanup step
fgogolli Apr 1, 2026
ddb3f43
fix(tests): skip partial return test when fewer than 2 physical insta…
fgogolli Apr 1, 2026
aae9d87
style: auto-format code with ruff [skip ci]
github-actions[bot] Apr 1, 2026
fae636d
chore: monthly dependency maintenance
fgogolli Apr 1, 2026
91b02b2
Add docstrings to all public members
Apr 1, 2026
919c325
Fix packaging
Apr 1, 2026
888df31
Fix DI for performance config
Apr 1, 2026
ae3081a
Fix acquire_hosts — Null Access in Error Path
Apr 1, 2026
92fe858
Log stack trace
Apr 1, 2026
889f3cd
Fix: Termination Service Falls Back to "unknown" Resource ID
Apr 1, 2026
aa6cc49
Fix: AzureTemplate Aggregate Not Frozen
Apr 1, 2026
7c397bc
Fix: Multiple after validators
Apr 1, 2026
e9c6394
Simplify unneeded factories
Apr 1, 2026
bcd438b
More exceptions stack trace
Apr 1, 2026
689826f
Fix code duplication
Apr 1, 2026
0b383cb
Tighten typing
Apr 1, 2026
fa6f9b1
Remove micro-abstractions
Apr 1, 2026
e9cf720
Remove _CycleCloudSessionScope
Apr 1, 2026
18219a4
Inline helper methods that are just passed through
Apr 1, 2026
972c825
Fix: VMSS Flexible Delete — Intermediate State Exposure
Apr 1, 2026
107d4a7
Validate no spot-specific settings for non-spot VMs
Apr 1, 2026
b8cf250
Fix concurrency issues with shutdown
Apr 1, 2026
730cd7b
Type some exception matching
Apr 1, 2026
3681d3d
fix(ci+tests): add integration/onmoto/e2e to PR workflow, fix e2e tes…
fgogolli Apr 1, 2026
7ee114c
Simplify return logic
Apr 1, 2026
e68d91d
fix(tests): fix 8 pre-existing test failures across e2e, integration,…
fgogolli Apr 1, 2026
42e20a5
style: auto-format code with ruff [skip ci]
github-actions[bot] Apr 1, 2026
1fd83fb
fix(tests+ci): fix remaining test failures and parallelise CI test jobs
fgogolli Apr 1, 2026
f7bc3a1
fix(ci+tests): fix coverage XML generation, codecov flags, and remain…
fgogolli Apr 1, 2026
ab495ae
fix(tests): fix remaining integration and onmoto test failures
fgogolli Apr 1, 2026
ebd5c38
style: auto-format code with ruff [skip ci]
github-actions[bot] Apr 1, 2026
6931790
fix(tests): fix Python 3.14 compatibility and coverage generation
fgogolli Apr 1, 2026
0565673
style: auto-format code with ruff [skip ci]
github-actions[bot] Apr 1, 2026
bdfce3e
fix(tests): fix create_return_request assertion to use created_reques…
fgogolli Apr 1, 2026
b7a9816
fix(tests): mock health port in auth_client fixture and bearer token …
fgogolli Apr 1, 2026
3f30c94
style: auto-format code with ruff [skip ci]
github-actions[bot] Apr 1, 2026
bc748f6
fix(tests): remove duplicate deps imports flagged by GH code quality bot
fgogolli Apr 1, 2026
4c43204
style: auto-format code with ruff [skip ci]
github-actions[bot] Apr 1, 2026
0e85fb1
Partially fix cyclecloud_handler.py
Apr 2, 2026
708dccc
cc works again (interim patch)
Apr 2, 2026
3076a9d
Fix cyclecloud
Apr 2, 2026
7d595cc
Fix cyclecloud
Apr 2, 2026
f6227ad
fix(tests+ci): fix scheduler-agnostic assertions and coverage XML par…
fgogolli Apr 2, 2026
f32fce6
style: auto-format code with ruff [skip ci]
github-actions[bot] Apr 2, 2026
9f21bb7
Make VMSS cleanup thread safe
Apr 2, 2026
4294244
Remove dead code
Apr 2, 2026
59c6b44
Fix exports
Apr 2, 2026
73210b5
fix(tests): mock health port in base client fixture to prevent 503 in CI
fgogolli Apr 2, 2026
0a73740
style: auto-format code with ruff [skip ci]
github-actions[bot] Apr 2, 2026
56b9cd1
Merge pull request #190 from awslabs/test/onmoto-full-aws-coverage
fgogolli Apr 2, 2026
f1964de
Merge pull request #191 from awslabs/chore/monthly-dependency-mainten…
fgogolli Apr 2, 2026
1bb372b
1.5.2
github-actions[bot] Apr 2, 2026
b993701
Fix registration typing
Apr 7, 2026
355e03a
Ensure partial fulfilment of spot instances is counted correctly
Apr 7, 2026
7d2b84d
Fix: Request status reconciliation misses terminal planned-spot short…
Apr 7, 2026
fa49ea9
fix(cli): add --socket-path for Unix socket IPC and fix ANSI output i…
fgogolli Apr 7, 2026
8a2f113
chore: add sdk-go make targets to .PHONY
fgogolli Apr 7, 2026
823012f
test: add client template format tests and per-request scheduler head…
fgogolli Apr 7, 2026
87ff1d6
style: auto-format code with ruff [skip ci]
github-actions[bot] Apr 7, 2026
c0dec9f
Initial GCP skeleton
Apr 8, 2026
b00f5d5
Ensure Azure fully wired
Apr 8, 2026
e25895a
Ensure Azure fully wired
Apr 8, 2026
333853a
Ensure Azure fully wired orb-init
Apr 8, 2026
15c2a1b
Split Azure Client
Apr 8, 2026
c6cb0be
Merge branch 'IML/azure' into IML/gcp
Apr 8, 2026
748c0b9
Retry
Apr 8, 2026
bb3d179
Boot disk normalisation
Apr 8, 2026
496efb4
Require zone
Apr 8, 2026
d11c372
fix: remove duplicate import in test_scheduler_header.py
fgogolli Apr 8, 2026
6ad3d72
Make sure multiple resource IDs/names are supported
Apr 8, 2026
29932d2
fix: resolve pyright, workflow, and GH code quality issues
fgogolli Apr 8, 2026
65b493c
fix: harden Go SDK release and add Go dependency monitoring
fgogolli Apr 8, 2026
7ab47bc
feat: move go.mod to root for unified version tags
fgogolli Apr 8, 2026
f71ed7d
fix: restore sdk/go/ path segment in internal Go imports
fgogolli Apr 8, 2026
3a34d05
fix(ci): update sdk-go workflow to use root go.mod and make targets
fgogolli Apr 8, 2026
82a64ea
fix: add type: ignore to rich.console import for pyright
fgogolli Apr 8, 2026
16225c4
fix: move type: ignore to from line for rich_argparse import
fgogolli Apr 8, 2026
b15e080
fix: install all extras in CI so optional deps like rich are availabl…
fgogolli Apr 8, 2026
2a03e52
Merge pull request #193 from awslabs/fix/orb-go
fgogolli Apr 8, 2026
8ac4fe4
ci(deps): bump the github-actions group across 1 directory with 2 upd…
dependabot[bot] Apr 8, 2026
48e882c
chore: monthly dependency maintenance
fgogolli Apr 8, 2026
ddd7377
Merge pull request #196 from awslabs/chore/monthly-dependency-mainten…
fgogolli Apr 8, 2026
ac3aa58
fix: bump go 1.22 to 1.24 and pin ogen to v1.19.0 in drift check
fgogolli Apr 8, 2026
4826488
Merge pull request #195 from awslabs/dependabot/github_actions/github…
fgogolli Apr 8, 2026
aea538f
1.6.0
github-actions[bot] Apr 8, 2026
96951ff
service_account_scopes
Apr 9, 2026
0212b15
service_account_scopes
Apr 9, 2026
a2dff29
service_account_scopes
Apr 9, 2026
630519c
Remove unwired fields
Apr 9, 2026
dd90c64
Exceptions
Apr 9, 2026
76a70de
fix(request-flow): enforce state machine, fix model_copy, zero-instan…
fgogolli Apr 9, 2026
bd2b90e
fix(request-flow): fix return path, orchestrator, and status sync bugs
fgogolli Apr 9, 2026
e547aa3
fix(api): rename correlation_id in error responses, guard request_id,…
fgogolli Apr 9, 2026
6565112
fix(launch-template): unblock launchTemplateId-only flow
fgogolli Apr 9, 2026
d2b594e
feat(launch-template): LT override versioning, on_update_failure, on_…
fgogolli Apr 9, 2026
95cf90a
fix(aws): cache native spec service, non-retryable IAM errors, archit…
fgogolli Apr 9, 2026
1659fe2
fix(config): rename app.log→orb.log, orb init dir persistence, remove…
fgogolli Apr 9, 2026
3c06da4
fix(ci): install ORB before sdk-go-export-spec, enforce onmoto tests …
fgogolli Apr 9, 2026
e26361b
test: update tests for new behaviour, add onmoto LT edge case tests, …
fgogolli Apr 9, 2026
d7c4a8e
docs: IAM permissions guide, consolidate installation docs, document …
fgogolli Apr 9, 2026
8fcd8bd
chore: update uv.lock
fgogolli Apr 9, 2026
637f2b2
docs: remove orphaned docs/installation.md (content merged into docs/…
fgogolli Apr 9, 2026
a4bbadc
fix: wire orb config show missing sections, fix fleetRole ARN expansi…
fgogolli Apr 10, 2026
7972a46
Retry policy
Apr 10, 2026
040a4aa
Documentation
Apr 10, 2026
cf2050f
Merge pull request #197 from awslabs/fix/post-merge-cleanup
fgogolli Apr 10, 2026
3051806
Partial success
Apr 10, 2026
6c83230
Better partial success
Apr 10, 2026
7841b51
Better architecture
Apr 10, 2026
9d49ebc
Dead code
Apr 10, 2026
66f2af0
Dead code
Apr 10, 2026
f3856ee
fix(ci): add --no-isolation to python -m build to fix semantic release
fgogolli Apr 10, 2026
02b81ff
Merge pull request #198 from awslabs/fix/semantic-release-build
fgogolli Apr 10, 2026
cd96ef1
ci(deps): bump actions/github-script in the github-actions group
dependabot[bot] Apr 12, 2026
d286a94
fix(ci): restore build dependency fallback and add --group ci to uv sync
fgogolli Apr 13, 2026
b5333dc
Merge pull request #200 from awslabs/fix/semantic-release-build-proper
fgogolli Apr 13, 2026
7bbb931
Merge pull request #199 from awslabs/dependabot/github_actions/github…
fgogolli Apr 13, 2026
2648b58
Types
Apr 13, 2026
e256899
Merge branch 'IML/azure' into IML/gcp
Apr 13, 2026
ae9bd04
More types :p
Apr 13, 2026
abaae4d
Merge branch 'IML/azure' into IML/gcp
Apr 13, 2026
f21b6f2
Clean up ambiguous union types
Apr 13, 2026
72032f8
Clean up ambiguous union types
Apr 13, 2026
1f274fb
Merge branch 'IML/azure' into IML/gcp
Apr 13, 2026
f1d9522
Correct capabilities.py
Apr 13, 2026
9b1944c
Clean up useless tests
Apr 13, 2026
ae8a849
Clean up more useless tests
Apr 13, 2026
0d91dee
Clean up more useless tests
Apr 13, 2026
a19f9de
Clean up more tests
Apr 14, 2026
6f04cc6
GCP dry run support
Apr 14, 2026
12e456e
Fix lazy import
Apr 14, 2026
1868773
Merge branch 'IML/azure' into IML/gcp
Apr 14, 2026
a499eeb
GCP health check
Apr 14, 2026
9e7dc80
GCP enums
Apr 14, 2026
3bd5ed2
Filter MIG name cloudside
Apr 14, 2026
dea588c
Wire handler factory
Apr 14, 2026
a015bb4
Merge branch 'IML/azure' into IML/gcp
Apr 15, 2026
44dbe18
Fix exception logging
Apr 15, 2026
40dbb7b
nits
Apr 15, 2026
573bf80
Add GCP enum
Apr 15, 2026
2eb1091
Merge branch 'IML/azure' into IML/gcp
Apr 15, 2026
30a8eec
Fix mig handler
Apr 15, 2026
8d40a7e
Fix mig handler
Apr 15, 2026
8eb3af7
Add timeout to Azure handler
Apr 15, 2026
c02c61a
Merge branch 'IML/azure' into IML/gcp
Apr 15, 2026
d580fd5
Tighten typing
Apr 15, 2026
e161736
Ensure secrets are not in __repr__
Apr 15, 2026
c73d7f9
Merge branch 'IML/azure' into IML/gcp
Apr 15, 2026
31fcc29
Regularise types around config
Apr 15, 2026
3b6f8a9
Regularise types around config
Apr 15, 2026
dd89978
Merge branch 'IML/azure' into IML/gcp
Apr 15, 2026
f05854b
Regularise types around config
Apr 15, 2026
c076378
Merge branch 'IML/azure' into IML/gcp
Apr 15, 2026
6d784ea
Fix DI
Apr 15, 2026
ed5a329
Use enums as keys in the AHF
Apr 15, 2026
a482912
Merge branch 'IML/azure' into IML/gcp
Apr 15, 2026
a608616
Use enums as keys in the GHF
Apr 15, 2026
b2cd1ac
Fix: GCPOperationContextService is rebuilt per operation.
Apr 16, 2026
a6d6251
Cleanup Azure tests
Apr 16, 2026
90a125c
Merge branch 'IML/azure' into IML/gcp
Apr 16, 2026
951b3b2
Azure race condition
Apr 16, 2026
433a5fe
Merge branch 'IML/azure' into IML/gcp
Apr 16, 2026
f8bda49
Azure exception correction
Apr 16, 2026
abee012
Merge branch 'IML/azure' into IML/gcp
Apr 16, 2026
0062f1d
GCP error shim
Apr 16, 2026
fa3c716
Better mix size support
Apr 17, 2026
75e4fd1
Merge branch 'IML/azure' into IML/gcp
Apr 17, 2026
0d3b2ce
Extract _build_instance_configuration
Apr 17, 2026
b6ffaed
Timeout for GCP Template Operation Wait
Apr 17, 2026
8fb38e6
Assert -> if
Apr 17, 2026
8fe23b4
Improve typing
Apr 17, 2026
957e7d6
Improve typing
Apr 17, 2026
b869d4d
Merge branch 'IML/azure' into IML/gcp
Apr 17, 2026
e405cad
Improve region metadata
Apr 17, 2026
6513b2c
Remove unused retry strat
Apr 20, 2026
3bc7d0e
Merge branch 'main' into IML/azure
Apr 20, 2026
07c6095
Fix main merge
Apr 20, 2026
7df0c74
Merge branch 'IML/azure' into IML/gcp
Apr 20, 2026
0d56f03
Extract inventory_query_service.py and runtime_dependencies.py from s…
Apr 20, 2026
f3e3e13
Merge branch 'IML/azure' into IML/gcp
Apr 20, 2026
3ff3542
Tighten types around AzureProviderApi
Apr 20, 2026
3f5f90b
Merge branch 'IML/azure' into IML/gcp
Apr 20, 2026
49570da
More type tightening and removal of duplicated code
Apr 20, 2026
0648dba
Merge branch 'IML/azure' into IML/gcp
Apr 20, 2026
944ff22
Lazy import of error types
Apr 20, 2026
2269e28
Merge branch 'IML/azure' into IML/gcp
Apr 20, 2026
884db67
Fix bug with error leading to VMSS deletion
Apr 20, 2026
bcc4e21
Merge branch 'IML/azure' into IML/gcp
Apr 20, 2026
6f1dd78
Initial async conversion
Apr 24, 2026
2d20497
Error handling fixes
Apr 24, 2026
56f3cde
Tighten typing
Apr 27, 2026
6e46f75
Fix health check
Apr 27, 2026
9add34e
VMSS polling limit
Apr 27, 2026
11e94d0
Remove dead code
Apr 27, 2026
6a9c84f
Documentation
Apr 27, 2026
e059708
Remove dead field
Apr 27, 2026
01eb5ad
Fix return type
Apr 27, 2026
bd2233d
Remove duplication in init
Apr 27, 2026
d2c535e
Tighter typing
Apr 28, 2026
165d986
Extract error logic and documentation
May 7, 2026
bbff76d
Better seem around inventory service
May 7, 2026
9aa3188
Better seem around termination service
May 7, 2026
4deb11d
# type: ignore
May 7, 2026
50fd9b0
Merge remote-tracking branch 'origin/main' into IML/azure-gcp-async
May 12, 2026
7d4e8e9
Update to model copy to account for new contract
May 12, 2026
b42ead6
Fix payload
May 12, 2026
f594cdc
Matched changed contract
May 13, 2026
ce2dd60
GET_INSTANCE_STATUS dropped status and machine fields before returnin…
May 29, 2026
d4e240c
Fix tests to return correct string
May 29, 2026
8dafc3b
Resolved: VMSS follow-up context producer and consumer disagreed on t…
May 29, 2026
7034494
Fix Azure fields getting injected into all DTOs and normalised GCP
Jun 1, 2026
70134cd
Fix multi resource group termination requests returning success if an…
Jun 2, 2026
b4a7b50
Fix GCP API mismatch
Jun 2, 2026
88c917d
Fix GCP API mismatch
Jun 2, 2026
3aa514d
Fix GCP request polling
Jun 3, 2026
f6f7264
Fix GCP return reqeusts
Jun 3, 2026
14d28ec
Fix GCP MIG request
Jun 3, 2026
48696a9
Fix GCP MIG status
Jun 3, 2026
2d16261
Fix GCP MIG return
Jun 3, 2026
f3247c8
Fix GCP MIG spot
Jun 4, 2026
080ae17
Trust types
Jun 8, 2026
5acffb1
Merge branch 'main' into IML/azure-gcp-async
Jun 8, 2026
e098b7e
Fix tests
Jun 8, 2026
bae6b8c
Fix ProviderConfigBuilder contract mismatch
Jun 8, 2026
79c9828
Various integration issues
Jun 8, 2026
cd7de69
Fix tests
Jun 8, 2026
332f4ed
Fix tests
Jun 8, 2026
37eae89
Churn reduction
Jun 9, 2026
2cf11d9
Bug fixes and warnings
Jun 9, 2026
ba5f3b1
Bug fix for Azure spot
Jun 9, 2026
171673d
Merge branch 'finos:main' into IML/azure-gcp-async
IkeM-L Jun 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ terraform.rc

# Application specific
config/config.json
config/cyclecloud-credentials.json
# Runtime-generated script copies (orb init)
/scripts/
data/
Expand Down
133 changes: 133 additions & 0 deletions dev-tools/quality/quality_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,22 @@ def can_autofix(self) -> bool:
return True


class UnjustifiedGetAttrViolation(Violation):
"""getattr call without a justifying ``# getattr`` comment."""

def __init__(self, file_path: str, line_num: int, content: str):
super().__init__(
file_path,
line_num,
content,
"getattr should only be used when absolutely needed; "
"justify with a comment starting with '# getattr' on the same "
"or a preceding line if it is needed, remove getattr if not. Strongly prefer"
"removing, use web search to find the real API for external SDK calls. Do not replace"
"with an equivalent pattern that avoids getattr but is still the same anti-pattern.",
)


# --- Checker Classes ---


Expand Down Expand Up @@ -555,6 +571,120 @@ def check_content(self, file_path: str, content: str) -> list[Violation]:
return violations


class GetAttrChecker(FileChecker):
"""Enforce justified ``getattr`` use in Azure and GCP provider code.

Every ``getattr(...)`` call in ``src/orb/providers/azure/`` and
``src/orb/providers/gcp/`` must have a comment starting with ``# getattr``
on the same line, on a preceding line within the same scope, or in the
enclosing function/method docstring. This keeps defensive SDK access
intentional and documented at the provider boundary.
"""

_PROVIDER_PREFIXES = (
os.path.join("src", "orb", "providers", "azure"),
os.path.join("src", "orb", "providers", "gcp"),
)
_GETATTR_CALL = re.compile(r"\bgetattr\s*\(")
_JUSTIFICATION_COMMENT = re.compile(r"#\s*getattr\b")
_JUSTIFICATION_DOCSTRING = re.compile(r"\bgetattr\b")
_SCOPE_BOUNDARY = re.compile(r"^\s*(def |class )")
_MAX_LOOKBACK = 30

def check_content(self, file_path: str, content: str) -> list[Violation]:
if not file_path.endswith(".py"):
return []
normalised = os.path.normpath(file_path)
if not any(prefix in normalised for prefix in self._PROVIDER_PREFIXES):
return []

violations: list[Violation] = []
lines = content.splitlines()

# Pre-compute the docstring that covers each function/method body so
# we can check it cheaply per getattr line.
scope_docstrings = self._build_scope_docstring_map(lines)

for idx, line in enumerate(lines):
if not self._GETATTR_CALL.search(line):
continue
if self._is_justified(lines, idx, scope_docstrings):
continue
violations.append(
UnjustifiedGetAttrViolation(file_path, idx + 1, line.strip())
)
return violations

def _is_justified(
self,
lines: list[str],
idx: int,
scope_docstrings: dict[int, str],
) -> bool:
"""Return True if the getattr at *idx* has a visible justification."""
line = lines[idx]

# 1. Same-line comment.
if self._JUSTIFICATION_COMMENT.search(line):
return True

# 2. Scan backward within the same scope for a ``# getattr`` comment.
for back in range(1, self._MAX_LOOKBACK + 1):
prev_idx = idx - back
if prev_idx < 0:
break
prev = lines[prev_idx]
if self._JUSTIFICATION_COMMENT.search(prev):
return True
if self._SCOPE_BOUNDARY.search(prev):
break

# 3. Enclosing function/method docstring mentions ``getattr``.
for scope_start, docstring in scope_docstrings.items():
if scope_start < idx and self._JUSTIFICATION_DOCSTRING.search(docstring):
# Check that *idx* is inside this scope (no newer scope in
# between).
next_scope = min(
(s for s in scope_docstrings if s > scope_start),
default=len(lines),
)
if idx < next_scope:
return True

return False

@staticmethod
def _build_scope_docstring_map(lines: list[str]) -> dict[int, str]:
"""Map ``def``/``class`` line indices to their docstrings (if any)."""
scope_boundary = re.compile(r"^\s*(def |class )")
result: dict[int, str] = {}
for idx, line in enumerate(lines):
if not scope_boundary.search(line):
continue
# Look for a docstring on the next non-blank line.
doc_start = idx + 1
while doc_start < len(lines) and not lines[doc_start].strip():
doc_start += 1
if doc_start >= len(lines):
continue
first = lines[doc_start].strip()
if not (first.startswith('"""') or first.startswith("'''")):
continue
quote = first[:3]
if first.count(quote) >= 2:
# Single-line docstring.
result[idx] = first
else:
# Multi-line docstring — collect until closing quotes.
parts = [first]
for j in range(doc_start + 1, len(lines)):
parts.append(lines[j])
if quote in lines[j]:
break
result[idx] = "\n".join(parts)
return result


class QualityChecker:
"""Main quality checker that runs all checks."""

Expand All @@ -565,6 +695,7 @@ def __init__(self):
DocstringChecker(),
ImportChecker(),
CommentChecker(),
GetAttrChecker(),
]
self.gitignore_spec = self._load_gitignore()

Expand Down Expand Up @@ -781,6 +912,8 @@ def main():
category = "Unused imports"
elif "Commented-out code" in v.message:
category = "Commented-out code"
elif "getattr should only" in v.message:
category = "Unjustified getattr"
else:
category = "Other issues"

Expand Down
52 changes: 26 additions & 26 deletions docs/root/architecture/clean_architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ Clean Architecture organizes code into layers with clear dependency rules:
The domain layer contains the core business logic and has no external dependencies.

#### Location
- `src/domain/`
- `src/orb/domain/`

#### Components

**Entities (Aggregates)**
```python
# src/domain/template/aggregate.py
# src/orb/domain/template/template_aggregate.py
class Template(BaseModel):
"""Template configuration representing VM template."""
template_id: str
Expand All @@ -38,7 +38,7 @@ class Template(BaseModel):

**Value Objects**
```python
# src/domain/machine/machine_status.py
# src/orb/domain/machine/value_objects.py
class MachineStatus(Enum):
"""Machine status value object."""
PENDING = "pending"
Expand All @@ -48,7 +48,7 @@ class MachineStatus(Enum):

**Domain Services**
```python
# src/domain/template/ami_resolver.py
# src/orb/providers/aws/domain/services/ami_resolver.py
class AMIResolver:
"""Domain service for AMI resolution logic."""

Expand All @@ -58,7 +58,7 @@ class AMIResolver:

**Repository Interfaces**
```python
# src/domain/template/repository.py
# src/orb/domain/template/repository.py
class TemplateRepository(ABC):
"""Abstract repository interface."""

Expand All @@ -78,27 +78,27 @@ class TemplateRepository(ABC):
The application layer orchestrates domain objects and implements use cases.

#### Location
- `src/application/`
- `src/orb/application/`

#### Components

**Application Services**
```python
# src/application/service.py
# src/orb/application/services/provisioning_orchestration_service.py
@injectable
class ApplicationService:
"""Main application orchestrator."""

def __init__(self,
command_bus: CommandBus,
query_bus: QueryBus,
provider_context: ProviderContext):
provider_selection_port: ProviderSelectionPort):
# Dependencies injected, not created
```

**Command Handlers (CQRS)**
```python
# src/application/commands/template_handlers.py
# src/orb/application/commands/template_handlers.py
class GetTemplatesHandler:
"""Handle template retrieval commands."""

Expand All @@ -108,7 +108,7 @@ class GetTemplatesHandler:

**Query Handlers (CQRS)**
```python
# src/application/queries/handlers.py
# src/orb/application/queries/template_query_handlers.py
class TemplateQueryHandler:
"""Handle template queries."""

Expand All @@ -118,7 +118,7 @@ class TemplateQueryHandler:

**Data Transfer Objects**
```python
# src/application/dto/commands.py
# src/orb/application/dto/commands.py
class CreateRequestCommand:
"""Command for creating requests."""
template_id: str
Expand All @@ -136,14 +136,14 @@ class CreateRequestCommand:
The infrastructure layer implements external concerns and technical details.

#### Location
- `src/infrastructure/`
- `src/providers/`
- `src/orb/infrastructure/`
- `src/orb/providers/`

#### Components

**Repository Implementations**
```python
# src/infrastructure/storage/repositories/template_repository.py
# src/orb/infrastructure/storage/repositories/template_repository.py
class TemplateRepositoryImpl(TemplateRepository):
"""Template repository implementation."""

Expand All @@ -153,18 +153,18 @@ class TemplateRepositoryImpl(TemplateRepository):

**External Service Adapters**
```python
# src/providers/aws/managers/aws_instance_manager.py
# src/orb/providers/aws/infrastructure/aws_client.py
@injectable
class AWSInstanceManager:
"""AWS-specific instance management."""
class AWSClient:
"""Provider-specific resource management."""

def __init__(self, aws_client: AWSClient, logger: LoggingPort):
def __init__(self, config: ConfigurationPort, logger: LoggingPort):
# Infrastructure dependencies
```

**Dependency Injection Container**
```python
# src/infrastructure/di/container.py
# src/orb/infrastructure/di/container.py
class DIContainer:
"""Dependency injection container."""

Expand All @@ -174,7 +174,7 @@ class DIContainer:

**Configuration Management**
```python
# src/infrastructure/config/manager.py
# src/orb/config/managers/configuration_manager.py
class ConfigurationManager:
"""Configuration management implementation."""
```
Expand All @@ -190,15 +190,15 @@ class ConfigurationManager:
The interface layer provides external access points to the system.

#### Location
- `src/interface/`
- `src/api/`
- `src/cli/`
- `src/orb/interface/`
- `src/orb/api/`
- `src/orb/cli/`

#### Components

**CLI Interface**
```python
# src/cli/main.py
# src/orb/cli/main.py
def main():
"""CLI entry point."""
# Parse arguments
Expand All @@ -208,7 +208,7 @@ def main():

**REST API Interface**
```python
# src/api/routers/templates.py
# src/orb/api/routers/templates.py
@router.get("/templates")
async def get_templates():
"""REST API endpoint."""
Expand All @@ -219,7 +219,7 @@ async def get_templates():

**Interface Command Handlers**
```python
# src/interface/template_command_handlers.py
# src/orb/interface/template_command_handlers.py
class TemplateCommandHandler:
"""Handle CLI template commands."""

Expand Down
Loading