Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
7 changes: 5 additions & 2 deletions .github/workflows/osvscanner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ name: OSV-Scanner
- cron: '20 19 * * 5'

permissions:
# Require writing security events to upload SARIF file to security tab
security-events: write
# Read commit contents
contents: read
# Read PR metadata for comparison of introduced vulnerabilities
Expand All @@ -28,6 +26,11 @@ permissions:
jobs:
scan:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
actions: read
security-events: write
concurrency:
# Avoid canceling this workflow due to other workflows' concurrency queues (e.g., CodeQL).
# Key off PR number for PR/merge_group, otherwise ref.
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM nginx:1.25-alpine
FROM nginx:1.25-alpine@sha256:516475cc129da42866742567714ddc681e5eed7b9ee0b9e9c015e464b4221a00
COPY infra/nginx/default.conf /etc/nginx/conf.d/default.conf
COPY index.html 404.html app.js styles.css wbs.json /usr/share/nginx/html/
COPY docs/user-guide.md /usr/share/nginx/html/docs/
Expand All @@ -10,4 +10,5 @@ RUN touch /var/run/nginx.pid && \

USER nginx
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 CMD wget -qO- http://127.0.0.1:8080/ >/dev/null || exit 1
CMD ["nginx", "-g", "daemon off;"]
3 changes: 3 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ function setTableBodyRows(rows) {
function createEmptyStateRow() {
const row = document.createElement('tr');
const cell = document.createElement('td');
cell.className = 'empty-state-cell';
Comment thread
seonghobae marked this conversation as resolved.
Resolved
cell.colSpan = 21;

const emptyState = document.createElement('div');
Expand Down Expand Up @@ -2483,6 +2484,8 @@ function debounce(callback, wait) {
// Export for testing
if (typeof window !== 'undefined') {
window.validateDraft = validateDraft;
window.sanitizeCsvFormulaValue = sanitizeCsvFormulaValue;
window.csvEscape = csvEscape;
}

bootstrap();
19 changes: 16 additions & 3 deletions infra/k8s/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
apiVersion: v1
kind: Namespace
metadata:
name: scopeweave
labels:
app: scopeweave
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: scopeweave-deployment
namespace: scopeweave
labels:
app: scopeweave
spec:
Expand All @@ -16,16 +24,20 @@ spec:
spec:
securityContext:
runAsNonRoot: true
runAsUser: 101
runAsGroup: 101
fsGroup: 101
runAsUser: 10001
runAsGroup: 10001
fsGroup: 10001
fsGroupChangePolicy: OnRootMismatch
seccompProfile:
type: RuntimeDefault
containers:
- name: scopeweave
image: scopeweave:1.0.0
imagePullPolicy: IfNotPresent
securityContext:
runAsNonRoot: true
runAsUser: 10001
runAsGroup: 10001
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
Expand Down Expand Up @@ -72,6 +84,7 @@ apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: scopeweave-pdb
namespace: scopeweave
spec:
minAvailable: 1
selector:
Expand Down
1 change: 1 addition & 0 deletions infra/k8s/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: v1
kind: Service
metadata:
name: scopeweave-service
namespace: scopeweave
spec:
selector:
app: scopeweave
Expand Down
43 changes: 42 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
"description": "Production-grade pure HTML/CSS/JS WBS planner",
"scripts": {
"check:python-docstrings": "node scripts/ci/static_coverage_evidence.mjs docstrings",
"coverage": "node scripts/ci/static_coverage_evidence.mjs coverage",
"coverage": "node scripts/ci/static_coverage_evidence.mjs coverage && npm run test:fuzz",
"test:e2e": "playwright test",
"test:e2e:headed": "playwright test --headed"
"test:e2e:headed": "playwright test --headed",
"test:fuzz": "playwright test tests/e2e/csv_formula_fuzz.spec.js"
},
"devDependencies": {
"@playwright/test": "^1.61.1"
"@playwright/test": "1.61.1",
"fast-check": "4.9.0"
}
}
14 changes: 14 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ button {
}

.app-shell {
--table-empty-page-gutter: 98px; /* 2 * 48px shell padding + 2px table-section border */
display: flex;
min-height: 100vh;
flex-direction: column;
Expand Down Expand Up @@ -801,6 +802,14 @@ select[data-inline-progress]:focus {
font-weight: 500;
}

.empty-state-cell {
padding: 0 !important;
}

.empty-state-cell > .table-empty {
width: min(100%, calc(100vw - var(--table-empty-page-gutter)));
}
Comment thread
github-actions[bot] marked this conversation as resolved.
Resolved

@media (max-width: 1400px) {
.meta-grid-primary,
.meta-grid-secondary,
Expand All @@ -817,6 +826,7 @@ select[data-inline-progress]:focus {

@media (max-width: 800px) {
.app-shell {
--table-empty-page-gutter: 34px; /* 2 * 16px shell padding + 2px table-section border */
padding: 16px;
gap: 16px;
}
Expand All @@ -840,6 +850,10 @@ select[data-inline-progress]:focus {
border-radius: var(--radius-sm);
padding: 16px;
}

.empty-state-cell > .table-empty {
padding: 48px 24px;
}
Comment thread
github-actions[bot] marked this conversation as resolved.
Resolved
}

@media (prefers-reduced-motion: reduce) {
Expand Down
10 changes: 5 additions & 5 deletions tests/config/test_strix_static_repo_adaptations.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ def test_kubernetes_deployment_uses_non_root_versioned_runtime() -> None:

assert 'image: scopeweave:latest' not in deployment_source
assert 'image: scopeweave:1.0.0' in deployment_source
assert 'namespace: scopeweave' in deployment_source
assert 'namespace: scopeweave' in service_source
assert 'runAsNonRoot: true' in deployment_source
assert 'runAsUser: 101' in deployment_source
assert 'runAsUser: 10001' in deployment_source
assert 'runAsGroup: 10001' in deployment_source
assert 'allowPrivilegeEscalation: false' in deployment_source
assert 'readOnlyRootFilesystem: true' in deployment_source
assert 'drop:' in deployment_source
Expand All @@ -54,10 +57,7 @@ def test_kubernetes_deployment_uses_non_root_versioned_runtime() -> None:


def test_companion_workflows_cover_named_requirements_manifests_and_full_history() -> None:
dependency_review_source = DEPENDENCY_REVIEW_WORKFLOW.read_text(encoding="utf-8")
osv_source = OSV_WORKFLOW.read_text(encoding="utf-8")

assert 'fetch-depth: 0' in dependency_review_source
assert 'dependency_graph?.status || \'unknown\'' in dependency_review_source
assert 'requirements(-[A-Za-z0-9._-]+)?\\.txt' in dependency_review_source
assert not DEPENDENCY_REVIEW_WORKFLOW.exists()
assert 'requirements(-[A-Za-z0-9._-]+)?\\.txt' in osv_source
29 changes: 29 additions & 0 deletions tests/e2e/csv_formula_fuzz.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const { test, expect } = require('@playwright/test');
const fc = require('fast-check');

test.describe('CSV formula fuzzing', () => {
test.beforeEach(async ({ page }) => {
await page.goto('./');
});

test('neutralizes spreadsheet formula prefixes before CSV escaping', async ({ page }) => {
await fc.assert(
fc.asyncProperty(fc.string({ maxLength: 128 }), async (candidate) => {
const result = await page.evaluate((value) => ({
escaped: window.csvEscape(value),
sanitized: window.sanitizeCsvFormulaValue(value)
}), candidate);
const normalized = String(candidate ?? '');
const dangerous = /^\s*[=+\-@|]/.test(normalized);
const expectedSanitized = dangerous ? `'${normalized}` : normalized;

expect(result.sanitized).toBe(expectedSanitized);
expect(result.escaped.startsWith('"')).toBe(true);
expect(result.escaped.endsWith('"')).toBe(true);
expect(result.escaped.slice(1, -1).replace(/""/g, '"')).toBe(expectedSanitized);
expect(/^\s*[=+\-@|]/.test(result.sanitized)).toBe(false);
}),
{ numRuns: 100, seed: 20260709 }
);
});
});
38 changes: 35 additions & 3 deletions tests/e2e/scopeweave.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ test.describe('ScopeWeave Planner', () => {
await page.setViewportSize({ width: 375, height: 667 });
await page.goto('./');

await expect(page.locator('tbody tr[data-task-id]')).toHaveCount(4);
const mobileColumns = await page.evaluate(() => {
const isVisible = (element) => getComputedStyle(element).display !== 'none';
const headers = Array.from(document.querySelectorAll('thead th'))
Expand Down Expand Up @@ -171,6 +172,37 @@ test.describe('ScopeWeave Planner', () => {
await expect(page.getByRole('button', { name: '간트차트보기' })).toHaveAttribute('title', '간트 차트로 표시할 작업이 없습니다. 작업을 먼저 추가해주세요.');
});

test('keeps the empty WBS state inside the mobile table viewport', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 667 });
await page.evaluate(() => {
localStorage.setItem('scopeweave:planner-state:v1', JSON.stringify({
projectName: 'Empty Scope',
baseDate: '2026-04-20',
tasks: []
}));
});
await page.reload();

await expect(page.locator('.empty-state-cell > .table-empty')).toBeVisible();
const layout = await page.evaluate(() => {
Comment thread
github-actions[bot] marked this conversation as resolved.
Resolved
const scrollRect = document.querySelector('.table-scroll').getBoundingClientRect();
const emptyRect = document.querySelector('.empty-state-cell > .table-empty').getBoundingClientRect();
const actionsRect = document.querySelector('.empty-state-cell .empty-actions').getBoundingClientRect();

return {
scrollLeft: scrollRect.left,
scrollRight: scrollRect.right,
emptyLeft: emptyRect.left,
emptyRight: emptyRect.right,
actionsRight: actionsRect.right
};
});

expect(layout.emptyLeft).toBeGreaterThanOrEqual(layout.scrollLeft - 1);
expect(layout.emptyRight).toBeLessThanOrEqual(layout.scrollRight + 1);
expect(layout.actionsRight).toBeLessThanOrEqual(layout.scrollRight + 1);
});

test('adds a top-level task and restores it after reload', async ({ page }) => {
const phaseName = 'P1000.분석단계';

Expand Down Expand Up @@ -924,18 +956,18 @@ test.describe('ScopeWeave Planner', () => {
test('neutralizes spreadsheet formulas during CSV import', async ({ page }) => {
const csvText = [
'단계,Activity,Task,대분류,중분류,산출물,담당자,지원팀,실적진척상태,계획시작일,계획종료일,실적시작일,실적종료일',
`"=HYPERLINK(""http://evil.test"",""Click"")",@SUM(1,1),+cmd,|DDE,,"|'cmd' /C calc'!A0",담당자A,지원팀A,미착수(0%),2026-05-18,2026-05-20,,`
`"=HYPERLINK(""http://evil.test"",""Click"")","@SUM(1,1)",+cmd,|DDE,,"|'cmd' /C calc'!A0",담당자A,지원팀A,미착수(0%),2026-05-18,2026-05-20,,`
].join('\n');

await importCsv(page, csvText);

const savedState = await page.evaluate(() => JSON.parse(localStorage.getItem('scopeweave:planner-state:v1')));
const [savedTask] = savedState.tasks;
const savedTask = savedState.tasks.find((task) => task.depth === 3);
expect(savedTask.phase).toBe('\'=HYPERLINK("http://evil.test","Click")');
expect(savedTask.activity).toBe("'@SUM(1,1)");
expect(savedTask.task).toBe("'+cmd");
expect(savedTask.categoryLarge).toBe("'|DDE");
expect(savedTask.deliverable).toBe("'|'cmd' /C calc'!A0");
expect(savedTask.documentName).toBe("'|'cmd' /C calc'!A0");
});

test('buildWeekdayTimeline handles normal, same, reversed, and weekend dates', async ({ page }) => {
Expand Down
Loading