Skip to content

04 / SaltyFactory

Give creative work a dependable workflow.

A product studio connecting artwork, assets, product drafts, provider integrations and reviewed publishing.

Public source

My role

Founder, product design, engineering and acceptance

Technology

TypeScriptNext.jsReactSupabasePostgreSQLDrizzleSharpVitest

The problem

A product idea needs to survive a lot of handoffs before it reaches a shop. Artwork, files, product options, copy and provider state all need to agree.

How I approached it

I built SaltyFactory as a modular TypeScript workspace with a storefront, private studio, worker and shared packages. The product domain carries review rules, while adapters handle the commerce providers.

Follow the workflow. Select a stage to see its purpose.

Artwork. Prepare the design and the assets needed for the product.

Decisions that matter.

01

Keep business rules in the domain

Publishing checks are shared rules that provider actions must satisfy. A misleading allowed flag is rejected when it conflicts with the underlying review state.

02

Give an agent only the tools it needs

Each role has an explicit tool registry. The runtime rejects unknown tools and invalid arguments before executing them.

03

Preserve the work behind an answer

Agent runs record tool calls and results, save their final output and enforce a turn limit. That makes an incomplete run distinguishable from a completed one.

The implementation

tests/publish-gates-invariants.test.ts

Make human approval an executable ruleTypeScript
it("human approval false blocks both providers", () => {
    const review = { ...validDomainFixtures.publishReview, gates: { ...allTrueGates, human_approved: false }, all_gates_passed: false, shopify_publish_allowed: false, printify_sync_allowed: false };
    expect(() => assertPublishAllowedForShopify(review)).toThrow();
    expect(() => assertPublishAllowedForPrintify(review)).toThrow();
  });

  it("inconsistent allowed flag true is rejected", () => {
    const review = { ...validDomainFixtures.publishReview, gates: { ...allTrueGates, title_reviewed: false }, all_gates_passed: false, shopify_publish_allowed: true, printify_sync_allowed: true };
    expect(publishReviewSchema.safeParse(review).success).toBe(false);
    expect(evaluatePublishReviewGates(review).inconsistent).toBe(true);
  });

Two regression cases from the public source. Missing human approval blocks both providers, and an allowed flag cannot override an unreviewed title.

What I check

  • Missing human approval blocks both commerce providers.
  • Conflicting review flags are rejected.
  • Unknown tools and malformed arguments are blocked.
  • An unavailable model produces a blocked run.

The result

The public repository shows the product workflow, agent runtime and regression tests. Its implementation notes describe the working features and provider setup, giving another engineer a concrete starting point for review.