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
120 changes: 64 additions & 56 deletions apps/web/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -210,22 +210,14 @@ a {
display: flex;
flex-direction: column;
align-items: center;
align-self: stretch;
padding: 12px 28px;
border-radius: var(--radius);
background: var(--text);
color: var(--bg);
position: relative;
}

.chart__root::after {
content: "";
position: absolute;
left: 50%;
bottom: -24px;
height: 24px;
border-left: 1px solid var(--connector);
}

.chart__root-name {
font-weight: 700;
font-size: 16px;
Expand All @@ -237,24 +229,31 @@ a {
}

.chart__divisions {
--cols: 3;
margin-top: 24px;
margin-top: 20px;
width: 100%;
display: grid;
grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
grid-auto-flow: row dense;
gap: 16px;
position: relative;
padding-top: 24px;
align-items: start;
}

/* ๋ณธ๋ถ€๋ฅผ ์ž‡๋Š” ๊ฐ€๋กœ์„ : ์ฒซ ์—ด ์ค‘์•™๋ถ€ํ„ฐ ๋งˆ์ง€๋ง‰ ์—ด ์ค‘์•™๊นŒ์ง€ */
.chart__divisions::before {
content: "";
position: absolute;
top: 0;
left: calc(100% / (2 * var(--cols)));
right: calc(100% / (2 * var(--cols)));
border-top: 1px solid var(--connector);
/* ํŒ€์ด ๋งŽ์€ ๋ณธ๋ถ€๋Š” ๋‘ ์นธ์„ ์“ฐ๊ณ  ํŒ€์„ 2์—ด๋กœ ๋†“๋Š”๋‹ค */
.division--wide {
grid-column: span 2;
}

.division--wide .division__teams {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
align-items: start;
border-left: 0;
margin-left: 0;
padding-left: 0;
}

.division--wide .team::before {
display: none;
}

.division {
Expand All @@ -264,14 +263,7 @@ a {
gap: 12px;
}

.division::before {
content: "";
position: absolute;
top: -24px;
left: 50%;
height: 24px;
border-left: 1px solid var(--connector);
}


.division__head {
padding: 14px 16px;
Expand Down Expand Up @@ -364,6 +356,12 @@ a {

.team__head h3 {
font-size: 15px;
white-space: nowrap;
}

.team__head {
flex-wrap: wrap;
row-gap: 4px;
}

.stage {
Expand Down Expand Up @@ -672,36 +670,11 @@ a {
font-size: 13px;
}

@media (max-width: 1200px) {
.chart__divisions {
grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}

.chart__divisions::before,
.division::before,
.chart__root::after {
display: none;
}

.chart__divisions {
padding-top: 0;
}
}

@media (max-width: 960px) {
.board {
grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chart__divisions::before,
.division::before,
.chart__root::after {
display: none;
}

.chart__divisions {
padding-top: 0;
}
}

@media (max-width: 640px) {
Expand Down Expand Up @@ -873,7 +846,8 @@ a {
/* โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ office floor โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */
.floor {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr));
grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
grid-auto-flow: row dense;
gap: 16px;
padding: 16px;
border-radius: 12px;
Expand Down Expand Up @@ -1544,3 +1518,37 @@ a {
padding: 10px;
}
}

@media (max-width: 640px) {
.division--wide {
grid-column: auto;
}

.division--wide .division__teams {
grid-template-columns: 1fr;
}
}

/* ์กฐ์ง๋„ยท์ž๋ฆฌ ๋ฐฐ์น˜๋„๋Š” ๋„“์€ ๋ชจ๋‹ˆํ„ฐ์—์„œ ์ขŒ์šฐ๋กœ ๋„“๊ฒŒ ์“ด๋‹ค (์ž‘์€ ํ™”๋ฉด์€ ๊ธฐ์กด ํญ๊ณผ ๊ฐ™์Œ) */
.page:has(.bleed),
body:has(.bleed) .site-header__inner {
max-width: 2560px;
}

@media (min-width: 1600px) {
.page:has(.bleed),
body:has(.bleed) .site-header__inner {
padding-left: 40px;
padding-right: 40px;
}
}

.zone--wide {
grid-column: span 2;
}

@media (max-width: 960px) {
.zone--wide {
grid-column: auto;
}
}
6 changes: 3 additions & 3 deletions apps/web/app/office/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default async function OfficePage() {
const working = [...activity.values()].filter((item) => item.state === "working").length;

return (
<>
<div className="bleed">
<div className="page-head">
<div>
<h1>์ž๋ฆฌ ๋ฐฐ์น˜๋„</h1>
Expand Down Expand Up @@ -52,13 +52,13 @@ export default async function OfficePage() {
</div>
</section>
</div>
</>
</div>
);
}

function Zone({ division, activity }: { division: Division; activity: Map<string, TeamActivity> }) {
return (
<section className={`zone zone--${division.id}`} role="listitem" aria-labelledby={`zone-${division.id}`}>
<section className={`zone zone--${division.id}${division.teams.length > 3 ? " zone--wide" : ""}`} role="listitem" aria-labelledby={`zone-${division.id}`}>
<header className="zone__head">
<h2 className="zone__name" id={`zone-${division.id}`}>
{division.name}
Expand Down
8 changes: 4 additions & 4 deletions apps/web/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default async function OrgChartPage() {
const women = people.filter((role) => role.person.gender === "female").length;

return (
<>
<div className="bleed">
<div className="page-head">
<div>
<h1>์กฐ์ง๋„</h1>
Expand Down Expand Up @@ -54,7 +54,7 @@ export default async function OrgChartPage() {
<span className="chart__root-name">{org.name}</span>
<span className="chart__root-meta">๋Œ€ํ‘œ ยท merge์™€ production ๋ฐฐํฌ ์Šน์ธ</span>
</div>
<ul className="chart__divisions" style={{ ["--cols" as string]: org.divisions.length }}>
<ul className="chart__divisions">
{org.divisions.map((division) => (
<DivisionColumn key={division.id} division={division} spentCents={spend.get(division.id) ?? 0} />
))}
Expand Down Expand Up @@ -82,7 +82,7 @@ export default async function OrgChartPage() {
์‚ฌ๋žŒ์—๊ฒŒ ๋„˜๊น๋‹ˆ๋‹ค.
</p>
</section>
</>
</div>
);
}

Expand All @@ -101,7 +101,7 @@ function FlowStep({ title, owner, human = false, children }: { title: string; ow
function DivisionColumn({ division, spentCents }: { division: Division; spentCents: number }) {
const usage = Math.min(spentCents / division.monthlyBudgetCents, 1);
return (
<li className="division">
<li className={`division${division.teams.length > 3 ? " division--wide" : ""}`}>
<div className="division__head">
<div className="division__title">
<Avatar seed={`head-${division.id}`} gender={division.head.gender} name={division.head.name} divisionId={division.id} size={40} senior />
Expand Down
1 change: 1 addition & 0 deletions apps/web/components/avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const DIVISION_COLOR: Record<string, string> = {
product: "#3b6fd8",
quality: "#7a5cd6",
risk: "#d0533f",
business: "#d9468f",
operations: "#2f9a8a",
};
const FALLBACK_COLOR = "#6b7280";
Expand Down
14 changes: 14 additions & 0 deletions apps/worker/src/brief.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,20 @@ export function buildBrief(input: BriefInput): string {
}

case "release":
if (input.reviewer) {
return [
header,
"",
issueBlock(input),
"",
specBlock(input),
"",
`## ๋ฐฐํฌ ์ค€๋น„ ์ฐธ์—ฌ: PR #${input.prNumber} ๊ฐ€ ${input.baseBranch} ์— merge ๋˜์—ˆ๋‹ค.`,
`๋„ˆ๋Š” ${input.reviewer.teamName}์œผ๋กœ์„œ ์—ญํ•  ์ง€์นจ์˜ ๊ด€์ ์—์„œ ์ด๋ฒˆ ์ถœ์‹œ์— ํ•„์š”ํ•œ ๊ฒฐ๊ณผ๋ฌผ์„ ๋งŒ๋“ ๋‹ค.`,
"`git log` ์™€ ๋ณ€๊ฒฝ๋œ ํŒŒ์ผ๋กœ ์‹ค์ œ ๋ฐ˜์˜๋œ ๋‚ด์šฉ๋งŒ ๊ทผ๊ฑฐ๋กœ ์“ด๋‹ค. ํŒŒ์ผ์„ ์ˆ˜์ •ํ•˜๊ฑฐ๋‚˜ ์ปค๋ฐ‹ํ•˜์ง€ ์•Š๊ณ , ๋ฐฐํฌ ๋ช…๋ น์„ ์‹คํ–‰ํ•˜์ง€ ์•Š๋Š”๋‹ค.",
`${REPORT_RULE} ๊ฒฐ๊ณผ๋ฌผ์€ summary ์™€ notes ์— ์“ด๋‹ค.`,
].join("\n");
}
return [
header,
"",
Expand Down
3 changes: 3 additions & 0 deletions apps/worker/src/flow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ describe.skipIf(!url)("์ž‘์—… ํ๋ฆ„ (Postgres)", () => {
await step(); // ๋ฆด๋ฆฌ์Šค
expect(await currentTask()).toMatchObject({ stage: "release", status: "awaiting_deploy" });
expect(github.comments.at(-1)?.body).toContain("production ๋ฐฐํฌ ์š”์ฒญ");
// โœจ feature ์ž‘์—…์ด๋ผ ๋งˆ์ผ€ํŒ…ํŒ€์ด ๋ฐฐํฌ ์ค€๋น„์— ์ฐธ์—ฌํ•œ๋‹ค
expect(github.comments.at(-1)?.body).toContain("### ๋งˆ์ผ€ํŒ…ํŒ€");
expect(calls.filter((call) => call.stage === "release").map((call) => call.team)).toEqual(["release", "marketing"]);

await orchestrator.applyById(task.id, { type: "deploy_approved" }, "xixn2");
expect((await currentTask()).status).toBe("done");
Expand Down
9 changes: 7 additions & 2 deletions apps/worker/src/orchestrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,17 @@ export class Orchestrator {
}

case "release": {
const report = reports[0]!.report;
const [primary, ...others] = reports;
const report = primary!.report;
// ๋งˆ์ผ€ํŒ…ํŒ€์ฒ˜๋Ÿผ ๋ฐฐํฌ ์ค€๋น„์— ์กฐ๊ฑด๋ถ€๋กœ ์ฐธ์—ฌํ•œ ํŒ€์˜ ๊ฒฐ๊ณผ๋ฌผ์„ ์š”์ฒญ์„œ ๋’ค์— ๋ถ™์ธ๋‹ค
const extras = others
.map((item) => `### ${item.ref.team.name}\n\n${item.report.summary}\n\n${list("๋‚ด์šฉ", item.report.notes)}`)
.join("\n");
const target = task.prNumber ?? task.issueNumber;
if (target !== null) {
await this.safeComment(
{ ...task, issueNumber: target },
`production ๋ฐฐํฌ ์š”์ฒญ\n\n${report.summary}\n\n${list("๋ณ€๊ฒฝ", report.changes)}${list("ํ™•์ธ", report.verification)}${list("์œ„ํ—˜ยท๋กค๋ฐฑ", report.notes)}\noffAI ์ฝ˜์†”์—์„œ ๋ฐฐํฌ ์Šน์ธ์„ ๊ธฐ๋กํ•˜๋ฉด ์ž‘์—…์ด ์™„๋ฃŒ๋ฉ๋‹ˆ๋‹ค.`,
`production ๋ฐฐํฌ ์š”์ฒญ\n\n${report.summary}\n\n${list("๋ณ€๊ฒฝ", report.changes)}${list("ํ™•์ธ", report.verification)}${list("์œ„ํ—˜ยท๋กค๋ฐฑ", report.notes)}${extras ? `${extras}\n` : ""}\noffAI ์ฝ˜์†”์—์„œ ๋ฐฐํฌ ์Šน์ธ์„ ๊ธฐ๋กํ•˜๋ฉด ์ž‘์—…์ด ์™„๋ฃŒ๋ฉ๋‹ˆ๋‹ค.`,
);
}
await this.apply(task, { type: "stage_completed" }, "๋ฆด๋ฆฌ์Šค", "๋ฐฐํฌ ์š”์ฒญ์„œ ์ž‘์„ฑ โ†’ ์‚ฌ๋žŒ ๋ฐฐํฌ ์Šน์ธ ๋Œ€๊ธฐ");
Expand Down
6 changes: 3 additions & 3 deletions docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ worker ์˜ ๋ช…๋ น ์ •์ฑ…(`packages/core/src/policy.ts`)๋„ main pushยทforce push
pnpm --filter @offai/worker setup:agents
```

- environment ํ•˜๋‚˜๋ฅผ ๋งŒ๋“ค๊ณ (์ด๋ฏธ ์žˆ์œผ๋ฉด ์žฌ์‚ฌ์šฉ) ์กฐ์ง์˜ ์ง์› 36๋ช…์„ agent ๋กœ ๋™๊ธฐํ™”ํ•œ๋‹ค
- environment ํ•˜๋‚˜๋ฅผ ๋งŒ๋“ค๊ณ (์ด๋ฏธ ์žˆ์œผ๋ฉด ์žฌ์‚ฌ์šฉ) ์กฐ์ง์˜ ์ง์› 56๋ช…์„ agent ๋กœ ๋™๊ธฐํ™”ํ•œ๋‹ค
- ์ดํ›„ ์ฝ˜์†”์—์„œ ์กฐ์ง์„ ์ˆ˜์ •ํ•˜๋ฉด worker ๊ฐ€ ๋‹ค์Œ ์ฃผ๊ธฐ์— ๋ฐ”๋€ ์ง์›๋งŒ ์ƒˆ ๋ฒ„์ „์œผ๋กœ ๊ฐฑ์‹ ํ•œ๋‹ค

## 5. worker ์‹คํ–‰
Expand All @@ -70,10 +70,10 @@ webhook ์„ ๋กœ์ปฌ์—์„œ ๋ฐ›์œผ๋ ค๋ฉด cloudflared ๋“ฑ์œผ๋กœ 4445 ํฌํŠธ๋ฅผ ์™ธ

1. ๋Œ€์ƒ ๋ ˆํฌ Issue ์— `offai` label ์„ ๋ถ™์ธ๋‹ค
2. **๊ธฐํš**: ๊ธฐํšํŒ€์ด ๋ช…์„ธ๋ฅผ ์“ฐ๊ณ , UI ์ž‘์—…์ด๋ฉด ๋””์ž์ธํŒ€์ด ํ™”๋ฉด ๋ช…์„ธ๋ฅผ ๋”ํ•œ๋‹ค โ†’ Issue ์ฝ”๋ฉ˜ํŠธ. ๋ชจํ˜ธํ•˜๋ฉด ์งˆ๋ฌธ์„ ๋‚จ๊ธฐ๊ณ  ๋ฉˆ์ถ˜๋‹ค
3. **๊ตฌํ˜„**: Web/Backend ํŒ€์ด ๋ธŒ๋žœ์น˜์—์„œ ๊ตฌํ˜„ยทpush โ†’ offAI ๊ฐ€ PR ์ƒ์„ฑ
3. **๊ตฌํ˜„**: label ์— ๋”ฐ๋ผ WebยทBackendยทMobileยทํ”Œ๋žซํผยท๋ฐ์ดํ„ฐยทAI ํŒ€์ด ๋ธŒ๋žœ์น˜์—์„œ ๊ตฌํ˜„ยทpush โ†’ offAI ๊ฐ€ PR ์ƒ์„ฑ
4. **๊ฒ€์ฆ**: QAํŒ€ + (๊ฒฝ๋กœยทlabel ์— ๋”ฐ๋ผ) ๋ณด์•ˆํŒ€, ๋ฒ•๋ฌดํŒ€ โ†’ ์ˆ˜์ • ์š”์ฒญ์ด๋ฉด ๊ตฌํ˜„์œผ๋กœ ๋˜๋Œ๋ฆผ (์ตœ๋Œ€ 2ํšŒ)
5. **์‚ฌ๋žŒ**: PR ๊ฒ€ํ†  ํ›„ merge
6. **๋ฐฐํฌ ์ค€๋น„**: ๋ฆด๋ฆฌ์ŠคํŒ€์ด ๋นŒ๋“œ ํ™•์ธ, ๋ฐฐํฌ ์š”์ฒญ์„œ๋ฅผ PR ์— ๋‚จ๊น€
6. **๋ฐฐํฌ ์ค€๋น„**: ๋ฆด๋ฆฌ์ŠคํŒ€์ด ๋นŒ๋“œ ํ™•์ธ, ๋ฐฐํฌ ์š”์ฒญ์„œ๋ฅผ PR ์— ๋‚จ๊น€ (์ƒˆ ๊ธฐ๋Šฅ์ด๋ฉด ๋งˆ์ผ€ํŒ…ํŒ€์ด ์ถœ์‹œ ๊ณต์ง€ ์ดˆ์•ˆ์„ ํ•จ๊ป˜ ๋‚จ๊น€)
7. **์‚ฌ๋žŒ**: production ๋ฐฐํฌ ํ›„ ์ฝ˜์†”์—์„œ '๋ฐฐํฌ ์™„๋ฃŒ ๊ธฐ๋ก'
8. **์šด์˜**: `OPERATE_INTERVAL_HOURS` ๋งˆ๋‹ค ์šด์˜ํŒ€ ์ •๊ธฐ ์ ๊ฒ€ โ†’ ๋ฌธ์ œ๋Š” `offai` label ์—†๋Š” Issue ๋กœ ์ƒ์„ฑ (์‚ฌ๋žŒ์ด label ์„ ๋ถ™์—ฌ์•ผ ์ง„ํ–‰)

Expand Down
26 changes: 25 additions & 1 deletion packages/core/src/core.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ describe("๊ธฐ๋ณธ ์กฐ์ง", () => {
expect(new Set(team.roles.map((role) => role.person.gender)).size).toBe(2);
}
const teamNames = listTeams(DEFAULT_ORG).map(({ team }) => team.name);
expect(teamNames).toEqual(expect.arrayContaining(["๊ธฐํšํŒ€", "๋””์ž์ธํŒ€", "๋ณด์•ˆํŒ€", "๋ฒ•๋ฌดํŒ€", "์šด์˜ํŒ€"]));
expect(teamNames).toEqual(
expect.arrayContaining(["๊ธฐํšํŒ€", "๋””์ž์ธํŒ€", "๋ณด์•ˆํŒ€", "๋ฒ•๋ฌดํŒ€", "์šด์˜ํŒ€", "MobileํŒ€", "ํ”Œ๋žซํผํŒ€", "๋ฐ์ดํ„ฐํŒ€", "AIํŒ€", "๋งˆ์ผ€ํŒ…ํŒ€"]),
);
});
});

Expand All @@ -51,6 +53,28 @@ describe("๋ผ์šฐํŒ…", () => {
expect(routeTask(DEFAULT_ORG, { stage: "implement", labels: ["๐Ÿ–ฅ๏ธ web"] }).team.id).toBe("web");
});

it("์ œํ’ˆ๊ฐœ๋ฐœ๋ณธ๋ถ€ ์ง๊ตฐ๋ณ„๋กœ ๊ตฌํ˜„ํŒ€์„ ๊ณ ๋ฅธ๋‹ค", () => {
const team = (labels: string[]) => routeTask(DEFAULT_ORG, { stage: "implement", labels }).team.id;
expect(team(["๐Ÿ“ฑ ios"])).toBe("mobile");
expect(team(["๐Ÿ“ฑ android"])).toBe("mobile");
expect(team(["โ˜๏ธ infra"])).toBe("platform");
expect(team(["๐Ÿ‘ท ci"])).toBe("platform");
expect(team(["๐Ÿ—„๏ธ database"])).toBe("data");
expect(team(["๐Ÿ“Š data"])).toBe("data");
expect(team(["๐Ÿง  ai"])).toBe("ai");
expect(team(["โš™๏ธ backend"])).toBe("backend");
});

it("์ƒˆ ๊ธฐ๋Šฅ์ด๋ฉด ๋ฐฐํฌ ์ค€๋น„์— ๋งˆ์ผ€ํŒ…ํŒ€์ด ํ•จ๊ป˜ํ•œ๋‹ค", () => {
const ids = (labels: string[]) => teamsForStage(DEFAULT_ORG, { stage: "release", labels }).map(({ team }) => team.id);
expect(ids(["โœจ feature"])).toEqual(["release", "marketing"]);
expect(ids(["๐Ÿ› bug"])).toEqual(["release"]);
});

it("์šด์˜ ๋‹จ๊ณ„์˜ โ˜๏ธ infra ๋Š” ์šด์˜ํŒ€์ด ๋งก๋Š”๋‹ค", () => {
expect(routeTask(DEFAULT_ORG, { stage: "operate", labels: ["โ˜๏ธ infra"] }).team.id).toBe("ops");
});

it("label์ด ์—†์œผ๋ฉด ํ•ด๋‹น ๋‹จ๊ณ„์˜ ์ฒซ ํŒ€์„ ๊ณ ๋ฅธ๋‹ค", () => {
expect(routeTask(DEFAULT_ORG, { stage: "implement", labels: [] }).team.id).toBe("web");
});
Expand Down
Loading
Loading