Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
27 changes: 3 additions & 24 deletions .github/actions/prune-repository/prune.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,39 +44,18 @@
REQUESTED_DEPENDENCIES: dict[str, list[str]] = {
# The frontend's wire-conformance suite decodes the atlas crate's checked-in fixtures
"@apps/hash-frontend": ["@rust/hash-graph-atlas"],
# Brunch core's architecture and contract tests inspect the app and shipped
# plugins, but a job whose requested scope is only a sibling or a consumer
# of core must not pull those fixtures.
"@hashintel/brunch-agent": [
"@apps/brunch-agent",
"@hashintel/brunch-agent-plugin-gherkin",
"@hashintel/brunch-agent-plugin-sdcpn",
],
}

# Non-workspace paths required by packages in the *requested* scope.
# `turbo prune` copies workspace directories and root manifests only.
REQUESTED_PATHS: dict[str, list[str]] = {
# Core's shipped-definition and baseline tests read the non-workspace
# context root alongside their plugin task dependencies.
"@hashintel/brunch-agent": [
".config/oxlint/brunch",
"libs/@hashintel/brunch-agent/AGENTS.md",
"libs/@hashintel/brunch-agent/CONTEXT.md",
"libs/@hashintel/brunch-agent/docs",
"libs/@hashintel/brunch-agent/evaluations",
"libs/@hashintel/brunch-agent/scripts",
],
# The app's tests execute evaluation runners and govern the complete Brunch
# composition. Its context root is not a workspace, so copy the docs,
# scripts, and agent contract files explicitly.
"@hashintel/brunch-agent": [".config/oxlint/brunch"],
# The app's product tests execute evaluation runners and inspect committed
# evidence. Those non-workspace inputs are copied explicitly.
"@apps/brunch-agent": [
".config/oxlint/brunch",
"libs/@hashintel/brunch-agent/AGENTS.md",
"libs/@hashintel/brunch-agent/CONTEXT.md",
"libs/@hashintel/brunch-agent/docs",
"libs/@hashintel/brunch-agent/evaluations",
"libs/@hashintel/brunch-agent/scripts",
"libs/@hashintel/petrinaut/docs",
],
}
Expand Down
46 changes: 4 additions & 42 deletions .github/actions/prune-repository/prune_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
CORE = "@hashintel/brunch-agent"
TRANSPORT = "@hashintel/brunch-agent-transport-aisdk"
APP = "@apps/brunch-agent"
PLUGIN_GHERKIN = "@hashintel/brunch-agent-plugin-gherkin"
PLUGIN_SDCPN = "@hashintel/brunch-agent-plugin-sdcpn"
WEBSITE = "@apps/petrinaut-website"
FRONTEND = "@apps/hash-frontend"
PLAYWRIGHT = "@tests/hash-playwright"
Expand Down Expand Up @@ -45,58 +43,22 @@ def test_frontend_transitive(self) -> None:


class BrunchRequestedExtras(unittest.TestCase):
def test_core_adds_the_app_and_plugins(self) -> None:
expected_workspaces = frozenset({APP, PLUGIN_GHERKIN, PLUGIN_SDCPN})
self.assertEqual(extras_for_requested({CORE}), expected_workspaces)
self.assertTrue(
expected_workspaces.issubset(
fixpoint_expand(
{CORE} | extras_for_requested({CORE}),
{
CORE: frozenset(),
APP: frozenset({CORE}),
PLUGIN_GHERKIN: frozenset({CORE}),
PLUGIN_SDCPN: frozenset({CORE}),
},
)
)
)

def test_app_task_adds_the_core_plugins_and_context_paths(self) -> None:
expected_workspaces = frozenset({CORE, PLUGIN_GHERKIN, PLUGIN_SDCPN})
expanded = fixpoint_expand(
{APP},
{
APP: expected_workspaces,
PLUGIN_GHERKIN: frozenset({CORE}),
PLUGIN_SDCPN: frozenset({CORE}),
},
)
self.assertTrue(expected_workspaces.issubset(expanded))
def test_app_keeps_only_its_non_workspace_product_inputs(self) -> None:
self.assertEqual(
extra_paths_for_requested({APP}),
[
".config/oxlint/brunch",
"libs/@hashintel/brunch-agent/AGENTS.md",
"libs/@hashintel/brunch-agent/CONTEXT.md",
"libs/@hashintel/brunch-agent/docs",
"libs/@hashintel/brunch-agent/evaluations",
"libs/@hashintel/brunch-agent/scripts",
"libs/@hashintel/petrinaut/docs",
],
)

def test_core_adds_its_non_workspace_test_fixtures(self) -> None:
def test_core_adds_only_its_shared_lint_config(self) -> None:
self.assertEqual(extras_for_requested({CORE}), frozenset())
self.assertEqual(
extra_paths_for_requested({CORE}),
[
".config/oxlint/brunch",
"libs/@hashintel/brunch-agent/AGENTS.md",
"libs/@hashintel/brunch-agent/CONTEXT.md",
"libs/@hashintel/brunch-agent/docs",
"libs/@hashintel/brunch-agent/evaluations",
"libs/@hashintel/brunch-agent/scripts",
],
[".config/oxlint/brunch"],
)

def test_sibling_or_website_job_does_not_add_context_paths(self) -> None:
Expand Down
2 changes: 0 additions & 2 deletions apps/brunch-agent/docs/task-dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@
"test:unit": [
"@hashintel/brunch-agent#build",
"@hashintel/brunch-agent-binding-flue#build",
"@hashintel/brunch-agent-plugin-dafny#build",
"@hashintel/brunch-agent-plugin-gherkin#build",
"@hashintel/brunch-agent-plugin-sdcpn#build",
"@hashintel/brunch-agent-transport-aisdk#build",
"@hashintel/petrinaut-core#build",
Expand Down
Loading
Loading