Publish browser-local scope change impact matrix
Browse files- LICENSE +9 -0
- README.md +9 -4
- app.js +2 -0
- en/index.html +1 -0
- fixtures/LICENSE.md +3 -0
- fixtures/invalid.json +1 -0
- fixtures/valid.json +32 -0
- index.html +2 -19
- ru/index.html +2 -0
- src/core.js +3 -0
- styles.css +1 -0
- verify.mjs +1 -0
LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2026 SHAR Production
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
| 6 |
+
|
| 7 |
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
| 8 |
+
|
| 9 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
README.md
CHANGED
|
@@ -1,10 +1,15 @@
|
|
| 1 |
---
|
| 2 |
title: Scope Change Impact Matrix
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
| 8 |
---
|
|
|
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: Scope Change Impact Matrix
|
| 3 |
+
emoji: 📊
|
| 4 |
+
colorFrom: red
|
| 5 |
+
colorTo: red
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
license: mit
|
| 9 |
---
|
| 10 |
+
# Scope Change Impact Matrix
|
| 11 |
|
| 12 |
+
Browser-local comparison of baseline and proposed production dependency maps. It identifies direct, possible and unknown impacts without calculating prices.
|
| 13 |
+
|
| 14 |
+
Published by [SHAR Production](https://sharprod.com/), an AI-hybrid video production studio.
|
| 15 |
+
|
app.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { evaluate, example } from './src/core.js';
|
| 2 |
+
const q=s=>document.querySelector(s);q('#input').value=JSON.stringify(example,null,2);q('#run').addEventListener('click',()=>{try{q('#output').textContent=JSON.stringify(evaluate(JSON.parse(q('#input').value)),null,2)}catch(e){q('#output').textContent=JSON.stringify({valid:false,errors:[{code:'JSON',message:e.message}]},null,2)}});const u=new URL('https://sharprod.com/pricing/');u.searchParams.set('utm_source','shar_public_tool');u.searchParams.set('utm_medium','referral');u.searchParams.set('utm_campaign','scope-change-impact-matrix');u.searchParams.set('utm_content',document.documentElement.lang);q('#cta').href=u.href;
|
en/index.html
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="robots" content="noindex,nofollow"><title>Scope Change Impact Matrix · SHAR Production</title><meta name="description" content="Map declared scope changes and dependencies without calculating prices."><link rel="stylesheet" href="../styles.css"></head><body><main><a class="lang" href="../ru/">Русский</a><p class="brand">SHAR Production</p><h1>Scope Change Impact Matrix</h1><p>Map declared scope changes and dependencies without calculating prices.</p><p>Data is processed only in this browser. Do not paste personal data, credentials or confidential material.</p><textarea id="input" aria-label="JSON input"></textarea><button id="run">Evaluate</button><pre id="output" aria-live="polite"></pre><a class="cta" id="cta" href="https://sharprod.com/pricing/">Discuss a project</a></main><script type="module" src="../app.js"></script></body></html>
|
fixtures/LICENSE.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CC BY 4.0 synthetic fixtures
|
| 2 |
+
|
| 3 |
+
Synthetic examples in this directory are licensed under CC BY 4.0. Attribution: SHAR Production — Scope Change Impact Matrix, https://sharprod.com/. No real client or private data.
|
fixtures/invalid.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{}
|
fixtures/valid.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"baseline": [
|
| 3 |
+
{
|
| 4 |
+
"id": "edit",
|
| 5 |
+
"dependencies": []
|
| 6 |
+
},
|
| 7 |
+
{
|
| 8 |
+
"id": "grade",
|
| 9 |
+
"dependencies": [
|
| 10 |
+
"edit"
|
| 11 |
+
]
|
| 12 |
+
}
|
| 13 |
+
],
|
| 14 |
+
"proposed": [
|
| 15 |
+
{
|
| 16 |
+
"id": "edit",
|
| 17 |
+
"dependencies": []
|
| 18 |
+
},
|
| 19 |
+
{
|
| 20 |
+
"id": "grade",
|
| 21 |
+
"dependencies": [
|
| 22 |
+
"edit"
|
| 23 |
+
]
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"id": "social",
|
| 27 |
+
"dependencies": [
|
| 28 |
+
"grade"
|
| 29 |
+
]
|
| 30 |
+
}
|
| 31 |
+
]
|
| 32 |
+
}
|
index.html
CHANGED
|
@@ -1,19 +1,2 @@
|
|
| 1 |
-
<!doctype html>
|
| 2 |
-
|
| 3 |
-
<head>
|
| 4 |
-
<meta charset="utf-8" />
|
| 5 |
-
<meta name="viewport" content="width=device-width" />
|
| 6 |
-
<title>My static Space</title>
|
| 7 |
-
<link rel="stylesheet" href="style.css" />
|
| 8 |
-
</head>
|
| 9 |
-
<body>
|
| 10 |
-
<div class="card">
|
| 11 |
-
<h1>Welcome to your static Space!</h1>
|
| 12 |
-
<p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
|
| 13 |
-
<p>
|
| 14 |
-
Also don't forget to check the
|
| 15 |
-
<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
|
| 16 |
-
</p>
|
| 17 |
-
</div>
|
| 18 |
-
</body>
|
| 19 |
-
</html>
|
|
|
|
| 1 |
+
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="robots" content="index,follow"><link rel="canonical" href="https://sharproduction-scope-change-impact-matrix.static.hf.space/"><link rel="alternate" hreflang="en" href="https://sharproduction-scope-change-impact-matrix.static.hf.space/"><link rel="alternate" hreflang="ru" href="https://sharproduction-scope-change-impact-matrix.static.hf.space/ru/index.html"><title>Scope Change Impact Matrix · SHAR Production</title><meta name="description" content="Map declared scope changes and dependencies without calculating prices."><link rel="stylesheet" href="./styles.css"></head><body><main><a class="lang" href="./ru/index.html">Русский</a><p class="brand">SHAR Production</p><h1>Scope Change Impact Matrix</h1><p>Map declared scope changes and dependencies without calculating prices.</p><p>Data is processed only in this browser. Do not paste personal data, credentials or confidential material.</p><textarea id="input" aria-label="JSON input"></textarea><button id="run">Evaluate</button><pre id="output" aria-live="polite"></pre><a class="cta" id="cta" href="https://sharprod.com/pricing/">Discuss a project</a></main><script type="module" src="./app.js"></script></body></html>
|
| 2 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ru/index.html
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!doctype html><html lang="ru"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="robots" content="index,follow"><link rel="canonical" href="https://sharproduction-scope-change-impact-matrix.static.hf.space/ru/index.html"><link rel="alternate" hreflang="en" href="https://sharproduction-scope-change-impact-matrix.static.hf.space/"><link rel="alternate" hreflang="ru" href="https://sharproduction-scope-change-impact-matrix.static.hf.space/ru/index.html"><title>Матрица влияния изменений объёма · SHAR Production</title><meta name="description" content="Показывает влияние изменений и заявленных зависимостей без расчёта цен."><link rel="stylesheet" href="../styles.css"></head><body><main><a class="lang" href="../index.html">English</a><p class="brand">SHAR Production</p><h1>Матрица влияния изменений объёма</h1><p>Показывает влияние изменений и заявленных зависимостей без расчёта цен.</p><p>Данные обрабатываются только в браузере. Не вставляйте персональные данные, реквизиты доступа или конфиденциальные материалы.</p><textarea id="input" aria-label="JSON input"></textarea><button id="run">Рассчитать</button><pre id="output" aria-live="polite"></pre><a class="cta" id="cta" href="https://sharprod.com/pricing/">Обсудить проект</a></main><script type="module" src="../app.js"></script></body></html>
|
| 2 |
+
|
src/core.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export const example={baseline:[{id:'edit',dependencies:[]},{id:'grade',dependencies:['edit']}],proposed:[{id:'edit',dependencies:[]},{id:'grade',dependencies:['edit']},{id:'social',dependencies:['grade']}]};
|
| 2 |
+
function cycles(items){const m=new Map(items.map(x=>[x.id,x.dependencies??[]])),vis=new Set,stack=new Set,out=[];function go(id){if(stack.has(id)){out.push(id);return}if(vis.has(id))return;vis.add(id);stack.add(id);for(const d of m.get(id)??[])if(m.has(d))go(d);stack.delete(id)}for(const id of m.keys())go(id);return out}
|
| 3 |
+
export function evaluate(x){if(!Array.isArray(x?.baseline)||!Array.isArray(x?.proposed))return{valid:false,errors:[{code:'INPUT'}],matrix:[]};const errors=[],a=new Map(x.baseline.map(i=>[i.id,i])),b=new Map(x.proposed.map(i=>[i.id,i]));const dup=list=>new Set(list.map(x=>x.id)).size!==list.length;if(dup(x.baseline)||dup(x.proposed))errors.push({code:'DUPLICATE_ID'});const cyc=cycles(x.proposed);if(cyc.length)errors.push({code:'CYCLE',ids:cyc});const ids=new Set([...a.keys(),...b.keys()]),changed=new Set([...ids].filter(id=>!a.has(id)||!b.has(id)||JSON.stringify(a.get(id).dependencies??[])!==JSON.stringify(b.get(id).dependencies??[])));const reachesChange=(id,seen=new Set)=>{if(seen.has(id))return false;seen.add(id);return(b.get(id)?.dependencies??[]).some(d=>changed.has(d)||reachesChange(d,seen))};const matrix=[...ids].sort().map(id=>{let impact=!a.has(id)?'direct':!b.has(id)?'direct':changed.has(id)?'direct':'none';if(impact==='none'&&reachesChange(id))impact='possible';const unknown=(b.get(id)?.dependencies??[]).filter(d=>!b.has(d));if(unknown.length)impact='unknown';return{id,change:!a.has(id)?'added':!b.has(id)?'removed':changed.has(id)?'modified':'unchanged',impact,unknownDependencies:unknown}});return{valid:errors.length===0,errors,matrix}}
|
styles.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
:root{font:16px/1.5 system-ui;color:#181817;background:#efeee8}body{margin:0}main{max-width:820px;margin:5vh auto;padding:32px;background:#fff;border-radius:18px;box-shadow:0 12px 40px #0001}.brand{font-weight:800;letter-spacing:.07em}.lang{float:right}textarea{box-sizing:border-box;width:100%;min-height:280px;padding:16px;font:14px/1.5 ui-monospace,monospace}button,.cta{display:inline-block;margin:16px 12px 0 0;padding:11px 16px;border:0;border-radius:8px;color:#fff;background:#161616;text-decoration:none;cursor:pointer}pre{white-space:pre-wrap;overflow:auto;background:#eee;padding:16px;border-radius:8px}@media(max-width:860px){main{margin:0;border-radius:0;min-height:100vh;padding:20px}.lang{float:none;display:block}}
|
verify.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import assert from 'node:assert/strict';import{evaluate}from'./src/core.js';const x=evaluate({baseline:[{id:'a',dependencies:[]}],proposed:[{id:'a',dependencies:[]},{id:'b',dependencies:['a']} ]});assert.equal(x.valid,true);assert.equal(x.matrix.find(x=>x.id==='b').impact,'direct');const y=evaluate({baseline:[],proposed:[{id:'a',dependencies:['b']},{id:'b',dependencies:['a']}]});assert.ok(y.errors.some(e=>e.code==='CYCLE'));console.log('PASS scope matrix 2/2');
|