text stringlengths 185 73.3k | repo stringlengths 7 100 | path stringlengths 4 146 | language stringclasses 7
values | hash stringlengths 16 16 | score float64 7 8.5 | stars int64 0 237k |
|---|---|---|---|---|---|---|
"""GitHub work-item provider, CLI transport (`gh`) — design.md piece 4.
Auth is wholly `gh auth login`'s concern; the harness never sees a token.
Emulation hides inside the adapter: GitHub issues have only open/closed, so
the status projection collapses (STATUS_DEFAULTS) and richer states are
emulated as labels-free c... | MostAshraf/ai-sdlc-harness | harness/providers/github_cli.py | .py | 1d081701084c4eea | 7.62 | 16 |
"""GitLab work-item provider, CLI transport (`glab`). Auth = `glab auth
login`. Issue ids are project-scoped iids — the adapter takes the iid, as
`glab` does."""
from __future__ import annotations
import json
from . import ProviderError
from ._normalize import acceptance_criteria, run_cli, section, type_from_labels
... | MostAshraf/ai-sdlc-harness | harness/providers/gitlab_cli.py | .py | e2f1cd3f4f3d51e8 | 7.62 | 16 |
"""local-markdown work-item provider — the no-auth adapter (design.md piece 4).
Work items are markdown files in the configured `provider.stories_dir`:
# WORK-7: Fix null crash in parser
Type: Bug
Status: Open
## Description
...
## Acceptance Criteria
- [ ] parser returns None on empty i... | MostAshraf/ai-sdlc-harness | harness/providers/local_markdown.py | .py | 27d0e856747352db | 7.62 | 16 |
"""Cross-platform test support (first Windows triage, 2026-07).
Three portability seams the suite shares, so each test file doesn't grow its
own platform branches:
rmtree tearDown-safe delete: git marks object files read-only,
and on Windows `shutil.rmtree` dies on them with
... | MostAshraf/ai-sdlc-harness | tests/support.py | .py | 0431c7489253e388 | 8.12 | 16 |
"""fasttest.py done-criteria: the sharded runner runs EXACTLY the suite the
serial discover runs — same classes (a test-less base must vanish, an
import failure must abort loud), same leaf count (the parity guard, proven
in-process against the same loader the workers use), aggregate semantics
(a count mismatch is a fai... | MostAshraf/ai-sdlc-harness | tests/test_fasttest.py | .py | 268fd9803034239d | 8.12 | 16 |
"""M8 WS-4 (optional, m8-plan-fidelity.md): structural Mermaid validator,
ported from the original ai-sdlc-harness's validate-mermaid script. R5/R6
are deliberately not ported (see harness/mermaid.py's module docstring)."""
from __future__ import annotations
import json
import shutil
import subprocess
import sys
impor... | MostAshraf/ai-sdlc-harness | tests/test_mermaid.py | .py | 15fe0e207cda3b9e | 8.12 | 16 |
"""M1 done-criteria: torn-tail NDJSON reads; chain detects out-of-band edits."""
from __future__ import annotations
import json
import shutil
import tempfile
import unittest
from pathlib import Path
from harness import chain, ndjson
from tests import support
class NdjsonLedger(unittest.TestCase):
def setUp(self... | MostAshraf/ai-sdlc-harness | tests/test_ndjson_chain.py | .py | 42a59b81e0ba17a1 | 8.12 | 16 |
"""Regression: the planner's content contract must not drift between the
orchestrator's required-content checklist (steps/plan.md) and the planner's
own instruction file (steps/plan-task.md) — F0/F1/F2 in m8-plan-fidelity.md
were caused by exactly this kind of silent divergence (a stale placeholder
in agents/planner.md... | MostAshraf/ai-sdlc-harness | tests/test_plan_contract.py | .py | 5fc6aada1e0d664f | 8.12 | 16 |
"""init-workspace's SKILL.md venv-bootstrap instruction (step 0) must stay
parseable by BOTH shells a platform may pick when a model runs it through
its shell tool: Claude Code's Bash tool always fires bash (Git Bash on
Windows), but Qwen Code's `run_shell_command` tool shares hooks'
getShellConfiguration() — on Window... | MostAshraf/ai-sdlc-harness | tests/test_venv_bootstrap.py | .py | 7393baa02eb1b502 | 8.12 | 16 |
"""Height-based colormap for point cloud visualization."""
import numpy as np
GRAY_OUT_COLOR = np.array([0.65, 0.65, 0.65])
def _srgb_encode(linear):
return np.where(linear <= 0.0031308, linear * 12.92, 1.055 * np.abs(linear) ** (1 / 2.4) - 0.055)
def _srgb_decode(encoded):
return np.where(encoded <= 0.040... | atinfinity/pointcloud-map-gui | src/pointcloud_map_gui/colorize.py | .py | 52b914cd7e7a812d | 7.42 | 6 |
"""Pick a bounded subset of points to draw, so the 3D view stays responsive
on clouds far larger than the screen can resolve.
This only ever affects what is drawn. The occupancy grid and the exported map
are always computed from the full cloud, so thinning the view costs nothing in
map fidelity.
Selection returns *in... | atinfinity/pointcloud-map-gui | src/pointcloud_map_gui/display_lod.py | .py | 3b066295fa7172d9 | 7.42 | 6 |
"""Ground-plane reference grid geometry (pure math, no Open3D GUI dependency)."""
import numpy as np
MARGIN_CELLS = 5
def nice_step(rough_step):
"""Round rough_step up to a "nice" 1/2/5 * 10^n grid unit."""
if rough_step <= 0:
return 1.0
magnitude = 10.0 ** np.floor(np.log10(rough_step))
resi... | atinfinity/pointcloud-map-gui | src/pointcloud_map_gui/ground_grid.py | .py | adff8db8c04f6a94 | 7.42 | 6 |
"""Write ROS2 map_server / nav2 compatible PGM + YAML files."""
import os
import yaml
def write_pgm(path, grid):
"""Write a uint8 2D numpy array as a binary (P5) PGM file."""
height, width = grid.shape
header = f"P5\n{width} {height}\n255\n".encode("ascii")
with open(path, "wb") as f:
f.write... | atinfinity/pointcloud-map-gui | src/pointcloud_map_gui/map_writer.py | .py | 2c3d322ef2c7e2a0 | 7.42 | 6 |
"""Isolated-noise point detection.
Four interchangeable methods, all sharing the signature
method(points: (N, 3) float array, **params) -> (N,) bool noise mask
where True marks a point to *remove*. Unlike ground removal, noise points are
treated as if they never existed: they are dropped before display, ground
e... | atinfinity/pointcloud-map-gui | src/pointcloud_map_gui/noise_removal.py | .py | 29d916ac543bdf05 | 7.42 | 6 |
"""Point cloud -> ROS2-style occupancy grid conversion.
Pure numpy logic, no Open3D dependency, so it can be unit tested headless.
"""
from dataclasses import dataclass
import numpy as np
from scipy import ndimage
OCCUPIED_VALUE = 0
FREE_VALUE = 254
UNKNOWN_VALUE = 205
@dataclass
class OccupancyGridResult:
gri... | atinfinity/pointcloud-map-gui | src/pointcloud_map_gui/occupancy_grid.py | .py | 66a7c3ebceb67a63 | 7.42 | 6 |
"""Where the repository's data lives.
The sample clouds are 19 MB and belong to the repository, not to the
installed package, so they are found by walking up from this file. That holds
for the editable install `uv sync` produces, which is how this project is
meant to be run; a wheel copied somewhere else has no reposi... | atinfinity/pointcloud-map-gui | src/pointcloud_map_gui/paths.py | .py | cfcce4fa4ff4f9c5 | 7.42 | 6 |
"""Measure how long one height-filter change takes in the 3D view.
uv run python -m pointcloud_map_gui.tools.benchmark_display [input.pcd] \\
[--points 5000000] [--budgets 1000000 2000000 0] [--ticks 10]
With no input file it defaults to `sample_data/sample_large_site.pcd`, the
1,554,944-point cloud the R... | atinfinity/pointcloud-map-gui | src/pointcloud_map_gui/tools/benchmark_display.py | .py | b830a12f82977edd | 7.42 | 6 |
import numpy as np
from pointcloud_map_gui.colorize import GRAY_OUT_COLOR, fade_to_background, height_colormap_colors
def test_colors_vary_with_height():
points = np.array([[0, 0, 0.0], [0, 0, 5.0], [0, 0, 10.0]])
colors = height_colormap_colors(points)
assert not np.allclose(colors[0], colors[1])
... | atinfinity/pointcloud-map-gui | tests/test_colorize.py | .py | 0ea398949eda2fdb | 7.92 | 6 |
import numpy as np
import pytest
from pointcloud_map_gui.tools import generate_sample
SCENE_BUILDERS = [
generate_sample.build_room_point_cloud,
generate_sample.build_slope_point_cloud,
generate_sample.build_noisy_slope_point_cloud,
generate_sample.build_ramp_point_cloud,
]
def _is_float32_exact(poi... | atinfinity/pointcloud-map-gui | tests/test_generate_sample.py | .py | df557a8792fab7bb | 7.92 | 6 |
import numpy as np
from pointcloud_map_gui.app import reindex_ground_mask
TOTAL = 8
def _mask(*indices):
m = np.zeros(TOTAL, dtype=bool)
m[list(indices)] = True
return m
def test_nothing_to_carry():
assert reindex_ground_mask(None, None, _mask(1), TOTAL) is None
def test_noise_switched_on_drop... | atinfinity/pointcloud-map-gui | tests/test_ground_mask_reindex.py | .py | a17fbb71fb87b1bf | 7.92 | 6 |
#!/usr/bin/env python3
"""Idempotent full-history backfill of `metadata.git.commits` (bh-1b0rc.3).
Walks ONE hive's (repo's) full git history, oldest-first, and writes durable bead<->commit
linkage (`docs/design/bead-commit-linkage-contract.md`) for beads that closed before
`bh work submit` / `bh work merge` started r... | beadhive/beadhive | scripts/backfill_commit_linkage.py | .py | 51e6672b6930f4d8 | 7.5 | 9 |
#!/usr/bin/env python3
"""Throwaway profiling harness for (spike).
Attributes wall-time of the ``_section_fleet_health`` per-repo work across the
three cost buckets called out in the bead:
1. ``safety.scan`` git subprocess calls (scan total MINUS the disk walk)
2. ``_measure_disk_usage`` os.walk (workin... | beadhive/beadhive | scripts/profile_fleet_health.py | .py | 1beaed331569bca5 | 7.5 | 9 |
"""`ws plan adopt` — seed a plan FRAME from promoted intake report(s).
The planning-plane ADOPT path (epic, bead). It is the
planner-side consumer of the triage promote disposition: a report handed
to the planner carries ``intake:promoted`` (``state.is_promoted``), and ``adopt`` fleshes it into
the opening FRAME of a ... | beadhive/beadhive | src/beadhive/adopt.py | .py | be02b6df07d0944d | 7.5 | 9 |
"""The `AgentRunSummary` projection contract over `dispatch_log.py` records (bh-6eu2c.1).
`docs/design/agent-run-summary-projection-contract.md` is the full rationale — the mapping
table for all five record types `dispatch_log.py` emits today, the `seat_cancelled` and
`dispatch_pass`/`waiting` decisions, and the join-... | beadhive/beadhive | src/beadhive/agent_run_summary.py | .py | 49a9567160076355 | 7.5 | 9 |
"""The `AgentRunSummary` read path (bh-6eu2c.2) over a per-hive dispatch sink.
`docs/design/agent-run-summary-projection-contract.md` fixes the state-derivation rules; the
typed shape and the two pure single-record mapping helpers (`state_for_seat_harvested`,
`SEAT_CANCELLED_STATE`) live in `agent_run_summary.py` (bh-... | beadhive/beadhive | src/beadhive/agent_run_summary_reader.py | .py | 458e0cd8714d2e63 | 7.5 | 9 |
"""The normalized, agent-facing alert surface.
Alert sources are deliberately small functions returning :class:`Alert` records. The
first source adapts the warnings that ``bh doctor`` already calculates; later sources
can register a rule here without teaching every harness integration about it.
"""
from __future__ i... | beadhive/beadhive | src/beadhive/alerts.py | .py | 7a9ca280268b1702 | 7.5 | 9 |
"""Release-channel drift — has `latest`/`stable` stopped tracking what it promises?
The read half of the channel model in ``docs/design/release-channel-branches-adr.md``. That ADR
makes the two branches asymmetric on purpose (its Decision 2):
* **`latest` cannot rot.** The act that would leave it stale — publishing a... | beadhive/beadhive | src/beadhive/channels.py | .py | 57e004ff6e64d250 | 7.5 | 9 |
"""Command-coupled, append-only measured-fact replication.
``bh checkpoint run`` is deliberately the only mutation surface in this module: a checkpoint
cannot be recorded, and a wisp step cannot be closed, independently of the command whose result
they describe. The persistent record is metadata only. This helper neve... | beadhive/beadhive | src/beadhive/checkpoint.py | .py | f20419da7150a174 | 7.5 | 9 |
"""Provider-neutral complexity tiers and the bundled local classifier.
The public boundary in this module is deliberately smaller than the scoring implementation:
callers depend on :class:`ComplexityTier`, :class:`ComplexityResult`, and the one-method
:class:`ComplexityClassifier` protocol. Keyword lists and score me... | beadhive/beadhive | src/beadhive/complexity.py | .py | 1e4efa7b9c1bd1d0 | 7.5 | 9 |
"""Shared container-compose lifecycle for the local stacks (dolt SQL server, otel-lgtm).
Both stacks drive the same container runtime — backend selected by the shared ``dolt.backend``
config key, same compose binary — and differ only in WHICH compose file + bundled template they
seed and run. This module owns the dupl... | beadhive/beadhive | src/beadhive/compose.py | .py | 8954d0165d4d0556 | 7.5 | 9 |
"""Lazy, explicitly bindable access to the stable config facade."""
from __future__ import annotations
from importlib import import_module
from types import ModuleType
class FacadeBinding:
"""Resolve direct-module calls lazily while allowing facade composition to bind explicitly."""
def __init__(self, modu... | beadhive/beadhive | src/beadhive/config_binding.py | .py | b73c1734b68ba766 | 7.5 | 9 |
"""One-time migration splitting an existing flat config.yaml into fleet.yaml + a reduced
host config.yaml (bh-e0y8.7), per the leaf-level fleet/host partition
:mod:`beadhive.config_partition` defines.
Every install that predates the fleet/host split (bh-e0y8.5) has ONE flat ``config.yaml``
mixing fleet-wide truth (``o... | beadhive/beadhive | src/beadhive/config_split_migration.py | .py | f9d611ac7e8fa09d | 7.5 | 9 |
"""validate_config() — check a loaded config dict against :class:`BeadhiveConfig` and turn
pydantic errors + known ws-era renames into an actionable ``{level, message}`` problem list.
A pure, read-only layer over the schema (bh-5cgm.2): it never writes. It reuses the same
``{level, message}`` problem shape as the conf... | beadhive/beadhive | src/beadhive/config_validate.py | .py | 639ba2cac15c42d6 | 7.5 | 9 |
"""Conflict estimation — the advisory *start-verdict* read: "how likely is this bead to conflict
with the work already queued ahead of it?"
Where `release_order.py` decides the *merge order* of a set of beads, this module answers a
narrower, earlier question consulted by the dispatcher's start-verdict path: given a be... | beadhive/beadhive | src/beadhive/conflict_estimator.py | .py | 74f177afb8b88f04 | 7.5 | 9 |
"""Converge on failures cheaply, then EARN the verdict with one clean confirming run (bh-ku9n9.8).
This module is the epic's central hazard, made safe. Re-running only the failures until they
pass is exactly how a flaky suite gets laundered into green: a test that fails one run in three
will, under a naive converge lo... | beadhive/beadhive | src/beadhive/converge.py | .py | 7301f9154820f109 | 7.5 | 9 |
"""Probe the CREDENTIALS bh's dependencies need, and name the exact command that fixes each gap.
``bh dep install`` places a binary; nothing authenticates it, and INSTALL.md says so in as many
words. On a laptop that is a shrug — you log in once in a browser. On a headless Linux node it is
the step where an unattended... | beadhive/beadhive | src/beadhive/credentials.py | .py | 8b9b5c3af90f64b9 | 7.5 | 9 |
"""`bh dep` — the one user-facing surface over `deps.DEPS` (bh-hsus.6).
bh dep list [--kind harness|infra] [--missing]
bh dep show <name>
bh dep install <name>
bh dep auth [<name>] [--check]
WHY THE NAME IS AN ARGUMENT, NOT A NAMESPACE. `bh plugin <name>` is a MOUNT POINT for a tool's
own sub-app, and... | beadhive/beadhive | src/beadhive/dep_cli.py | .py | 81d772781bf6fa7e | 7.5 | 9 |
"""The aggregate per-hive dispatch log sink (bh-e7r9q.5), and the concurrent-writer contract
that keeps it parseable.
OPERATOR DECISION 2026-08-10 — HIVE-SCOPED, AGGREGATE LOGS. One JSONL sink per hive receives
the structured event stream (`seat_spawned` / `seat_harvested` / `seat_cancelled` /
`dispatch_cause_recorded... | beadhive/beadhive | src/beadhive/dispatch_log.py | .py | ae130aab9594440a | 7.5 | 9 |
"""Shared runtime helpers for ZBrush skill scripts."""
from __future__ import annotations
import ntpath
from contextlib import contextmanager
from typing import Any, Callable, Dict, Iterator, TypeVar
_T = TypeVar("_T")
@contextmanager
def quiet_ui_actions(zbc: Any) -> Iterator[None]:
"""Suppress scripted UI ac... | dcc-mcp/dcc-mcp-zbrush | src/dcc_mcp_zbrush/_skill_host.py | .py | 4b3f998e16b48014 | 7.42 | 6 |
"""High-level ZBrush skill authoring helpers."""
from __future__ import annotations
import functools
import logging
from typing import Any, Callable, List, Optional, TypeVar
from dcc_mcp_zbrush.bridge import ZBrushBridgeError
logger = logging.getLogger(__name__)
_F = TypeVar("_F", bound=Callable[..., Any])
_bridg... | dcc-mcp/dcc-mcp-zbrush | src/dcc_mcp_zbrush/api.py | .py | 90b9b9e7e04768b7 | 7.42 | 6 |
"""SocketBridge — TCP JSON bridge to a ZBrush in-process plugin.
Use sidecar mode when the MCP server runs outside ZBrush and forwards tool
calls to ``bridge/plugin/mcp_socket_bridge.py`` running inside ZBrush.
"""
from __future__ import annotations
import json
import logging
import socket
from typing import Any, Di... | dcc-mcp/dcc-mcp-zbrush | src/dcc_mcp_zbrush/bridge.py | .py | 48bfab397f933b47 | 7.42 | 6 |
import { readFileSync } from "node:fs";
import { join } from "node:path";
import { describe, expect, it } from "vitest";
import { NO_OVERRIDE, ROLES, toRoleModels } from "@/components/code/RolesBar";
/**
* The half of "a model per role" that is invisible on screen.
*
* Rendering the pickers is the visible half and... | brcampidelli/chimera-agent | apps/desktop/src/components/code/RolesBar.handoff.test.ts | .ts | 044b8359791daed9 | 7.16 | 20 |
import { readFileSync } from "node:fs";
import { join } from "node:path";
import { describe, expect, it } from "vitest";
/**
* The Code screen's row has three columns and only one of them is allowed to give ground.
*
* A flex child defaults to `min-width: auto` and refuses to shrink below its content. Get the roles... | brcampidelli/chimera-agent | apps/desktop/src/components/code/columns-can-shrink.test.ts | .ts | de818d51b25b8e28 | 7.16 | 20 |
import { describe, expect, it } from "vitest";
import { EditorState } from "@codemirror/state";
import { EditorView } from "@codemirror/view";
import { toCodeMirror } from "@/components/editor/diagnostics";
import type { LspDiagnostic } from "@/lib/types";
/**
* Where a squiggle lands.
*
* The whole point of the s... | brcampidelli/chimera-agent | apps/desktop/src/components/editor/diagnostics.test.ts | .ts | 2d5b6cd11e49cf51 | 7.16 | 20 |
import { describe, expect, it } from "vitest";
import { extensionOf, hasLanguage, languageFor } from "@/components/editor/languages";
/**
* The grammar table is a lookup, so the tests here are about the two decisions inside it: what
* counts as an extension, and what happens when nothing matches.
*/
describe("ext... | brcampidelli/chimera-agent | apps/desktop/src/components/editor/languages.test.ts | .ts | 77ecf4744172cd68 | 7.16 | 20 |
import { readFileSync, readdirSync, statSync } from "node:fs";
import { join } from "node:path";
import { describe, expect, it } from "vitest";
/**
* A `<button>` inside a `<form>` submits it. That is the HTML default, it is silent, and it is
* exactly one attribute away from correct — so it comes back.
*
* It cos... | brcampidelli/chimera-agent | apps/desktop/src/components/form-buttons.test.ts | .ts | 60c45edab39775a2 | 7.16 | 20 |
import { beforeEach, describe, expect, it, vi } from "vitest";
import { ApiError, getOrchestrationFrames } from "@/lib/api";
import { lastRun, rememberRun, resumeFrames } from "./resume";
vi.mock("@/lib/api", async () => {
const real = await vi.importActual<typeof import("@/lib/api")>("@/lib/api");
return { ApiE... | brcampidelli/chimera-agent | apps/desktop/src/components/orchestration/resume.test.ts | .ts | 0dfff1ca53c200d4 | 7.16 | 20 |
/**
* The design system's enforcement gate.
*
* `DESIGN.md` states the rules; this file is what makes them true. Without it a guideline document
* is a wish — this repo already proved that, having carried a coherent design intent in a six-line
* CSS comment while 150-odd arbitrary values accumulated around it.
*
... | brcampidelli/chimera-agent | apps/desktop/src/design/design-system.test.ts | .ts | 38f03590653b5ce2 | 7.16 | 20 |
import { readFileSync } from "node:fs";
import { join } from "node:path";
import { describe, expect, it } from "vitest";
/**
* Every colour used for TEXT clears WCAG AA against the theme it belongs to.
*
* Found by measuring the running app rather than by reading the CSS: on the light theme, `text-ok`
* came out a... | brcampidelli/chimera-agent | apps/desktop/src/design/text-tokens-are-readable.test.ts | .ts | 60a3dae769e36799 | 7.16 | 20 |
/**
* What a screen is told when the server refuses.
*
* Every refusal in this app arrived as its status line — "400 Bad Request" — and the sentence the
* backend wrote was dropped on the floor by the one helper every call goes through. Which made a
* whole class of server-side care pointless: a route that answers... | brcampidelli/chimera-agent | apps/desktop/src/lib/api.refusal.test.ts | .ts | 325517bd341e5d5a | 7.16 | 20 |
/**
* The two requests that carry a file, and the one header they must not carry.
*
* These endpoints were broken in the shipped app and nothing noticed, because the cover was in the
* wrong place: every component test mocks `@/lib/api` wholesale, so `uploadAttachment` was a stub
* and the real `fetch` — the thing... | brcampidelli/chimera-agent | apps/desktop/src/lib/api.upload.test.ts | .ts | f6b46033f25741c1 | 7.16 | 20 |
import { describe, expect, it } from "vitest";
import { decompose } from "@/lib/decompose";
/**
* The asymmetry these tests hold: a missed split costs the user a numbered list, while a false one
* interrupts an ordinary message with a card about git worktrees. So everything ambiguous resolves
* to "one job".
*/
de... | brcampidelli/chimera-agent | apps/desktop/src/lib/decompose.test.ts | .ts | 66e5d9ce24a4cf49 | 7.16 | 20 |
import { readFileSync, readdirSync, statSync } from "node:fs";
import { join } from "node:path";
import { describe, expect, it } from "vitest";
import { DICTS } from "@/lib/i18n";
/**
* Every key in the dictionary has to be reachable from a screen.
*
* A key nobody renders is not free. It is ten translations to ke... | brcampidelli/chimera-agent | apps/desktop/src/lib/i18n.reachable.test.ts | .ts | e36c0ba74e25675d | 7.16 | 20 |
import { describe, expect, it } from "vitest";
import type { OrchFrame } from "@/lib/api";
import { applyFrame, EMPTY_RUN, type OrchestrationState } from "@/lib/orchestration-run";
/**
* A replayed run has to fold into the same state a live one does.
*
* The reducer was tested with live-shaped frames. The endpoint... | brcampidelli/chimera-agent | apps/desktop/src/lib/orchestration-replay.test.ts | .ts | 173686af3ce36beb | 7.16 | 20 |
import { describe, expect, it } from "vitest";
import type { OrchFrame } from "@/lib/api";
import { applyFrame, EMPTY_RUN, isRunning, type OrchestrationState } from "@/lib/orchestration-run";
function frame(seq: number, kind: string, data: Record<string, unknown> = {}, taskId = ""): OrchFrame {
return { seq, kind, ... | brcampidelli/chimera-agent | apps/desktop/src/lib/orchestration-run.test.ts | .ts | ee9f48cc396af711 | 7.16 | 20 |
import { beforeEach, describe, expect, it, vi } from "vitest";
import { SHELL_KEY, setShellAllowed, shellAllowed } from "@/lib/project-shell";
/**
* Which projects the agent may run commands in.
*
* The lever for this was global — one setting covering every folder — so the honest choices were
* "no project may ru... | brcampidelli/chimera-agent | apps/desktop/src/lib/project-shell.test.ts | .ts | ca0cdbe45374af6c | 7.16 | 20 |
import { beforeEach, describe, expect, it } from "vitest";
import {
ALIASES_KEY,
PROJECTS_KEY,
addProject,
basename,
projectLabel,
readAliases,
readProjects,
removeProject,
setAlias,
} from "@/lib/projects";
/**
* The sidebar has always grouped by project, but a project could only appear there by ha... | brcampidelli/chimera-agent | apps/desktop/src/lib/projects.test.ts | .ts | 1014657ca0d382f0 | 7.16 | 20 |
import { act, renderHook } from "@testing-library/react";
import { afterEach, describe, expect, it } from "vitest";
import { DEFAULT_VIEW, formatHash, parseHash, useRoute } from "@/lib/router";
/**
* The router is two pure functions and a hook over `hashchange`.
*
* The pure half carries the judgement — what count... | brcampidelli/chimera-agent | apps/desktop/src/lib/router.test.ts | .ts | b0de209c45760555 | 7.16 | 20 |
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import {
LOCAL,
active,
apiUrl,
handshake,
isLoopback,
normaliseBase,
rejectReason,
sameMinor,
saveServers,
setActive,
token,
} from "@/lib/server";
/**
* The two things this file has to get right are opposites.
*
* The... | brcampidelli/chimera-agent | apps/desktop/src/lib/server.test.ts | .ts | c407af2efddd339e | 7.16 | 20 |
import { afterEach, describe, expect, it, vi } from "vitest";
// The page shell, read through Vite rather than node:fs — Vitest shares the app's transform
// pipeline, so `?raw` works here and costs no @types/node.
import indexHtml from "../../index.html?raw";
import {
applyMotion,
applyTheme,
MOTION_KEY,
rea... | brcampidelli/chimera-agent | apps/desktop/src/lib/theme.test.ts | .ts | ca0f9719a76454f8 | 7.16 | 20 |
import { describe, expect, it } from "vitest";
import { exchangeToMarkdown, reconcile, toMarkdown, transcriptFilename } from "@/lib/transcript";
/**
* A record of what an agent did to a repository could not leave the window it happened in.
*
* Until this, the only clipboard call in the whole app copied a `pip insta... | brcampidelli/chimera-agent | apps/desktop/src/lib/transcript.test.ts | .ts | 749819da91e37cbe | 7.16 | 20 |
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
"""Public northbound API for the KV Cache Runner."""
import contextlib
from collections.abc import Callable, Collection, Iterable, Mapping
from dataclasses import dataclass, replace
... | ai-dynamo/kvcr | src/kvcr/api.py | .py | f50a8a6098fe1567 | 7.52 | 10 |
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
"""Control and framing channels used by KVCR."""
import logging
import os
import socket
import struct
from typing import TypeVar
import msgspec
import zmq
logger = logging.getLogge... | ai-dynamo/kvcr | src/kvcr/control_channels.py | .py | d468fece51feb0d7 | 7.52 | 10 |
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
"""Server-owned shared-memory pools for KVCR local DRAM."""
import contextlib
import ctypes
import errno
import fcntl
import mmap
import os
import stat
import uuid
from collections.a... | ai-dynamo/kvcr | src/kvcr/memory.py | .py | 4d71ec257bd4dd1c | 7.52 | 10 |
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
"""Runtime and policy value types for KVCR."""
from collections.abc import Mapping
from dataclasses import dataclass
from enum import Enum
from typing import Annotated, NewType
impo... | ai-dynamo/kvcr | src/kvcr/types.py | .py | 9a0e59ad9f6c3be0 | 7.52 | 10 |
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
import logging
import pytest
from _kvcr_test_utils import _OPEN_KVCRS
@pytest.fixture(autouse=True)
def _close_open_kvcrs():
yield
while _OPEN_KVCRS:
_OPEN_KVCRS.p... | ai-dynamo/kvcr | tests/unit/conftest.py | .py | 95f510f6f14945d6 | 7.02 | 10 |
#!/usr/bin/env python3
"""
WorldSim AI — Demo Runner
Runs all 4 demo scenarios and prints results.
"""
import time
import sys
import os
# Add project root to path
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from worldsim.scenarios.engine import ScenarioEngine
from worldsim.scenarios.definitions im... | rudra496/worldsim-ai | run_demo.py | .py | 18fd0138989df78c | 7.48 | 8 |
"""Agent behavior models — rule-based and probabilistic decision making."""
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import Any, Dict, List, Optional
import numpy as np
class BehaviorModel(ABC):
"""Base class for agent behavior models."""
def __init__(self, params... | rudra496/worldsim-ai | worldsim/agents/behaviors.py | .py | 3f9e33aef052d1bd | 7.48 | 8 |
"""Feedback loop system — connects simulation output back to AI/optimization."""
from __future__ import annotations
import logging
from typing import Any, Callable, Dict, List, Optional
import numpy as np
logger = logging.getLogger(__name__)
class FeedbackLoop:
"""
Adaptive feedback loop: simulation resul... | rudra496/worldsim-ai | worldsim/ai/feedback.py | .py | 054133d69b22d671 | 7.48 | 8 |
"""Prediction models and anomaly detection."""
from __future__ import annotations
from typing import Any, Dict, List, Optional
import numpy as np
class SimplePredictor:
"""
Statistical predictor using moving average and linear regression.
Lightweight — no PyTorch dependency needed.
"""
def __... | rudra496/worldsim-ai | worldsim/ai/predictor.py | .py | 8b39dd1d2767f2cc | 7.48 | 8 |
"""Event system — pub/sub pattern for simulation events."""
from __future__ import annotations
import enum
from collections import defaultdict
from dataclasses import dataclass, field
from typing import Any, Callable, Dict, List, Optional
class EventType(enum.Enum):
"""Types of simulation events."""
TICK =... | rudra496/worldsim-ai | worldsim/core/events.py | .py | 37999da732e76df4 | 7.48 | 8 |
"""
State management for simulation reproducibility.
Supports:
- State snapshots for checkpointing
- State diffs for change tracking
- History logging for analysis
"""
from __future__ import annotations
import copy
import time
from dataclasses import dataclass, field
from typing import Any, Dict, List, Optional
@d... | rudra496/worldsim-ai | worldsim/core/state.py | .py | 446c7744775999fd | 7.48 | 8 |
"""Synthetic data generation and validation for simulations."""
from __future__ import annotations
import json
from pathlib import Path
from typing import Any, Dict, List, Optional
import numpy as np
class DataValidator:
"""Validates simulation data against expected schemas."""
@staticmethod
def valid... | rudra496/worldsim-ai | worldsim/data/generator.py | .py | 5377170214a96e63 | 7.48 | 8 |
"""Distributed simulation engine — extends base engine for multi-node."""
from __future__ import annotations
import enum
import logging
import threading
import time
from typing import Any, Dict, List, Optional
from worldsim.distributed.node import NodeStatus, SimulationNode
from worldsim.distributed.partitioning imp... | rudra496/worldsim-ai | worldsim/distributed/engine.py | .py | 7974231e045f00a5 | 7.48 | 8 |
"""World representations — grid-based and graph-based environments."""
from __future__ import annotations
import enum
from dataclasses import dataclass, field
from typing import Any, Dict, List, Optional, Tuple
import numpy as np
class ZoneType(enum.Enum):
RESIDENTIAL = "residential"
INDUSTRIAL = "industri... | rudra496/worldsim-ai | worldsim/environment/world.py | .py | 5606a0fb304f125d | 7.48 | 8 |
"""Unit tests for WriteOutputsUseCase — rollback logic."""
import pytest
from datetime import datetime, timezone
from threat_intel.domain.entities import (
CollectionResult,
IPAddress,
SourceResult,
ThreatCategory,
ThreatIndicator,
)
from threat_intel.domain.ports import OutputWriter
from threat_i... | ziyadnz/threat-intel-ip-feeds | tests/unit/application/test_write_outputs.py | .py | 814c6ff8bc9aaa13 | 7.15 | 19 |
"""Unit tests for domain entities and value objects.
All tests follow the AAA (Arrange-Act-Assert) pattern.
Domain tests have ZERO infrastructure dependencies — no HTTP, no files.
"""
import pytest
from datetime import datetime, timezone
from threat_intel.domain.entities import (
ConfidenceScore,
CollectionR... | ziyadnz/threat-intel-ip-feeds | tests/unit/domain/test_entities.py | .py | 896616e897449857 | 7.15 | 19 |
"""Unit tests for domain services — pure logic, no I/O."""
import pytest
from threat_intel.domain.entities import (
IPAddress,
ThreatCategory,
WhitelistEntry,
)
from threat_intel.domain.services import (
IPValidator,
IndicatorBuilder,
OverlapAnalyzer,
WhitelistFilter,
resolve_category,... | ziyadnz/threat-intel-ip-feeds | tests/unit/domain/test_services.py | .py | 3dbb1ab2264a1d80 | 7.15 | 19 |
"""Use case: Collect threat intelligence from all configured sources.
Orchestrates parallel source fetching via ThreadPoolExecutor, whitelist
filtering, dedup analysis, and health tracking.
"""
from __future__ import annotations
import logging
from collections import defaultdict
from concurrent.futures import Thread... | ziyadnz/threat-intel-ip-feeds | threat_intel/application/use_cases/collect_threat_intel.py | .py | 7a874a3bdbc2c14e | 7.65 | 19 |
"""Use case: Write collection results to all configured output formats.
Implements rollback protection — refuses to write if success ratio is too low.
"""
from __future__ import annotations
import logging
from typing import List
from threat_intel.domain.entities import CollectionResult
from threat_intel.domain.port... | ziyadnz/threat-intel-ip-feeds | threat_intel/application/use_cases/write_outputs.py | .py | d2fd190c9e9dd459 | 7.65 | 19 |
"""Source-level IP cache — persists last successful fetch per source.
Stores each source's IPs as a JSON file under a cache directory.
Used by the collection use case to serve stale data when a source is unreachable.
"""
from __future__ import annotations
import json
import logging
import os
import re
from datetime ... | ziyadnz/threat-intel-ip-feeds | threat_intel/infrastructure/cache/source_cache.py | .py | 9699e1aa350a9faa | 7.65 | 19 |
"""Health report writer — saves markdown report to disk."""
from __future__ import annotations
import logging
import os
from threat_intel.domain.ports import ReportWriter
logger = logging.getLogger(__name__)
class MarkdownReportWriter(ReportWriter):
"""Writes health report as a markdown file."""
def writ... | ziyadnz/threat-intel-ip-feeds | threat_intel/infrastructure/health/markdown_report_writer.py | .py | 83f9e8a2ea495277 | 7.65 | 19 |
"""Base class for text-based threat sources.
Most sources follow the same pattern: async HTTP GET a text file, extract IPs.
This base class encodes that pattern; subclasses override parsing.
"""
from __future__ import annotations
import re
from typing import Set
from threat_intel.domain.entities import IPAddress
fr... | ziyadnz/threat-intel-ip-feeds | threat_intel/infrastructure/sources/base.py | .py | fe9490cd63055562 | 7.65 | 19 |
# analysis/offline_processor.py
"""
Offline Batch Processor for Gray System
Analyzes raw IQ captures in air-gapped environment
Zero network connectivity required
"""
import numpy as np
import sqlite3
import logging
from pathlib import Path
from datetime import datetime, timezone
from dataclasses import dataclass
from ... | Daniele-Cangi/Satellite-RF-Observatory | analysis/offline_processor.py | .py | 4d66162b52344178 | 7.45 | 7 |
# api/routes/intelligence.py
from fastapi import APIRouter, Depends, HTTPException, status
from sqlalchemy.orm import Session
from typing import List
from core.database import get_db, VulnerabilityAssessment, Satellite
from api.schemas import VulnerabilityReport
router = APIRouter(prefix="/intelligence", tags=["Inte... | Daniele-Cangi/Satellite-RF-Observatory | api/routes/intelligence.py | .py | b0d47adfea866da6 | 7.45 | 7 |
# api/schemas.py
"""
Data Transfer Objects (DTOs) with optimized serialization.
"""
from pydantic import BaseModel, Field, ConfigDict
from typing import List, Optional, Dict, Any
from datetime import datetime
class SatelliteDTO(BaseModel):
id: int
norad_id: int
name: str
country: Optional[str]
type... | Daniele-Cangi/Satellite-RF-Observatory | api/schemas.py | .py | c81614cea49480c3 | 7.45 | 7 |
# api/websockets.py
import logging
from typing import List, Dict
from fastapi import WebSocket, WebSocketDisconnect
import orjson
import asyncio
import numpy as np
logger = logging.getLogger(__name__)
class ConnectionManager:
"""
Manages WebSocket connections with Topic Subscription support.
Uses ORJSON f... | Daniele-Cangi/Satellite-RF-Observatory | api/websockets.py | .py | 4d8ecb944f18d5a0 | 7.45 | 7 |
# collectors/passive_collector.py
"""
Passive RF Collector - Sistema Grigio
Zero network footprint, direct-to-disk IQ recording
"""
import numpy as np
import time
import logging
from pathlib import Path
from datetime import datetime, timezone
from dataclasses import dataclass
from typing import Optional
import struct
... | Daniele-Cangi/Satellite-RF-Observatory | collectors/passive_collector.py | .py | e930a135db8c6452 | 7.45 | 7 |
# core/config.py
"""
Centralized configuration management.
Supports environment variables, YAML files, and runtime overrides.
"""
import os
import yaml
from pathlib import Path
from typing import Any, Dict, Optional
from pydantic import Field, validator
from pydantic_settings import BaseSettings
from functools import ... | Daniele-Cangi/Satellite-RF-Observatory | core/config.py | .py | 50c695bbc3b1788d | 7.45 | 7 |
"""Slug derivation helpers shared by naming, config composition, and delegation.
Extracted from ``registration/_naming.py`` so ``config/merge.py`` can compute a
``ResolvedAgent``'s identity slug without importing the ``registration``
package (which imports ``config`` and would otherwise create a cycle).
"""
from __fu... | Azure/azure-functions-agents-runtime | src/azure_functions_agents/_slug.py | .py | b04f6f1f0a3f30f4 | 7.5 | 9 |
"""Azure Functions agent runtime app factory."""
from __future__ import annotations
import json
from pathlib import Path
from typing import Any
import azure.durable_functions as df
import azure.functions as func
from ._logger import logger
from ._observability import configure_observability
from ._source_marker imp... | Azure/azure-functions-agents-runtime | src/azure_functions_agents/app.py | .py | 14821fe124e36c9d | 7.5 | 9 |
"""Environment variable substitution helpers for config parsing."""
from __future__ import annotations
import os
import re
from typing import Any
_VAR_NAME_FRAGMENT = r"[A-Za-z_][A-Za-z0-9_]*"
_ESCAPED_DOLLAR_PATTERN = re.compile(rf"\$\$({_VAR_NAME_FRAGMENT})")
_ESCAPED_PERCENT_PATTERN = re.compile(rf"%%({_VAR_NAME... | Azure/azure-functions-agents-runtime | src/azure_functions_agents/config/env.py | .py | 5fb5f3d4883d2d5e | 7.5 | 9 |
"""Load global and agent configuration files into typed schema models."""
from __future__ import annotations
from pathlib import Path
from typing import Any, cast
import frontmatter
import yaml # type: ignore[import-untyped]
from pydantic import ValidationError
from azure_functions_agents._logger import logger
fro... | Azure/azure-functions-agents-runtime | src/azure_functions_agents/config/loader.py | .py | 259ed5b2ccf61b0c | 7.5 | 9 |
"""Application root and config directory resolution helpers."""
from __future__ import annotations
import os
from pathlib import Path
from azure_functions_agents._logger import logger
from azure_functions_agents.config.env import runtime_env_value
_app_root: Path | None = None
def set_app_root(path: Path) -> None... | Azure/azure-functions-agents-runtime | src/azure_functions_agents/config/paths.py | .py | 39e1534b36111dd9 | 7.5 | 9 |
"""Pydantic schemas for global, agent, and resolved runtime configuration."""
from __future__ import annotations
from typing import Annotated, Any, Literal
from pydantic import (
BaseModel,
BeforeValidator,
ConfigDict,
Field,
StrictBool,
field_validator,
model_validator,
)
type EndpointA... | Azure/azure-functions-agents-runtime | src/azure_functions_agents/config/schema.py | .py | 5f6573725b17cb5a | 7.5 | 9 |
"""Skill discovery — locate MAF-compatible SKILL.md files under ``{app_root}/skills/``.
Each skill lives in its own directory and is declared by a ``SKILL.md`` file
with YAML frontmatter providing at least a ``name`` and a ``description``.
The runtime hands the resolved skill directories to
:class:`agent_framework.Ski... | Azure/azure-functions-agents-runtime | src/azure_functions_agents/discovery/skills.py | .py | 8a73fbd9c7350dd7 | 7.5 | 9 |
"""Inbound authentication enforcement for built-in endpoints.
This module is the only place that reasons about *who* may call an agent's
built-in HTTP endpoints. It maps the authoring-level ``builtin_endpoints.http_auth``
policy onto an Azure Functions ``AuthLevel`` (for native function/system-key
"API key" auth) and,... | Azure/azure-functions-agents-runtime | src/azure_functions_agents/registration/_auth.py | .py | 0d0f3de564221166 | 7.5 | 9 |
"""Capability filtering for resolved agents."""
from __future__ import annotations
from dataclasses import dataclass, field, replace
from importlib import import_module
from pathlib import Path
from typing import Any
from .._function_tool import WorkflowTool
from .._logger import logger
from .._slug import delegate_... | Azure/azure-functions-agents-runtime | src/azure_functions_agents/registration/capabilities.py | .py | 59454ce67508804b | 7.5 | 9 |
#!/usr/bin/env python3
"""Coherence benchmark — runs tests + lint + typecheck and reports metrics."""
from __future__ import annotations
import json
import subprocess
import sys
import time
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def run(cmd: list[str], capture: bool = True) -> tuple[in... | smolfiddle/pahebatcher | scripts/benchmark.py | .py | ad568f46c90d2cf4 | 7.63 | 17 |
"""Coherence & benchmark suite — validates docs/config/code consistency."""
from __future__ import annotations
import os
import re
import subprocess
import sys
from pathlib import Path
import pytest
class TestBenchmark:
"""Benchmark: lint, typecheck, tests must be green — mirrors Makefile."""
def test_ruf... | smolfiddle/pahebatcher | tests/test_coherence.py | .py | 528bf94b704a9457 | 8.13 | 17 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.