.ts import fixees
This commit is contained in:
@@ -6,7 +6,7 @@ import { describe, expect, it } from "vitest";
|
|||||||
import {
|
import {
|
||||||
getExecutableGitSoftware,
|
getExecutableGitSoftware,
|
||||||
makeGitExecutablesRunnable,
|
makeGitExecutablesRunnable,
|
||||||
} from "./agent-os-git-software.ts";
|
} from "./agent-os-git-software";
|
||||||
|
|
||||||
const TAR_BLOCK_SIZE = 512;
|
const TAR_BLOCK_SIZE = 512;
|
||||||
const READ_ONLY_EXECUTABLE_MODE = Buffer.from([0xa4, 0x81, 0x00, 0x00]);
|
const READ_ONLY_EXECUTABLE_MODE = Buffer.from([0xa4, 0x81, 0x00, 0x00]);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { agentOS as createAgentOsActor } from "@rivet-dev/agentos";
|
|||||||
import type { AgentOSConfigInput } from "@rivet-dev/agentos";
|
import type { AgentOSConfigInput } from "@rivet-dev/agentos";
|
||||||
import { Context, Effect, Layer, Schema } from "effect";
|
import { Context, Effect, Layer, Schema } from "effect";
|
||||||
|
|
||||||
import { getExecutableGitSoftware } from "./agent-os-git-software.ts";
|
import { getExecutableGitSoftware } from "./agent-os-git-software";
|
||||||
|
|
||||||
const withGitSoftware = (
|
const withGitSoftware = (
|
||||||
config: AgentOSConfigInput<undefined>
|
config: AgentOSConfigInput<undefined>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { describe, expect, test } from "vitest";
|
|||||||
import {
|
import {
|
||||||
decodeGitConnectionInput,
|
decodeGitConnectionInput,
|
||||||
decodeWorkAttemptExecutionResult,
|
decodeWorkAttemptExecutionResult,
|
||||||
} from "./execution-runtime.ts";
|
} from "./execution-runtime";
|
||||||
|
|
||||||
describe("execution runtime contracts", () => {
|
describe("execution runtime contracts", () => {
|
||||||
test("accepts one authenticated Gitea connection", async () => {
|
test("accepts one authenticated Gitea connection", async () => {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/* eslint-disable max-classes-per-file -- execution boundary errors live with their schemas. */
|
/* eslint-disable max-classes-per-file -- execution boundary errors live with their schemas. */
|
||||||
import { Effect, Schema } from "effect";
|
import { Effect, Schema } from "effect";
|
||||||
|
|
||||||
import { GitProvider } from "./git-provider.ts";
|
import { GitProvider } from "./git-provider";
|
||||||
|
|
||||||
export type { GitProvider } from "./git-provider.ts";
|
export type { GitProvider } from "./git-provider";
|
||||||
|
|
||||||
const Text = Schema.String.check(
|
const Text = Schema.String.check(
|
||||||
Schema.makeFilter((value) => value.trim().length > 0, {
|
Schema.makeFilter((value) => value.trim().length > 0, {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
currentBranch,
|
currentBranch,
|
||||||
nodeShell,
|
nodeShell,
|
||||||
push,
|
push,
|
||||||
} from "./git-local-runtime.ts";
|
} from "./git-local-runtime";
|
||||||
|
|
||||||
const run = <A, E>(eff: Effect.Effect<A, E>) => Effect.runPromise(eff);
|
const run = <A, E>(eff: Effect.Effect<A, E>) => Effect.runPromise(eff);
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { promisify } from "node:util";
|
|||||||
|
|
||||||
import { Context, Effect, Layer, Schema } from "effect";
|
import { Context, Effect, Layer, Schema } from "effect";
|
||||||
|
|
||||||
import { GitBranchName } from "./git.ts";
|
import { GitBranchName } from "./git";
|
||||||
|
|
||||||
const execFileP = promisify(execFile);
|
const execFileP = promisify(execFile);
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
isProviderHostCompatible,
|
isProviderHostCompatible,
|
||||||
normalizeRepositoryUrl,
|
normalizeRepositoryUrl,
|
||||||
providerForHost,
|
providerForHost,
|
||||||
} from "./git-provider.ts";
|
} from "./git-provider";
|
||||||
import {
|
import {
|
||||||
canSafelyReplaceRepository,
|
canSafelyReplaceRepository,
|
||||||
idempotencyKeyFor,
|
idempotencyKeyFor,
|
||||||
@@ -18,8 +18,8 @@ import {
|
|||||||
validatePuterOrgName,
|
validatePuterOrgName,
|
||||||
validatePuterUsername,
|
validatePuterUsername,
|
||||||
validateRepositoryName,
|
validateRepositoryName,
|
||||||
} from "./git-provisioning.ts";
|
} from "./git-provisioning";
|
||||||
import { isProcessedEvent } from "./git-webhook.ts";
|
import { isProcessedEvent } from "./git-webhook";
|
||||||
|
|
||||||
describe("git-provider normalization", () => {
|
describe("git-provider normalization", () => {
|
||||||
test("normalizes a standard HTTPS GitHub URL", async () => {
|
test("normalizes a standard HTTPS GitHub URL", async () => {
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
/* eslint-disable max-classes-per-file -- provisioning commands, results, and errors form one validated-command module. */
|
/* eslint-disable max-classes-per-file -- provisioning commands, results, and errors form one validated-command module. */
|
||||||
import { Effect, Schema } from "effect";
|
import { Effect, Schema } from "effect";
|
||||||
|
|
||||||
import type { GitProvider, ProviderAccount } from "./git-provider.ts";
|
import type { GitProvider, ProviderAccount } from "./git-provider";
|
||||||
import {
|
import {
|
||||||
GitProviderError,
|
GitProviderError,
|
||||||
RepositoryPrivacy,
|
RepositoryPrivacy,
|
||||||
PUTER_GIT_SERVER_URL,
|
PUTER_GIT_SERVER_URL,
|
||||||
} from "./git-provider.ts";
|
} from "./git-provider";
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Shared filters
|
// Shared filters
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import {
|
|||||||
createPullRequest,
|
createPullRequest,
|
||||||
getIssue,
|
getIssue,
|
||||||
listIssues,
|
listIssues,
|
||||||
} from "./git-remote-runtime.ts";
|
} from "./git-remote-runtime";
|
||||||
import type { GitRemoteConfig, GitRemoteTransport } from "./git-remote-runtime.ts";
|
import type { GitRemoteConfig, GitRemoteTransport } from "./git-remote-runtime";
|
||||||
|
|
||||||
const config: GitRemoteConfig = {
|
const config: GitRemoteConfig = {
|
||||||
baseUrl: "https://git.example.com",
|
baseUrl: "https://git.example.com",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/* eslint-disable max-classes-per-file -- webhook event envelopes and errors form one normalized module. */
|
/* eslint-disable max-classes-per-file -- webhook event envelopes and errors form one normalized module. */
|
||||||
import { Effect, Schema } from "effect";
|
import { Effect, Schema } from "effect";
|
||||||
|
|
||||||
import { GitProvider } from "./git-provider.ts";
|
import { GitProvider } from "./git-provider";
|
||||||
|
|
||||||
const Text = Schema.String.check(
|
const Text = Schema.String.check(
|
||||||
Schema.makeFilter((value) => value.trim().length > 0, {
|
Schema.makeFilter((value) => value.trim().length > 0, {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
inspectGitWorkspace,
|
inspectGitWorkspace,
|
||||||
makeCommitMessage,
|
makeCommitMessage,
|
||||||
validatePullRequestMetadata,
|
validatePullRequestMetadata,
|
||||||
} from "./git.ts";
|
} from "./git";
|
||||||
|
|
||||||
const inspectionInput = {
|
const inspectionInput = {
|
||||||
branch: "work/issue-5",
|
branch: "work/issue-5",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Effect, Schema } from "effect";
|
import { Effect, Schema } from "effect";
|
||||||
|
|
||||||
import type { AttemptOutcome } from "./resolver.ts";
|
import type { AttemptOutcome } from "./resolver";
|
||||||
|
|
||||||
const Text = Schema.String.check(
|
const Text = Schema.String.check(
|
||||||
Schema.makeFilter((value) => value.trim().length > 0, {
|
Schema.makeFilter((value) => value.trim().length > 0, {
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
// oxlint-disable-next-line no-barrel-file -- The package root intentionally exposes its public modules.
|
// oxlint-disable-next-line no-barrel-file -- The package root intentionally exposes its public modules.
|
||||||
export * from "./agent-os.ts";
|
export * from "./agent-os";
|
||||||
export * from "./execution-runtime.ts";
|
export * from "./execution-runtime";
|
||||||
export * from "./git.ts";
|
export * from "./git";
|
||||||
export * from "./git-provider.ts";
|
export * from "./git-provider";
|
||||||
export * from "./git-provisioning.ts";
|
export * from "./git-provisioning";
|
||||||
export * from "./git-webhook.ts";
|
export * from "./git-webhook";
|
||||||
export * from "./git-local-runtime.ts";
|
export * from "./git-local-runtime";
|
||||||
export * from "./git-remote-runtime.ts";
|
export * from "./git-remote-runtime";
|
||||||
export * from "./project.ts";
|
export * from "./project";
|
||||||
export * from "./project-issue.ts";
|
export * from "./project-issue";
|
||||||
export * from "./project-workspace.ts";
|
export * from "./project-workspace";
|
||||||
export * from "./project-work.ts";
|
export * from "./project-work";
|
||||||
export * from "./signal.ts";
|
export * from "./signal";
|
||||||
export * from "./smoke.ts";
|
export * from "./smoke";
|
||||||
export * from "./work.ts";
|
export * from "./work";
|
||||||
export * from "./work-artifact.ts";
|
export * from "./work-artifact";
|
||||||
export * from "./work-definition.ts";
|
export * from "./work-definition";
|
||||||
export * from "./work-design.ts";
|
export * from "./work-design";
|
||||||
export * from "./work-lifecycle.ts";
|
export * from "./work-lifecycle";
|
||||||
export * from "./resolver.ts";
|
export * from "./resolver";
|
||||||
export * from "./harness-runtime.ts";
|
export * from "./harness-runtime";
|
||||||
export * from "./host-repository.ts";
|
export * from "./host-repository";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
projectIssueDraftFromSignal,
|
projectIssueDraftFromSignal,
|
||||||
queueProjectIssue,
|
queueProjectIssue,
|
||||||
validateProjectIssueDraft,
|
validateProjectIssueDraft,
|
||||||
} from "./project-issue.ts";
|
} from "./project-issue";
|
||||||
|
|
||||||
describe("project issue primitives", () => {
|
describe("project issue primitives", () => {
|
||||||
it("normalizes an explicit project request", () => {
|
it("normalizes an explicit project request", () => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/* eslint-disable max-classes-per-file -- each domain failure has a distinct tagged reason. */
|
/* eslint-disable max-classes-per-file -- each domain failure has a distinct tagged reason. */
|
||||||
import { Effect, Schema } from "effect";
|
import { Effect, Schema } from "effect";
|
||||||
|
|
||||||
import { ProblemStatement, ProjectId, SignalId } from "./signal.ts";
|
import { ProblemStatement, ProjectId, SignalId } from "./signal";
|
||||||
|
|
||||||
const MeaningfulString = Schema.String.check(
|
const MeaningfulString = Schema.String.check(
|
||||||
Schema.makeFilter((value) => value.trim().length > 0, {
|
Schema.makeFilter((value) => value.trim().length > 0, {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
getProjectWorkNextAction,
|
getProjectWorkNextAction,
|
||||||
getProjectWorkProgress,
|
getProjectWorkProgress,
|
||||||
getProjectWorkStatus,
|
getProjectWorkStatus,
|
||||||
} from "./project-work.ts";
|
} from "./project-work";
|
||||||
|
|
||||||
describe("project work state mapping", () => {
|
describe("project work state mapping", () => {
|
||||||
test("maps issue and run statuses to the same product language", () => {
|
test("maps issue and run statuses to the same product language", () => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { ProjectIssueStatus } from "./project-issue.ts";
|
import type { ProjectIssueStatus } from "./project-issue";
|
||||||
|
|
||||||
export const PROJECT_ISSUE_STATUSES = [
|
export const PROJECT_ISSUE_STATUSES = [
|
||||||
"open",
|
"open",
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
WorkspaceExecutionError,
|
WorkspaceExecutionError,
|
||||||
WorkspaceStateError,
|
WorkspaceStateError,
|
||||||
WorkspaceValidationError,
|
WorkspaceValidationError,
|
||||||
} from "./project-workspace.ts";
|
} from "./project-workspace";
|
||||||
|
|
||||||
const makeInput = () => ({
|
const makeInput = () => ({
|
||||||
artifacts: [
|
artifacts: [
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/* eslint-disable max-classes-per-file -- workspace errors stay next to their contracts. */
|
/* eslint-disable max-classes-per-file -- workspace errors stay next to their contracts. */
|
||||||
import { Effect, Schema } from "effect";
|
import { Effect, Schema } from "effect";
|
||||||
|
|
||||||
import { CONTEXT_KINDS } from "./project.ts";
|
import { CONTEXT_KINDS } from "./project";
|
||||||
|
|
||||||
export type { ContextKind } from "./project.ts";
|
export type { ContextKind } from "./project";
|
||||||
|
|
||||||
const MeaningfulString = Schema.String.check(
|
const MeaningfulString = Schema.String.check(
|
||||||
Schema.makeFilter((value) => value.trim().length > 0, {
|
Schema.makeFilter((value) => value.trim().length > 0, {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/* eslint-disable max-classes-per-file -- deep Effect v4 domain module: branded schemas, tagged errors, and context services */
|
/* eslint-disable max-classes-per-file -- deep Effect v4 domain module: branded schemas, tagged errors, and context services */
|
||||||
import { Context, Effect, Layer, Schema } from "effect";
|
import { Context, Effect, Layer, Schema } from "effect";
|
||||||
|
|
||||||
import { OrganizationId, ProjectId, TimestampMs } from "./signal.ts";
|
import { OrganizationId, ProjectId, TimestampMs } from "./signal";
|
||||||
|
|
||||||
export type { OrganizationId, ProjectId } from "./signal.ts";
|
export type { OrganizationId, ProjectId } from "./signal";
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Domain constants
|
// Domain constants
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Schema } from "effect";
|
import { Schema } from "effect";
|
||||||
|
|
||||||
import type { WorkStatus } from "./work-lifecycle.ts";
|
import type { WorkStatus } from "./work-lifecycle";
|
||||||
|
|
||||||
const Text = Schema.String.check(
|
const Text = Schema.String.check(
|
||||||
Schema.makeFilter((value) => value.trim().length > 0, {
|
Schema.makeFilter((value) => value.trim().length > 0, {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Effect } from "effect";
|
import { Effect } from "effect";
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
|
|
||||||
import { composeSignal, SignalValidationError } from "./signal.ts";
|
import { composeSignal, SignalValidationError } from "./signal";
|
||||||
import type { SignalValidationReason } from "./signal.ts";
|
import type { SignalValidationReason } from "./signal";
|
||||||
|
|
||||||
type TestSignalScope =
|
type TestSignalScope =
|
||||||
| {
|
| {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
redactSmokeText,
|
redactSmokeText,
|
||||||
selectSmokeModelRoles,
|
selectSmokeModelRoles,
|
||||||
validateSmokeCapabilities,
|
validateSmokeCapabilities,
|
||||||
} from "./smoke.ts";
|
} from "./smoke";
|
||||||
|
|
||||||
const validRoleSelection = () => ({
|
const validRoleSelection = () => ({
|
||||||
plannerReviewerModel: "glm-5.2",
|
plannerReviewerModel: "glm-5.2",
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { describe, expect, test } from "vitest";
|
|||||||
import {
|
import {
|
||||||
decodeWorkArtifactDraft,
|
decodeWorkArtifactDraft,
|
||||||
decodeWorkDeliveryDraft,
|
decodeWorkDeliveryDraft,
|
||||||
} from "./work-artifact.ts";
|
} from "./work-artifact";
|
||||||
|
|
||||||
describe("Work artifact contracts", () => {
|
describe("Work artifact contracts", () => {
|
||||||
test("accepts traceable artifact and delivery metadata", async () => {
|
test("accepts traceable artifact and delivery metadata", async () => {
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { Effect } from "effect";
|
import { Effect } from "effect";
|
||||||
import { describe, expect, test } from "vitest";
|
import { describe, expect, test } from "vitest";
|
||||||
|
|
||||||
import { FakeHarnessLive } from "./harness-runtime.ts";
|
import { FakeHarnessLive } from "./harness-runtime";
|
||||||
import { defaultCodingKitV0, resolveOutcome, shouldRetry } from "./resolver.ts";
|
import { defaultCodingKitV0, resolveOutcome, shouldRetry } from "./resolver";
|
||||||
import { decodeDefinition, validateDefinition } from "./work-definition.ts";
|
import { decodeDefinition, validateDefinition } from "./work-definition";
|
||||||
import { validateDesignPacket } from "./work-design.ts";
|
import { validateDesignPacket } from "./work-design";
|
||||||
import { canTransitionWork } from "./work-lifecycle.ts";
|
import { canTransitionWork } from "./work-lifecycle";
|
||||||
|
|
||||||
const definition = {
|
const definition = {
|
||||||
acceptanceCriteria: ["terminal outcome"],
|
acceptanceCriteria: ["terminal outcome"],
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
signalAttachedEvent,
|
signalAttachedEvent,
|
||||||
workDraftFromSignal,
|
workDraftFromSignal,
|
||||||
workProposedEventFromSignal,
|
workProposedEventFromSignal,
|
||||||
} from "./work.ts";
|
} from "./work";
|
||||||
|
|
||||||
describe("workDraftFromSignal", () => {
|
describe("workDraftFromSignal", () => {
|
||||||
test("creates a proposed Work draft from Signal meaning", async () => {
|
test("creates a proposed Work draft from Signal meaning", async () => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Array as EffectArray, Effect, Order, Schema } from "effect";
|
import { Array as EffectArray, Effect, Order, Schema } from "effect";
|
||||||
|
|
||||||
export { WorkStatus } from "./work-lifecycle.ts";
|
export { WorkStatus } from "./work-lifecycle";
|
||||||
export type { WorkStatus as WorkLifecycleStatus } from "./work-lifecycle.ts";
|
export type { WorkStatus as WorkLifecycleStatus } from "./work-lifecycle";
|
||||||
|
|
||||||
const MeaningfulString = Schema.String.check(
|
const MeaningfulString = Schema.String.check(
|
||||||
Schema.makeFilter((value) => value.trim().length > 0, {
|
Schema.makeFilter((value) => value.trim().length > 0, {
|
||||||
|
|||||||
Reference in New Issue
Block a user