import { describe, expect, it } from "vitest";
import {
  i1FactoryRuns,
  i1Goals,
  i1Ids,
  i1Plans,
  i1Project,
  i1Tasks,
  projectOverviewReadModel,
} from "@awp/application";
import {
  c1ProjectOverviewSnapshot,
  c1TaskFixtureSnapshot,
} from "../../apps/web/src/c1-snapshot.js";

describe("Lane D C1 contract lock", () => {
  it("UI-C1-001 mirrors Lane A's deterministic Project Overview read model exactly", () => {
    const authoritative = projectOverviewReadModel({
      project: i1Project,
      goals: i1Goals,
      plans: i1Plans,
      planGoalIds: new Map([[i1Ids.plan, [i1Ids.goal]]]),
      tasks: i1Tasks,
      queueOrder: [i1Ids.taskFoundation, i1Ids.taskUi],
      factoryRuns: i1FactoryRuns,
    });
    expect(c1ProjectOverviewSnapshot).toEqual(authoritative);
  });

  it("UI-C1-002 mirrors the deterministic C1 Task fixtures used for dependency display", () => {
    expect(c1TaskFixtureSnapshot).toEqual(i1Tasks);
  });
});
